@dotit/editor 1.0.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/LICENSE +21 -0
- package/README.md +92 -0
- package/dist/DocsToolbar.d.ts +17 -0
- package/dist/IntentTextEditor.d.ts +29 -0
- package/dist/TrustBanner.d.ts +11 -0
- package/dist/VisualEditor.d.ts +17 -0
- package/dist/block-props.d.ts +25 -0
- package/dist/bridge.d.ts +14 -0
- package/dist/extensions.d.ts +17 -0
- package/dist/font-size.d.ts +11 -0
- package/dist/index.cjs +32 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.mjs +3142 -0
- package/dist/index.mjs.map +1 -0
- package/dist/keyword-styles.d.ts +18 -0
- package/dist/page-geometry.d.ts +23 -0
- package/dist/pagination.d.ts +11 -0
- package/dist/print-iframe.d.ts +1 -0
- package/dist/print.d.ts +7 -0
- package/dist/style.css +1364 -0
- package/dist/template-highlight.d.ts +13 -0
- package/dist/trust-state.d.ts +34 -0
- package/dist/types.d.ts +14 -0
- package/package.json +82 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type StyleProperty = "align" | "color" | "bgcolor" | "size" | "weight" | "style" | "border" | "padding" | "indent" | "opacity" | "radius" | "shadow" | "width" | "height" | "spacing" | "columns" | "font" | "leading" | "striped" | "icon" | "blur" | "angle" | "family" | "margins";
|
|
2
|
+
interface StyleRule {
|
|
3
|
+
property: StyleProperty;
|
|
4
|
+
css: string;
|
|
5
|
+
transform?: (v: string) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare const KEYWORD_STYLES: Record<string, StyleRule[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Build a CSSProperties-like object from a block's pipe properties.
|
|
10
|
+
* Unknown properties are silently ignored.
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeKeywordStyles(blockType: string, properties: Record<string, string>): Record<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns which style properties are recognised for a given keyword.
|
|
15
|
+
* Used by editor autocomplete to suggest pipe properties.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getStyleProperties(blockType: string): StyleProperty[];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const MM: number;
|
|
2
|
+
export interface PageGeometry {
|
|
3
|
+
/** Page width in px. */
|
|
4
|
+
width: number;
|
|
5
|
+
/** Page height in px — Infinity when height is `auto` (continuous receipt). */
|
|
6
|
+
height: number;
|
|
7
|
+
/** True when the page grows with content (e.g. `80mm auto`): no pagination. */
|
|
8
|
+
autoHeight: boolean;
|
|
9
|
+
marginTop: number;
|
|
10
|
+
marginRight: number;
|
|
11
|
+
marginBottom: number;
|
|
12
|
+
marginLeft: number;
|
|
13
|
+
/** Height available for content on one page (height - vertical margins). */
|
|
14
|
+
contentHeight: number;
|
|
15
|
+
/** Header text ('' if none). Supports {{page}}/{{pages}} tokens. */
|
|
16
|
+
header: string;
|
|
17
|
+
/** Footer text ('' if none). Supports {{page}}/{{pages}} tokens. */
|
|
18
|
+
footer: string;
|
|
19
|
+
}
|
|
20
|
+
/** Compute the page geometry from `.it` source (its page:/header:/footer: blocks). */
|
|
21
|
+
export declare function getPageGeometry(source: string): PageGeometry;
|
|
22
|
+
/** Resolve {{page}}/{{pages}} tokens for on-screen display. */
|
|
23
|
+
export declare function resolvePageTokens(text: string, page: number, pages: number): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Extension } from "@tiptap/core";
|
|
2
|
+
import type { PageGeometry } from "./page-geometry";
|
|
3
|
+
export interface PaginationOptions {
|
|
4
|
+
/** Live geometry — read on every layout pass so doc edits apply instantly. */
|
|
5
|
+
geometry: () => PageGeometry;
|
|
6
|
+
/** Grey gap between page cards (px). */
|
|
7
|
+
gap: number;
|
|
8
|
+
/** Called with the resulting page count after each layout pass. */
|
|
9
|
+
onPages?: (pages: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const Pagination: Extension<PaginationOptions, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function printHtmlViaIframe(html: string): void;
|
package/dist/print.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type PrintMode = "normal" | "minimal-ink";
|
|
2
|
+
/** Print / save-as-PDF via the browser's print dialog. Browser-only. */
|
|
3
|
+
export declare function exportDocumentPDF(content: string, theme: string, printMode?: PrintMode): void;
|
|
4
|
+
/** Download the print-ready HTML document. Browser-only. */
|
|
5
|
+
export declare function exportDocumentHTML(content: string, theme: string, printMode?: PrintMode): void;
|
|
6
|
+
/** Built-in theme ids — for the ribbon's theme select. */
|
|
7
|
+
export declare function builtinThemes(): string[];
|