@paprize/core 0.0.10 → 0.0.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/paprize-core.d.ts +26 -8
- package/dist/paprize-core.js +299 -285
- package/dist/paprize-core.js.map +1 -1
- package/dist/paprize-core.umd.cjs +5 -7
- package/dist/paprize-core.umd.cjs.map +1 -1
- package/package.json +3 -3
package/dist/paprize-core.d.ts
CHANGED
|
@@ -55,9 +55,11 @@ export declare class EventDispatcher<TEvents> {
|
|
|
55
55
|
|
|
56
56
|
declare type EventHandler<TKey extends keyof TEvents, TEvents> = TEvents[TKey] extends (...args: infer TArgs) => infer TReturn ? (...args: TArgs) => TReturn : never;
|
|
57
57
|
|
|
58
|
+
export declare function getNodeLayoutOptionsFromAttribute(node: Node | null): Partial<LayoutOptions>;
|
|
59
|
+
|
|
58
60
|
export declare function getVisibleHeight(element: Element): number;
|
|
59
61
|
|
|
60
|
-
export declare const globalStyle = "\n html {\n box-sizing: border-box;\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n }\n\n :root {\n --paprize-page-background-color: #ffffff;\n --paprize-page-
|
|
62
|
+
export declare const globalStyle = "\n html {\n box-sizing: border-box;\n }\n\n *,\n *:before,\n *:after {\n box-sizing: inherit;\n }\n\n :root {\n --paprize-page-background-color: #ffffff;\n --paprize-page-box-shadow: rgb(142 138 138) -1px 3px 5px 2px;\n --paprize-section-margin-bottom: 10px;\n --paprize-preview-background-color: rgb(218 220 224);\n --paprize-preview-padding: 30px 10px;\n }\n\n body {\n margin: 0;\n }\n \n @media screen {\n .pz-preview {\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n background-color: var(--paprize-preview-background-color);\n padding: var(--paprize-preview-padding);\n }\n\n .pz-page {\n box-shadow: var(--paprize-page-box-shadow);\n background-color: var(--paprize-page-background-color);\n }\n\n .pz-section {\n margin-bottom: var(--paprize-section-margin-bottom);\n }\n }\n\n @media print {\n html:has(.pz-preview) *:not(.pz-preview):not(.pz-preview *):not(:has(.pz-preview)) {\n display: none !important;\n }\n } \n ";
|
|
61
63
|
|
|
62
64
|
export declare const globalStyleId = "paprize-global-style";
|
|
63
65
|
|
|
@@ -71,6 +73,12 @@ export declare function isElement(node: Node): node is Element;
|
|
|
71
73
|
|
|
72
74
|
export declare function isTextNode(node: Node): node is Text;
|
|
73
75
|
|
|
76
|
+
export declare const layoutOptionHyphenationDisabledAttribute = "data-pz-hyphenation-disabled";
|
|
77
|
+
|
|
78
|
+
export declare const layoutOptionHyphenAttribute = "data-pz-hyphen";
|
|
79
|
+
|
|
80
|
+
export declare const layoutOptionKeepOnSamePageAttribute = "data-pz-keep-on-same-page";
|
|
81
|
+
|
|
74
82
|
/**
|
|
75
83
|
* Layout options for the pagination engine
|
|
76
84
|
*/
|
|
@@ -340,6 +348,7 @@ export declare interface PaginationPlugin {
|
|
|
340
348
|
afterVisitNode?: (id: string, result: SplitResult, domState: DomState, pageManager: PageManager) => void;
|
|
341
349
|
onNewPage?: (id: string, pageManager: PageManager) => void;
|
|
342
350
|
onClone?: (id: string, source: Element, cloned: PageElement) => void;
|
|
351
|
+
afterPagination?: (id: string, domState: DomState, pageManager: PageManager) => void;
|
|
343
352
|
}
|
|
344
353
|
|
|
345
354
|
export declare class Paginator {
|
|
@@ -470,10 +479,6 @@ export declare interface ReportBuilderEvents {
|
|
|
470
479
|
paginationCycleCompleted: (event: PaginationCycleCompleted) => void;
|
|
471
480
|
}
|
|
472
481
|
|
|
473
|
-
export declare interface ReportContext {
|
|
474
|
-
jsonData: unknown | null;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
482
|
export declare const reportStyles: {
|
|
478
483
|
globalStyle: string;
|
|
479
484
|
component: CSSProperties;
|
|
@@ -564,6 +569,18 @@ export declare interface SectionContext {
|
|
|
564
569
|
* All paginated pages that belong to this section.
|
|
565
570
|
*/
|
|
566
571
|
pages: PageContext[];
|
|
572
|
+
/**
|
|
573
|
+
* Options used for paginating this section.
|
|
574
|
+
*
|
|
575
|
+
* @remarks
|
|
576
|
+
* Options may differ from the original {@link SectionOptions}
|
|
577
|
+
* provided during section creation, as some values may be
|
|
578
|
+
*/
|
|
579
|
+
options: SectionOptions;
|
|
580
|
+
/**
|
|
581
|
+
* Components used in this section.
|
|
582
|
+
*/
|
|
583
|
+
components: SectionComponents;
|
|
567
584
|
}
|
|
568
585
|
|
|
569
586
|
/**
|
|
@@ -598,10 +615,8 @@ export declare interface SectionOptions extends Partial<Omit<PaginationOptions,
|
|
|
598
615
|
declare function sectionPageMedia(sectionId: string, size: PageSize): string;
|
|
599
616
|
|
|
600
617
|
export declare interface SectionState {
|
|
601
|
-
options: SectionOptions;
|
|
602
618
|
context: SectionContext;
|
|
603
|
-
|
|
604
|
-
onPaginationCompleted: (pages: PageContext[]) => Promise<unknown> | void;
|
|
619
|
+
onPaginationCompleted: (context: SectionContext) => Promise<unknown> | void;
|
|
605
620
|
}
|
|
606
621
|
|
|
607
622
|
export declare const sectionTocName = "sectionToc";
|
|
@@ -638,6 +653,9 @@ export declare class TablePlugin implements PaginationPlugin {
|
|
|
638
653
|
order: number;
|
|
639
654
|
constructor(options?: TablePluginOptions);
|
|
640
655
|
onNewPage: (_id: string, pageManager: PageManager) => void;
|
|
656
|
+
onVisitElement: (_id: string, domState: DomState & {
|
|
657
|
+
currentNode: PageElement;
|
|
658
|
+
}, _pageManager: PageManager, context: VisitContext) => void;
|
|
641
659
|
onClone: (_id: string, source: Element, cloned: PageElement) => void;
|
|
642
660
|
private _isTable;
|
|
643
661
|
private _isTableBodyEmpty;
|