@dotit/editor 1.0.0 → 1.2.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/DocsToolbar.d.ts +12 -2
- package/dist/Ruler.d.ts +23 -0
- package/dist/TrustControl.d.ts +13 -0
- package/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1841 -1324
- package/dist/index.mjs.map +1 -1
- package/dist/line-keymap.d.ts +2 -0
- package/dist/page-geometry.d.ts +9 -0
- package/dist/print.d.ts +3 -0
- package/dist/style.css +434 -137
- package/package.json +3 -3
package/dist/page-geometry.d.ts
CHANGED
|
@@ -16,8 +16,17 @@ export interface PageGeometry {
|
|
|
16
16
|
header: string;
|
|
17
17
|
/** Footer text ('' if none). Supports {{page}}/{{pages}} tokens. */
|
|
18
18
|
footer: string;
|
|
19
|
+
/** Ruler unit derived from the page size (A-series → cm, Letter/Legal → in). */
|
|
20
|
+
unit: "cm" | "in";
|
|
19
21
|
}
|
|
20
22
|
/** Compute the page geometry from `.it` source (its page:/header:/footer: blocks). */
|
|
21
23
|
export declare function getPageGeometry(source: string): PageGeometry;
|
|
24
|
+
/**
|
|
25
|
+
* Set (or replace) the `margin:` property on the document's `page:` block.
|
|
26
|
+
* Idempotent: replaces any existing margin/margins prop rather than appending,
|
|
27
|
+
* so repeated ruler drags never accumulate duplicate pipe segments. Inserts a
|
|
28
|
+
* `page:` block (after the meta/title preamble) when the document has none.
|
|
29
|
+
*/
|
|
30
|
+
export declare function setPageMargin(source: string, marginValue: string): string;
|
|
22
31
|
/** Resolve {{page}}/{{pages}} tokens for on-screen display. */
|
|
23
32
|
export declare function resolvePageTokens(text: string, page: number, pages: number): string;
|
package/dist/print.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type PrintMode = "normal" | "minimal-ink";
|
|
2
2
|
/** Print / save-as-PDF via the browser's print dialog. Browser-only. */
|
|
3
3
|
export declare function exportDocumentPDF(content: string, theme: string, printMode?: PrintMode): void;
|
|
4
|
+
/** Download the raw `.it` source as a file. This is the editor's "Save".
|
|
5
|
+
* Derives a filename from the document's meta id / title when available. */
|
|
6
|
+
export declare function downloadItFile(content: string, filename?: string): void;
|
|
4
7
|
/** Download the print-ready HTML document. Browser-only. */
|
|
5
8
|
export declare function exportDocumentHTML(content: string, theme: string, printMode?: PrintMode): void;
|
|
6
9
|
/** Built-in theme ids — for the ribbon's theme select. */
|