@pdfme/ui 1.0.0-beta.2 → 1.0.0-beta.3

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.
@@ -1,2 +0,0 @@
1
- import { BarCodeType } from './type';
2
- export declare const validateBarcodeInput: (type: BarCodeType, input: string) => boolean;
@@ -1,12 +0,0 @@
1
- export declare const uuid: () => string;
2
- export declare const set: <T extends object>(obj: T, path: string | string[], value: any) => void;
3
- export declare const debounce: <T extends Function>(cb: T, wait?: number) => T;
4
- export declare const cloneDeep: <T>(value: T) => T;
5
- export declare const uniq: <T>(array: T[]) => T[];
6
- export declare const round: (number: number, precision: number) => number;
7
- export declare const b64toUint8Array: (base64: string) => Uint8Array;
8
- export declare const b64toBlob: (base64: string) => Blob;
9
- export declare const arrayMove: <T>(array: T[], from: number, to: number) => T[];
10
- export declare const flatten: <T>(arr: T[][]) => T[];
11
- export declare const pt2mm: (pt: number) => number;
12
- export declare const mm2pt: (mm: number) => number;
@@ -1,84 +0,0 @@
1
- import { Template, Size, UIProps, PreviewProps, UIOptions } from '../../../common/src/type';
2
- interface CommonConstructor {
3
- domContainer: HTMLElement;
4
- template: Template;
5
- options?: UIOptions;
6
- }
7
- export declare type DesignerConstructor = CommonConstructor;
8
- export declare type PreviewUIConstructor = CommonConstructor & {
9
- inputs: {
10
- [key: string]: string;
11
- }[];
12
- };
13
- export declare abstract class BaseUIClass {
14
- protected domContainer: HTMLElement | null;
15
- protected template: Template;
16
- protected size: Size;
17
- private readonly lang;
18
- private readonly font;
19
- private readonly setSize;
20
- constructor(props: UIProps);
21
- protected getI18n(): (key: "type" | "field" | "fieldName" | "require" | "uniq" | "inputExample" | "edit" | "plsSelect" | "plsInputName" | "plsAddNewField" | "fieldMustUniq" | "notUniq" | "noKeyName" | "fieldsList" | "addNewField" | "editField" | "previewWarnMsg" | "previewErrMsg" | "goToFirst" | "goToPrevious" | "goToNext" | "goToEnd" | "select" | "errorOccurred") => string;
22
- protected getFont(): Record<string, {
23
- fallback?: boolean | undefined;
24
- subset?: boolean | undefined;
25
- data: ArrayBuffer | Uint8Array;
26
- }>;
27
- getTemplate(): {
28
- sampledata?: Record<string, string>[] | undefined;
29
- columns?: string[] | undefined;
30
- schemas: Record<string, {
31
- rotate?: number | undefined;
32
- alignment?: "left" | "center" | "right" | undefined;
33
- fontSize?: number | undefined;
34
- fontName?: string | undefined;
35
- fontColor?: string | undefined;
36
- backgroundColor?: string | undefined;
37
- characterSpacing?: number | undefined;
38
- lineHeight?: number | undefined;
39
- type: "text";
40
- height: number;
41
- width: number;
42
- position: {
43
- x: number;
44
- y: number;
45
- };
46
- } | {
47
- rotate?: number | undefined;
48
- type: "image";
49
- height: number;
50
- width: number;
51
- position: {
52
- x: number;
53
- y: number;
54
- };
55
- } | {
56
- rotate?: number | undefined;
57
- type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
58
- height: number;
59
- width: number;
60
- position: {
61
- x: number;
62
- y: number;
63
- };
64
- }>[];
65
- basePdf: string | ArrayBuffer | Uint8Array;
66
- };
67
- updateTemplate(template: Template): void;
68
- destroy(): void;
69
- protected abstract render(): void;
70
- }
71
- export declare abstract class PreviewUI extends BaseUIClass {
72
- protected inputs: {
73
- [key: string]: string;
74
- }[];
75
- constructor(props: PreviewProps);
76
- getInputs(): {
77
- [key: string]: string;
78
- }[];
79
- setInputs(inputs: {
80
- [key: string]: string;
81
- }[]): void;
82
- protected abstract render(): void;
83
- }
84
- export {};
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const I18nContext: import("react").Context<(key: "type" | "field" | "fieldName" | "require" | "uniq" | "inputExample" | "edit" | "plsSelect" | "plsInputName" | "plsAddNewField" | "fieldMustUniq" | "notUniq" | "noKeyName" | "fieldsList" | "addNewField" | "editField" | "previewWarnMsg" | "previewErrMsg" | "goToFirst" | "goToPrevious" | "goToNext" | "goToEnd" | "select" | "errorOccurred") => string>;
3
- export declare const FontContext: import("react").Context<Record<string, {
4
- fallback?: boolean | undefined;
5
- subset?: boolean | undefined;
6
- data: ArrayBuffer | Uint8Array;
7
- }>>;
@@ -1,64 +0,0 @@
1
- import { Template } from '../../../common/src/type';
2
- declare const esc = "esc";
3
- export declare const initShortCuts: (arg: {
4
- move: (command: 'up' | 'down' | 'left' | 'right', isShift: boolean) => void;
5
- remove: () => void;
6
- esc: () => void;
7
- copy: () => void;
8
- paste: () => void;
9
- redo: () => void;
10
- undo: () => void;
11
- save: () => void;
12
- }) => void;
13
- export declare const destroyShortCuts: () => void;
14
- export declare const readFiles: (files: FileList | null, type: 'text' | 'dataURL' | 'arrayBuffer') => Promise<string | ArrayBuffer>;
15
- export declare const getPdfPageSizes: (pdfBlob: Blob) => Promise<{
16
- height: number;
17
- width: number;
18
- }[]>;
19
- export declare const pdf2Pngs: (pdfBlob: Blob, width: number) => Promise<string[]>;
20
- export declare const templateSchemas2SchemasList: (_template: Template) => Promise<({
21
- rotate?: number | undefined;
22
- alignment?: "left" | "center" | "right" | undefined;
23
- fontSize?: number | undefined;
24
- fontName?: string | undefined;
25
- fontColor?: string | undefined;
26
- backgroundColor?: string | undefined;
27
- characterSpacing?: number | undefined;
28
- lineHeight?: number | undefined;
29
- type: "text";
30
- height: number;
31
- width: number;
32
- position: {
33
- x: number;
34
- y: number;
35
- };
36
- data: string;
37
- id: string;
38
- key: string;
39
- } | {
40
- rotate?: number | undefined;
41
- type: "image";
42
- height: number;
43
- width: number;
44
- position: {
45
- x: number;
46
- y: number;
47
- };
48
- data: string;
49
- id: string;
50
- key: string;
51
- } | {
52
- rotate?: number | undefined;
53
- type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
54
- height: number;
55
- width: number;
56
- position: {
57
- x: number;
58
- y: number;
59
- };
60
- data: string;
61
- id: string;
62
- key: string;
63
- })[][]>;
64
- export {};
@@ -1,26 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { Template, Size } from '../../../common/src/type';
3
- export declare const usePrevious: <T>(value: T) => T | null;
4
- declare type UIPreProcessorProps = {
5
- template: Template;
6
- size: Size;
7
- offset?: number;
8
- };
9
- export declare const useUIPreProcessor: ({ template, size, offset }: UIPreProcessorProps) => {
10
- backgrounds: string[];
11
- pageSizes: {
12
- height: number;
13
- width: number;
14
- }[];
15
- scale: number;
16
- error: Error | null;
17
- };
18
- declare type ScrollPageCursorProps = {
19
- rootRef: RefObject<HTMLDivElement>;
20
- pageSizes: Size[];
21
- scale: number;
22
- pageCursor: number;
23
- onChangePageCursor: (page: number) => void;
24
- };
25
- export declare const useScrollPageCursor: ({ rootRef, pageSizes, scale, pageCursor, onChangePageCursor, }: ScrollPageCursorProps) => void;
26
- export {};
@@ -1,30 +0,0 @@
1
- import { Lang } from '../../../common/src/type';
2
- declare type DictEn = typeof dictEn;
3
- declare const dictEn: {
4
- field: string;
5
- fieldName: string;
6
- require: string;
7
- uniq: string;
8
- inputExample: string;
9
- edit: string;
10
- plsSelect: string;
11
- plsInputName: string;
12
- plsAddNewField: string;
13
- fieldMustUniq: string;
14
- notUniq: string;
15
- noKeyName: string;
16
- fieldsList: string;
17
- addNewField: string;
18
- editField: string;
19
- type: string;
20
- previewWarnMsg: string;
21
- previewErrMsg: string;
22
- goToFirst: string;
23
- goToPrevious: string;
24
- goToNext: string;
25
- goToEnd: string;
26
- select: string;
27
- errorOccurred: string;
28
- };
29
- export declare const curriedI18n: (lang: Lang) => (key: keyof DictEn) => string;
30
- export {};
@@ -1,64 +0,0 @@
1
- import { Template } from '../../../common/src/type';
2
- declare const esc = "esc";
3
- export declare const initShortCuts: (arg: {
4
- move: (command: 'up' | 'down' | 'left' | 'right', isShift: boolean) => void;
5
- remove: () => void;
6
- esc: () => void;
7
- copy: () => void;
8
- paste: () => void;
9
- redo: () => void;
10
- undo: () => void;
11
- save: () => void;
12
- }) => void;
13
- export declare const destroyShortCuts: () => void;
14
- export declare const readFiles: (files: FileList | null, type: 'text' | 'dataURL' | 'arrayBuffer') => Promise<string | ArrayBuffer>;
15
- export declare const templateSchemas2SchemasList: (_template: Template) => Promise<({
16
- rotate?: number | undefined;
17
- alignment?: "left" | "center" | "right" | undefined;
18
- fontSize?: number | undefined;
19
- fontName?: string | undefined;
20
- fontColor?: string | undefined;
21
- backgroundColor?: string | undefined;
22
- characterSpacing?: number | undefined;
23
- lineHeight?: number | undefined;
24
- type: "text";
25
- height: number;
26
- width: number;
27
- position: {
28
- x: number;
29
- y: number;
30
- };
31
- data: string;
32
- id: string;
33
- key: string;
34
- } | {
35
- rotate?: number | undefined;
36
- type: "image";
37
- height: number;
38
- width: number;
39
- position: {
40
- x: number;
41
- y: number;
42
- };
43
- data: string;
44
- id: string;
45
- key: string;
46
- } | {
47
- rotate?: number | undefined;
48
- type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
49
- height: number;
50
- width: number;
51
- position: {
52
- x: number;
53
- y: number;
54
- };
55
- data: string;
56
- id: string;
57
- key: string;
58
- })[][]>;
59
- export declare const getPdfPageSizes: (pdfBlob: Blob) => Promise<{
60
- height: number;
61
- width: number;
62
- }[]>;
63
- export declare const pdf2Pngs: (pdfBlob: Blob, width: number) => Promise<string[]>;
64
- export {};