@pdfme/ui 1.0.0-beta.3 → 1.0.0-beta.5
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/index.js +1 -1
- package/dist/index.js.LICENSE.txt +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/common/src/index.d.ts +4 -2
- package/dist/types/common/src/schema.d.ts +8 -8
- package/dist/types/common/src/type.d.ts +9 -9
- package/dist/types/ui/src/components/Designer/Sidebar/index.d.ts +1 -0
- package/dist/types/ui/src/components/Preview/Pager/Page.d.ts +1 -0
- package/dist/types/ui/src/components/Preview/Pager/Unit.d.ts +1 -0
- package/dist/types/ui/src/index.d.ts +3 -2
- package/package.json +9 -5
- package/src/index.ts +5 -41
- package/tsconfig.json +1 -0
@@ -1,4 +1,6 @@
|
|
1
1
|
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF } from './constants';
|
2
|
-
import {
|
2
|
+
import { schemaTypes, isImageSchema, isBarcodeSchema, isTextSchema } from './type';
|
3
|
+
import type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps } from './type';
|
3
4
|
import { getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput } from './helper';
|
4
|
-
export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF,
|
5
|
+
export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, schemaTypes, isTextSchema, isImageSchema, isBarcodeSchema, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, };
|
6
|
+
export type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps, };
|
@@ -343,11 +343,11 @@ export declare const SchemaForUI: z.ZodUnion<[z.ZodObject<z.extendShape<z.extend
|
|
343
343
|
characterSpacing?: number | undefined;
|
344
344
|
lineHeight?: number | undefined;
|
345
345
|
type: "text";
|
346
|
-
data: string;
|
347
346
|
position: {
|
348
347
|
x: number;
|
349
348
|
y: number;
|
350
349
|
};
|
350
|
+
data: string;
|
351
351
|
width: number;
|
352
352
|
height: number;
|
353
353
|
id: string;
|
@@ -362,11 +362,11 @@ export declare const SchemaForUI: z.ZodUnion<[z.ZodObject<z.extendShape<z.extend
|
|
362
362
|
characterSpacing?: number | undefined;
|
363
363
|
lineHeight?: number | undefined;
|
364
364
|
type: "text";
|
365
|
-
data: string;
|
366
365
|
position: {
|
367
366
|
x: number;
|
368
367
|
y: number;
|
369
368
|
};
|
369
|
+
data: string;
|
370
370
|
width: number;
|
371
371
|
height: number;
|
372
372
|
id: string;
|
@@ -395,11 +395,11 @@ export declare const SchemaForUI: z.ZodUnion<[z.ZodObject<z.extendShape<z.extend
|
|
395
395
|
}>, "strip", z.ZodTypeAny, {
|
396
396
|
rotate?: number | undefined;
|
397
397
|
type: "image";
|
398
|
-
data: string;
|
399
398
|
position: {
|
400
399
|
x: number;
|
401
400
|
y: number;
|
402
401
|
};
|
402
|
+
data: string;
|
403
403
|
width: number;
|
404
404
|
height: number;
|
405
405
|
id: string;
|
@@ -407,11 +407,11 @@ export declare const SchemaForUI: z.ZodUnion<[z.ZodObject<z.extendShape<z.extend
|
|
407
407
|
}, {
|
408
408
|
rotate?: number | undefined;
|
409
409
|
type: "image";
|
410
|
-
data: string;
|
411
410
|
position: {
|
412
411
|
x: number;
|
413
412
|
y: number;
|
414
413
|
};
|
414
|
+
data: string;
|
415
415
|
width: number;
|
416
416
|
height: number;
|
417
417
|
id: string;
|
@@ -440,11 +440,11 @@ export declare const SchemaForUI: z.ZodUnion<[z.ZodObject<z.extendShape<z.extend
|
|
440
440
|
}>, "strip", z.ZodTypeAny, {
|
441
441
|
rotate?: number | undefined;
|
442
442
|
type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
|
443
|
-
data: string;
|
444
443
|
position: {
|
445
444
|
x: number;
|
446
445
|
y: number;
|
447
446
|
};
|
447
|
+
data: string;
|
448
448
|
width: number;
|
449
449
|
height: number;
|
450
450
|
id: string;
|
@@ -452,11 +452,11 @@ export declare const SchemaForUI: z.ZodUnion<[z.ZodObject<z.extendShape<z.extend
|
|
452
452
|
}, {
|
453
453
|
rotate?: number | undefined;
|
454
454
|
type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
|
455
|
-
data: string;
|
456
455
|
position: {
|
457
456
|
x: number;
|
458
457
|
y: number;
|
459
458
|
};
|
459
|
+
data: string;
|
460
460
|
width: number;
|
461
461
|
height: number;
|
462
462
|
id: string;
|
@@ -2149,8 +2149,8 @@ export declare const PreviewProps: z.ZodObject<z.extendShape<z.extendShape<{
|
|
2149
2149
|
}>[];
|
2150
2150
|
basePdf: string | ArrayBuffer | Uint8Array;
|
2151
2151
|
};
|
2152
|
-
domContainer: HTMLElement;
|
2153
2152
|
inputs: Record<string, string>[];
|
2153
|
+
domContainer: HTMLElement;
|
2154
2154
|
}, {
|
2155
2155
|
options?: {
|
2156
2156
|
font?: Record<string, {
|
@@ -2200,8 +2200,8 @@ export declare const PreviewProps: z.ZodObject<z.extendShape<z.extendShape<{
|
|
2200
2200
|
}>[];
|
2201
2201
|
basePdf: string | ArrayBuffer | Uint8Array;
|
2202
2202
|
};
|
2203
|
-
domContainer: HTMLElement;
|
2204
2203
|
inputs: Record<string, string>[];
|
2204
|
+
domContainer: HTMLElement;
|
2205
2205
|
}>;
|
2206
2206
|
export declare const PreviewReactProps: z.ZodObject<z.extendShape<{
|
2207
2207
|
options: z.ZodOptional<z.ZodObject<z.extendShape<{
|
@@ -1,13 +1,7 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { Lang, Size, Alignment, BarcodeSchemaType, SchemaType, CommonSchema as _CommonSchema, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps } from './schema';
|
3
|
-
export declare type Lang = z.infer<typeof Lang>;
|
4
|
-
export declare type Size = z.infer<typeof Size>;
|
5
|
-
export declare type Alignment = z.infer<typeof Alignment>;
|
6
|
-
export declare type SchemaType = z.infer<typeof SchemaType>;
|
7
|
-
export declare const schemaTypes: readonly ["text", "image", "qrcode", "japanpost", "ean13", "ean8", "code39", "code128", "nw7", "itf14", "upca", "upce"];
|
8
|
-
export declare type BarCodeType = z.infer<typeof BarcodeSchemaType>;
|
9
|
-
export declare type TextSchema = z.infer<typeof TextSchema>;
|
10
3
|
declare type CommonSchema = z.infer<typeof _CommonSchema>;
|
4
|
+
export declare const schemaTypes: readonly ["text", "image", "qrcode", "japanpost", "ean13", "ean8", "code39", "code128", "nw7", "itf14", "upca", "upce"];
|
11
5
|
export declare const isTextSchema: (arg: CommonSchema) => arg is {
|
12
6
|
rotate?: number | undefined;
|
13
7
|
alignment?: "left" | "center" | "right" | undefined;
|
@@ -25,7 +19,6 @@ export declare const isTextSchema: (arg: CommonSchema) => arg is {
|
|
25
19
|
width: number;
|
26
20
|
height: number;
|
27
21
|
};
|
28
|
-
export declare type ImageSchema = z.infer<typeof ImageSchema>;
|
29
22
|
export declare const isImageSchema: (arg: CommonSchema) => arg is {
|
30
23
|
rotate?: number | undefined;
|
31
24
|
type: "image";
|
@@ -36,7 +29,6 @@ export declare const isImageSchema: (arg: CommonSchema) => arg is {
|
|
36
29
|
width: number;
|
37
30
|
height: number;
|
38
31
|
};
|
39
|
-
export declare type BarcodeSchema = z.infer<typeof BarcodeSchema>;
|
40
32
|
export declare const isBarcodeSchema: (arg: CommonSchema) => arg is {
|
41
33
|
rotate?: number | undefined;
|
42
34
|
type: "qrcode" | "japanpost" | "ean13" | "ean8" | "code39" | "code128" | "nw7" | "itf14" | "upca" | "upce";
|
@@ -47,6 +39,14 @@ export declare const isBarcodeSchema: (arg: CommonSchema) => arg is {
|
|
47
39
|
width: number;
|
48
40
|
height: number;
|
49
41
|
};
|
42
|
+
export declare type Lang = z.infer<typeof Lang>;
|
43
|
+
export declare type Size = z.infer<typeof Size>;
|
44
|
+
export declare type Alignment = z.infer<typeof Alignment>;
|
45
|
+
export declare type SchemaType = z.infer<typeof SchemaType>;
|
46
|
+
export declare type BarCodeType = z.infer<typeof BarcodeSchemaType>;
|
47
|
+
export declare type TextSchema = z.infer<typeof TextSchema>;
|
48
|
+
export declare type ImageSchema = z.infer<typeof ImageSchema>;
|
49
|
+
export declare type BarcodeSchema = z.infer<typeof BarcodeSchema>;
|
50
50
|
export declare type Schema = z.infer<typeof Schema>;
|
51
51
|
export declare type SchemaForUI = z.infer<typeof SchemaForUI>;
|
52
52
|
export declare type Font = z.infer<typeof Font>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import Designer from './Designer';
|
2
2
|
import Form from './Form';
|
3
3
|
import Viewer from './Viewer';
|
4
|
-
|
5
|
-
export {
|
4
|
+
export { Designer, Viewer, Form };
|
5
|
+
export type { Lang, Size, Alignment, SchemaType, BarCodeType, TextSchema, ImageSchema, BarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, } from '@pdfme/common';
|
6
|
+
export { BLANK_PDF, isTextSchema, isImageSchema, isBarcodeSchema, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, } from '@pdfme/common';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/ui",
|
3
|
-
"version": "1.0.0-beta.
|
3
|
+
"version": "1.0.0-beta.5",
|
4
4
|
"author": "hand-dot",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
},
|
12
12
|
"main": "dist/index.js",
|
13
13
|
"module": "src/index.ts",
|
14
|
-
"types": "dist/types/index.d.ts",
|
14
|
+
"types": "dist/types/ui/src/index.d.ts",
|
15
15
|
"engines": {
|
16
16
|
"node": ">=14"
|
17
17
|
},
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"prune": "ts-prune src"
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
|
-
"@pdfme/common": "^1.0.0-beta",
|
29
|
+
"@pdfme/common": "^1.0.0-beta.5",
|
30
30
|
"@scena/react-guides": "^0.16.0",
|
31
31
|
"hotkeys-js": "^3.8.7",
|
32
32
|
"pdfjs-dist": "^2.12.313",
|
@@ -76,5 +76,9 @@
|
|
76
76
|
"**/*.test.ts",
|
77
77
|
"**/*.test.tsx"
|
78
78
|
]
|
79
|
-
}
|
80
|
-
|
79
|
+
},
|
80
|
+
"publishConfig": {
|
81
|
+
"access": "public"
|
82
|
+
},
|
83
|
+
"stableVersion": "1.0.0-beta.4"
|
84
|
+
}
|
package/src/index.ts
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
import Designer from './Designer';
|
2
2
|
import Form from './Form';
|
3
3
|
import Viewer from './Viewer';
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
export { Designer, Viewer, Form };
|
6
|
+
|
7
|
+
export type {
|
6
8
|
Lang,
|
7
9
|
Size,
|
8
10
|
Alignment,
|
9
11
|
SchemaType,
|
10
|
-
schemaTypes,
|
11
12
|
BarCodeType,
|
12
13
|
TextSchema,
|
13
|
-
isTextSchema,
|
14
14
|
ImageSchema,
|
15
|
-
isImageSchema,
|
16
15
|
BarcodeSchema,
|
17
|
-
isBarcodeSchema,
|
18
16
|
Schema,
|
19
17
|
SchemaForUI,
|
20
18
|
Font,
|
@@ -26,52 +24,18 @@ import {
|
|
26
24
|
UIOptions,
|
27
25
|
UIProps,
|
28
26
|
PreviewProps,
|
29
|
-
PreviewReactProps,
|
30
27
|
DesignerProps,
|
31
|
-
DesignerReactProps,
|
32
|
-
checkTemplate,
|
33
|
-
checkUIProps,
|
34
|
-
checkPreviewProps,
|
35
|
-
checkDesignerProps,
|
36
|
-
checkGenerateProps,
|
37
|
-
validateBarcodeInput,
|
38
28
|
} from '@pdfme/common';
|
39
29
|
|
40
30
|
export {
|
41
|
-
Designer,
|
42
|
-
Viewer,
|
43
|
-
Form,
|
44
31
|
BLANK_PDF,
|
45
|
-
Lang,
|
46
|
-
Size,
|
47
|
-
Alignment,
|
48
|
-
SchemaType,
|
49
|
-
schemaTypes,
|
50
|
-
BarCodeType,
|
51
|
-
TextSchema,
|
52
32
|
isTextSchema,
|
53
|
-
ImageSchema,
|
54
33
|
isImageSchema,
|
55
|
-
BarcodeSchema,
|
56
34
|
isBarcodeSchema,
|
57
|
-
Schema,
|
58
|
-
SchemaForUI,
|
59
|
-
Font,
|
60
|
-
BasePdf,
|
61
|
-
Template,
|
62
|
-
CommonProps,
|
63
|
-
GeneratorOptions,
|
64
|
-
GenerateProps,
|
65
|
-
UIOptions,
|
66
|
-
UIProps,
|
67
|
-
PreviewProps,
|
68
|
-
PreviewReactProps,
|
69
|
-
DesignerProps,
|
70
|
-
DesignerReactProps,
|
71
35
|
checkTemplate,
|
72
36
|
checkUIProps,
|
73
37
|
checkPreviewProps,
|
74
38
|
checkDesignerProps,
|
75
39
|
checkGenerateProps,
|
76
40
|
validateBarcodeInput,
|
77
|
-
};
|
41
|
+
} from '@pdfme/common';
|