@pdfme/common 3.0.1-dev.22 → 3.0.1-dev.24

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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAOwB;AA2CtB,+FAjDA,6BAAc,OAiDA;AACd,+FAjDA,6BAAc,OAiDA;AACd,+FAjDA,6BAAc,OAiDA;AACd,0FAjDA,wBAAS,OAiDA;AACT,qFAjDA,mBAAI,OAiDA;AACJ,kGAjDA,gCAAiB,OAiDA;AAxBnB,2CAgBqB;AASnB,oGAxBA,+BAAmB,OAwBA;AACnB,+FAxBA,0BAAc,OAwBA;AACd,8FAxBA,yBAAa,OAwBA;AACb,gGAxBA,2BAAe,OAwBA;AAIf,0FA3BA,qBAAS,OA2BA;AACT,4FA3BA,uBAAW,OA2BA;AACX,+FA3BA,0BAAc,OA2BA;AACd,8FA3BA,yBAAa,OA2BA;AACb,6FA3BA,wBAAY,OA2BA;AACZ,kGA3BA,6BAAiB,OA2BA;AACjB,mGA3BA,8BAAkB,OA2BA;AAClB,mGA3BA,8BAAkB,OA2BA;AAVlB,sFAhBA,iBAAK,OAgBA;AACL,sFAhBA,iBAAK,OAgBA;AACL,sFAhBA,iBAAK,OAgBA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAOwB;AA4CtB,+FAlDA,6BAAc,OAkDA;AACd,+FAlDA,6BAAc,OAkDA;AACd,+FAlDA,6BAAc,OAkDA;AACd,0FAlDA,wBAAS,OAkDA;AACT,qFAlDA,mBAAI,OAkDA;AACJ,kGAlDA,gCAAiB,OAkDA;AAxBnB,2CAgBqB;AASnB,oGAxBA,+BAAmB,OAwBA;AACnB,+FAxBA,0BAAc,OAwBA;AACd,8FAxBA,yBAAa,OAwBA;AACb,gGAxBA,2BAAe,OAwBA;AAIf,0FA3BA,qBAAS,OA2BA;AACT,4FA3BA,uBAAW,OA2BA;AACX,+FA3BA,0BAAc,OA2BA;AACd,8FA3BA,yBAAa,OA2BA;AACb,6FA3BA,wBAAY,OA2BA;AACZ,kGA3BA,6BAAiB,OA2BA;AACjB,mGA3BA,8BAAkB,OA2BA;AAClB,mGA3BA,8BAAkB,OA2BA;AAVlB,sFAhBA,iBAAK,OAgBA;AACL,sFAhBA,iBAAK,OAgBA;AACL,sFAhBA,iBAAK,OAgBA"}
@@ -1,9 +1,54 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DesignerProps = exports.PreviewProps = exports.UIProps = exports.UIOptions = exports.GenerateProps = exports.GeneratorOptions = exports.Inputs = exports.Template = exports.BasePdf = exports.Font = exports.SchemaForUI = exports.Schema = exports.Size = exports.Lang = void 0;
3
+ exports.DesignerProps = exports.PreviewProps = exports.UIProps = exports.UIOptions = exports.GenerateProps = exports.GeneratorOptions = exports.Inputs = exports.Template = exports.BasePdf = exports.Font = exports.SchemaForUI = exports.Schema = exports.Size = exports.Dict = exports.Lang = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const langs = ['en', 'ja', 'ar', 'th', 'pl', 'it'];
6
6
  exports.Lang = zod_1.z.enum(langs);
7
+ exports.Dict = zod_1.z.object({
8
+ // -----------------used in ui-----------------
9
+ cancel: zod_1.z.string(),
10
+ field: zod_1.z.string(),
11
+ fieldName: zod_1.z.string(),
12
+ align: zod_1.z.string(),
13
+ width: zod_1.z.string(),
14
+ height: zod_1.z.string(),
15
+ rotate: zod_1.z.string(),
16
+ edit: zod_1.z.string(),
17
+ plsInputName: zod_1.z.string(),
18
+ fieldMustUniq: zod_1.z.string(),
19
+ notUniq: zod_1.z.string(),
20
+ noKeyName: zod_1.z.string(),
21
+ fieldsList: zod_1.z.string(),
22
+ addNewField: zod_1.z.string(),
23
+ editField: zod_1.z.string(),
24
+ type: zod_1.z.string(),
25
+ errorOccurred: zod_1.z.string(),
26
+ errorBulkUpdateFieldName: zod_1.z.string(),
27
+ commitBulkUpdateFieldName: zod_1.z.string(),
28
+ bulkUpdateFieldName: zod_1.z.string(),
29
+ // -----------------used in schemas-----------------
30
+ 'schemas.textColor': zod_1.z.string(),
31
+ 'schemas.bgColor': zod_1.z.string(),
32
+ 'schemas.horizontal': zod_1.z.string(),
33
+ 'schemas.vertical': zod_1.z.string(),
34
+ 'schemas.left': zod_1.z.string(),
35
+ 'schemas.center': zod_1.z.string(),
36
+ 'schemas.right': zod_1.z.string(),
37
+ 'schemas.top': zod_1.z.string(),
38
+ 'schemas.middle': zod_1.z.string(),
39
+ 'schemas.bottom': zod_1.z.string(),
40
+ 'schemas.text.fontName': zod_1.z.string(),
41
+ 'schemas.text.size': zod_1.z.string(),
42
+ 'schemas.text.spacing': zod_1.z.string(),
43
+ 'schemas.text.textAlign': zod_1.z.string(),
44
+ 'schemas.text.verticalAlign': zod_1.z.string(),
45
+ 'schemas.text.lineHeight': zod_1.z.string(),
46
+ 'schemas.text.min': zod_1.z.string(),
47
+ 'schemas.text.max': zod_1.z.string(),
48
+ 'schemas.text.fit': zod_1.z.string(),
49
+ 'schemas.text.dynamicFontSize': zod_1.z.string(),
50
+ 'schemas.barcodes.barColor': zod_1.z.string(),
51
+ });
7
52
  exports.Size = zod_1.z.object({ height: zod_1.z.number(), width: zod_1.z.number() });
8
53
  exports.Schema = zod_1.z
9
54
  .object({
@@ -48,7 +93,11 @@ exports.GenerateProps = CommonProps.extend({
48
93
  options: exports.GeneratorOptions.optional(),
49
94
  }).strict();
50
95
  // ---------------------ui------------------------
51
- exports.UIOptions = CommonOptions.extend({ lang: exports.Lang.optional() });
96
+ exports.UIOptions = CommonOptions.extend({
97
+ lang: exports.Lang.optional(),
98
+ labels: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
99
+ theme: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
100
+ });
52
101
  const HTMLElementSchema = zod_1.z.any().refine((v) => v instanceof HTMLElement);
53
102
  exports.UIProps = CommonProps.extend({
54
103
  domContainer: HTMLElementSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAE/C,QAAA,IAAI,GAAG,OAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErB,QAAA,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE3D,QAAA,MAAM,GAAG,OAAC;KACpB,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IACpD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AACU,QAAA,WAAW,GAAG,cAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAEnE,MAAM,iBAAiB,GAA6B,OAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,C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ACf,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,KAAK,EACL,KAAK,GACN,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAyBxB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,KAAK,EACL,KAAK,GACN,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
@@ -1,6 +1,51 @@
1
1
  import { z } from 'zod';
2
2
  const langs = ['en', 'ja', 'ar', 'th', 'pl', 'it'];
3
3
  export const Lang = z.enum(langs);
4
+ export const Dict = z.object({
5
+ // -----------------used in ui-----------------
6
+ cancel: z.string(),
7
+ field: z.string(),
8
+ fieldName: z.string(),
9
+ align: z.string(),
10
+ width: z.string(),
11
+ height: z.string(),
12
+ rotate: z.string(),
13
+ edit: z.string(),
14
+ plsInputName: z.string(),
15
+ fieldMustUniq: z.string(),
16
+ notUniq: z.string(),
17
+ noKeyName: z.string(),
18
+ fieldsList: z.string(),
19
+ addNewField: z.string(),
20
+ editField: z.string(),
21
+ type: z.string(),
22
+ errorOccurred: z.string(),
23
+ errorBulkUpdateFieldName: z.string(),
24
+ commitBulkUpdateFieldName: z.string(),
25
+ bulkUpdateFieldName: z.string(),
26
+ // -----------------used in schemas-----------------
27
+ 'schemas.textColor': z.string(),
28
+ 'schemas.bgColor': z.string(),
29
+ 'schemas.horizontal': z.string(),
30
+ 'schemas.vertical': z.string(),
31
+ 'schemas.left': z.string(),
32
+ 'schemas.center': z.string(),
33
+ 'schemas.right': z.string(),
34
+ 'schemas.top': z.string(),
35
+ 'schemas.middle': z.string(),
36
+ 'schemas.bottom': z.string(),
37
+ 'schemas.text.fontName': z.string(),
38
+ 'schemas.text.size': z.string(),
39
+ 'schemas.text.spacing': z.string(),
40
+ 'schemas.text.textAlign': z.string(),
41
+ 'schemas.text.verticalAlign': z.string(),
42
+ 'schemas.text.lineHeight': z.string(),
43
+ 'schemas.text.min': z.string(),
44
+ 'schemas.text.max': z.string(),
45
+ 'schemas.text.fit': z.string(),
46
+ 'schemas.text.dynamicFontSize': z.string(),
47
+ 'schemas.barcodes.barColor': z.string(),
48
+ });
4
49
  export const Size = z.object({ height: z.number(), width: z.number() });
5
50
  export const Schema = z
6
51
  .object({
@@ -45,7 +90,11 @@ export const GenerateProps = CommonProps.extend({
45
90
  options: GeneratorOptions.optional(),
46
91
  }).strict();
47
92
  // ---------------------ui------------------------
48
- export const UIOptions = CommonOptions.extend({ lang: Lang.optional() });
93
+ export const UIOptions = CommonOptions.extend({
94
+ lang: Lang.optional(),
95
+ labels: z.record(z.string(), z.string()).optional(),
96
+ theme: z.record(z.string(), z.unknown()).optional(),
97
+ });
49
98
  const HTMLElementSchema = z.any().refine((v) => v instanceof HTMLElement);
50
99
  export const UIProps = CommonProps.extend({
51
100
  domContainer: HTMLElementSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAE5D,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAElC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC;KACpB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AACH,MA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C;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAExE,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, ZOOM, DEFAULT_FONT_NAME } from './constants.js';
2
- import type { ChangeSchemas, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, UIRenderProps, Plugin, Lang, Size, Schema, SchemaForUI, Font, BasePdf, Template, GeneratorOptions, Plugins, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps } from './types.js';
2
+ import type { ChangeSchemas, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, UIRenderProps, Plugin, Lang, Dict, Size, Schema, SchemaForUI, Font, BasePdf, Template, GeneratorOptions, Plugins, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps } from './types.js';
3
3
  import { getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, mm2pt, pt2mm, pt2px } from './helper.js';
4
4
  export { MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, ZOOM, DEFAULT_FONT_NAME, getFallbackFontName, getDefaultFont, getB64BasePdf, b64toUint8Array, mm2pt, pt2mm, pt2px, checkFont, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, };
5
- export type { Lang, Size, Schema, SchemaForUI, Font, BasePdf, Template, GeneratorOptions, Plugins, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ChangeSchemas, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, UIRenderProps, Plugin, };
5
+ export type { Lang, Dict, Size, Schema, SchemaForUI, Font, BasePdf, Template, GeneratorOptions, Plugins, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ChangeSchemas, PropPanel, PropPanelSchema, PropPanelWidgetProps, PDFRenderProps, UIRenderProps, Plugin, };
@@ -1,14 +1,141 @@
1
1
  import { z } from 'zod';
2
2
  export declare const Lang: z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>;
3
+ export declare const Dict: z.ZodObject<{
4
+ cancel: z.ZodString;
5
+ field: z.ZodString;
6
+ fieldName: z.ZodString;
7
+ align: z.ZodString;
8
+ width: z.ZodString;
9
+ height: z.ZodString;
10
+ rotate: z.ZodString;
11
+ edit: z.ZodString;
12
+ plsInputName: z.ZodString;
13
+ fieldMustUniq: z.ZodString;
14
+ notUniq: z.ZodString;
15
+ noKeyName: z.ZodString;
16
+ fieldsList: z.ZodString;
17
+ addNewField: z.ZodString;
18
+ editField: z.ZodString;
19
+ type: z.ZodString;
20
+ errorOccurred: z.ZodString;
21
+ errorBulkUpdateFieldName: z.ZodString;
22
+ commitBulkUpdateFieldName: z.ZodString;
23
+ bulkUpdateFieldName: z.ZodString;
24
+ 'schemas.textColor': z.ZodString;
25
+ 'schemas.bgColor': z.ZodString;
26
+ 'schemas.horizontal': z.ZodString;
27
+ 'schemas.vertical': z.ZodString;
28
+ 'schemas.left': z.ZodString;
29
+ 'schemas.center': z.ZodString;
30
+ 'schemas.right': z.ZodString;
31
+ 'schemas.top': z.ZodString;
32
+ 'schemas.middle': z.ZodString;
33
+ 'schemas.bottom': z.ZodString;
34
+ 'schemas.text.fontName': z.ZodString;
35
+ 'schemas.text.size': z.ZodString;
36
+ 'schemas.text.spacing': z.ZodString;
37
+ 'schemas.text.textAlign': z.ZodString;
38
+ 'schemas.text.verticalAlign': z.ZodString;
39
+ 'schemas.text.lineHeight': z.ZodString;
40
+ 'schemas.text.min': z.ZodString;
41
+ 'schemas.text.max': z.ZodString;
42
+ 'schemas.text.fit': z.ZodString;
43
+ 'schemas.text.dynamicFontSize': z.ZodString;
44
+ 'schemas.barcodes.barColor': z.ZodString;
45
+ }, "strip", z.ZodTypeAny, {
46
+ cancel: string;
47
+ field: string;
48
+ fieldName: string;
49
+ align: string;
50
+ width: string;
51
+ height: string;
52
+ rotate: string;
53
+ edit: string;
54
+ plsInputName: string;
55
+ fieldMustUniq: string;
56
+ notUniq: string;
57
+ noKeyName: string;
58
+ fieldsList: string;
59
+ addNewField: string;
60
+ editField: string;
61
+ type: string;
62
+ errorOccurred: string;
63
+ errorBulkUpdateFieldName: string;
64
+ commitBulkUpdateFieldName: string;
65
+ bulkUpdateFieldName: string;
66
+ 'schemas.textColor': string;
67
+ 'schemas.bgColor': string;
68
+ 'schemas.horizontal': string;
69
+ 'schemas.vertical': string;
70
+ 'schemas.left': string;
71
+ 'schemas.center': string;
72
+ 'schemas.right': string;
73
+ 'schemas.top': string;
74
+ 'schemas.middle': string;
75
+ 'schemas.bottom': string;
76
+ 'schemas.text.fontName': string;
77
+ 'schemas.text.size': string;
78
+ 'schemas.text.spacing': string;
79
+ 'schemas.text.textAlign': string;
80
+ 'schemas.text.verticalAlign': string;
81
+ 'schemas.text.lineHeight': string;
82
+ 'schemas.text.min': string;
83
+ 'schemas.text.max': string;
84
+ 'schemas.text.fit': string;
85
+ 'schemas.text.dynamicFontSize': string;
86
+ 'schemas.barcodes.barColor': string;
87
+ }, {
88
+ cancel: string;
89
+ field: string;
90
+ fieldName: string;
91
+ align: string;
92
+ width: string;
93
+ height: string;
94
+ rotate: string;
95
+ edit: string;
96
+ plsInputName: string;
97
+ fieldMustUniq: string;
98
+ notUniq: string;
99
+ noKeyName: string;
100
+ fieldsList: string;
101
+ addNewField: string;
102
+ editField: string;
103
+ type: string;
104
+ errorOccurred: string;
105
+ errorBulkUpdateFieldName: string;
106
+ commitBulkUpdateFieldName: string;
107
+ bulkUpdateFieldName: string;
108
+ 'schemas.textColor': string;
109
+ 'schemas.bgColor': string;
110
+ 'schemas.horizontal': string;
111
+ 'schemas.vertical': string;
112
+ 'schemas.left': string;
113
+ 'schemas.center': string;
114
+ 'schemas.right': string;
115
+ 'schemas.top': string;
116
+ 'schemas.middle': string;
117
+ 'schemas.bottom': string;
118
+ 'schemas.text.fontName': string;
119
+ 'schemas.text.size': string;
120
+ 'schemas.text.spacing': string;
121
+ 'schemas.text.textAlign': string;
122
+ 'schemas.text.verticalAlign': string;
123
+ 'schemas.text.lineHeight': string;
124
+ 'schemas.text.min': string;
125
+ 'schemas.text.max': string;
126
+ 'schemas.text.fit': string;
127
+ 'schemas.text.dynamicFontSize': string;
128
+ 'schemas.barcodes.barColor': string;
129
+ }>;
3
130
  export declare const Size: z.ZodObject<{
4
131
  height: z.ZodNumber;
5
132
  width: z.ZodNumber;
6
133
  }, "strip", z.ZodTypeAny, {
7
- height: number;
8
134
  width: number;
9
- }, {
10
135
  height: number;
136
+ }, {
11
137
  width: number;
138
+ height: number;
12
139
  }>;
13
140
  export declare const Schema: z.ZodObject<{
14
141
  type: z.ZodString;
@@ -57,8 +184,9 @@ export declare const Schema: z.ZodObject<{
57
184
  rotate: z.ZodOptional<z.ZodNumber>;
58
185
  }, z.ZodTypeAny, "passthrough">>;
59
186
  export declare const SchemaForUI: z.ZodObject<{
60
- height: z.ZodNumber;
61
187
  width: z.ZodNumber;
188
+ height: z.ZodNumber;
189
+ rotate: z.ZodOptional<z.ZodNumber>;
62
190
  type: z.ZodString;
63
191
  position: z.ZodObject<{
64
192
  x: z.ZodNumber;
@@ -70,13 +198,12 @@ export declare const SchemaForUI: z.ZodObject<{
70
198
  x: number;
71
199
  y: number;
72
200
  }>;
73
- rotate: z.ZodOptional<z.ZodNumber>;
74
201
  id: z.ZodString;
75
202
  key: z.ZodString;
76
203
  data: z.ZodString;
77
204
  }, "strip", z.ZodTypeAny, {
78
- height: number;
79
205
  width: number;
206
+ height: number;
80
207
  type: string;
81
208
  position: {
82
209
  x: number;
@@ -87,8 +214,8 @@ export declare const SchemaForUI: z.ZodObject<{
87
214
  key: string;
88
215
  rotate?: number | undefined;
89
216
  }, {
90
- height: number;
91
217
  width: number;
218
+ height: number;
92
219
  type: string;
93
220
  position: {
94
221
  x: number;
@@ -499,6 +626,8 @@ export declare const UIOptions: z.ZodObject<{
499
626
  subset?: boolean | undefined;
500
627
  }>>>;
501
628
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
629
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
630
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
502
631
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
503
632
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
504
633
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -514,6 +643,8 @@ export declare const UIOptions: z.ZodObject<{
514
643
  subset?: boolean | undefined;
515
644
  }>>>;
516
645
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
646
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
647
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
517
648
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
518
649
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
519
650
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -529,6 +660,8 @@ export declare const UIOptions: z.ZodObject<{
529
660
  subset?: boolean | undefined;
530
661
  }>>>;
531
662
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
663
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
664
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
532
665
  }, z.ZodTypeAny, "passthrough">>;
533
666
  export declare const UIProps: z.ZodObject<{
534
667
  template: z.ZodObject<{
@@ -651,6 +784,8 @@ export declare const UIProps: z.ZodObject<{
651
784
  subset?: boolean | undefined;
652
785
  }>>>;
653
786
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
787
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
788
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
654
789
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
655
790
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
656
791
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -666,6 +801,8 @@ export declare const UIProps: z.ZodObject<{
666
801
  subset?: boolean | undefined;
667
802
  }>>>;
668
803
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
804
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
805
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
669
806
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
670
807
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
671
808
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -681,6 +818,8 @@ export declare const UIProps: z.ZodObject<{
681
818
  subset?: boolean | undefined;
682
819
  }>>>;
683
820
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
821
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
822
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
684
823
  }, z.ZodTypeAny, "passthrough">>>;
685
824
  }, "strip", z.ZodTypeAny, {
686
825
  template: {
@@ -725,6 +864,8 @@ export declare const UIProps: z.ZodObject<{
725
864
  subset?: boolean | undefined;
726
865
  }>>>;
727
866
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
867
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
868
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
728
869
  }, z.ZodTypeAny, "passthrough"> | undefined;
729
870
  }, {
730
871
  template: {
@@ -769,6 +910,8 @@ export declare const UIProps: z.ZodObject<{
769
910
  subset?: boolean | undefined;
770
911
  }>>>;
771
912
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
913
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
914
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
772
915
  }, z.ZodTypeAny, "passthrough"> | undefined;
773
916
  }>;
774
917
  export declare const PreviewProps: z.ZodObject<{
@@ -787,6 +930,8 @@ export declare const PreviewProps: z.ZodObject<{
787
930
  subset?: boolean | undefined;
788
931
  }>>>;
789
932
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
933
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
934
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
790
935
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
791
936
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
792
937
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -802,6 +947,8 @@ export declare const PreviewProps: z.ZodObject<{
802
947
  subset?: boolean | undefined;
803
948
  }>>>;
804
949
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
950
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
951
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
805
952
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
806
953
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
807
954
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -817,6 +964,8 @@ export declare const PreviewProps: z.ZodObject<{
817
964
  subset?: boolean | undefined;
818
965
  }>>>;
819
966
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
967
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
968
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
820
969
  }, z.ZodTypeAny, "passthrough">>>;
821
970
  template: z.ZodObject<{
822
971
  schemas: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -963,6 +1112,8 @@ export declare const PreviewProps: z.ZodObject<{
963
1112
  subset?: boolean | undefined;
964
1113
  }>>>;
965
1114
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1115
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1116
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
966
1117
  }, z.ZodTypeAny, "passthrough"> | undefined;
967
1118
  plugins?: Record<string, {
968
1119
  ui?: any;
@@ -1008,6 +1159,8 @@ export declare const PreviewProps: z.ZodObject<{
1008
1159
  subset?: boolean | undefined;
1009
1160
  }>>>;
1010
1161
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1162
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1163
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1011
1164
  }, z.ZodTypeAny, "passthrough"> | undefined;
1012
1165
  plugins?: Record<string, {
1013
1166
  ui?: any;
@@ -1031,6 +1184,8 @@ export declare const DesignerProps: z.ZodObject<{
1031
1184
  subset?: boolean | undefined;
1032
1185
  }>>>;
1033
1186
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1187
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1188
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1034
1189
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1035
1190
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1036
1191
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -1046,6 +1201,8 @@ export declare const DesignerProps: z.ZodObject<{
1046
1201
  subset?: boolean | undefined;
1047
1202
  }>>>;
1048
1203
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1204
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1205
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1049
1206
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1050
1207
  font: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1051
1208
  data: z.ZodUnion<[z.ZodString, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
@@ -1061,6 +1218,8 @@ export declare const DesignerProps: z.ZodObject<{
1061
1218
  subset?: boolean | undefined;
1062
1219
  }>>>;
1063
1220
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1221
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1222
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1064
1223
  }, z.ZodTypeAny, "passthrough">>>;
1065
1224
  template: z.ZodObject<{
1066
1225
  schemas: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1205,6 +1364,8 @@ export declare const DesignerProps: z.ZodObject<{
1205
1364
  subset?: boolean | undefined;
1206
1365
  }>>>;
1207
1366
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1367
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1368
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1208
1369
  }, z.ZodTypeAny, "passthrough"> | undefined;
1209
1370
  plugins?: Record<string, {
1210
1371
  ui?: any;
@@ -1249,6 +1410,8 @@ export declare const DesignerProps: z.ZodObject<{
1249
1410
  subset?: boolean | undefined;
1250
1411
  }>>>;
1251
1412
  lang: z.ZodOptional<z.ZodEnum<["en", "ja", "ar", "th", "pl", "it"]>>;
1413
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1414
+ theme: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1252
1415
  }, z.ZodTypeAny, "passthrough"> | undefined;
1253
1416
  plugins?: Record<string, {
1254
1417
  ui?: any;
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
3
+ import type { ThemeConfig, GlobalToken } from 'antd';
3
4
  import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
4
- import { Lang, Size, Schema, Font, SchemaForUI, BasePdf, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps } from './schema.js';
5
+ import { Lang, Dict, Size, Schema, Font, SchemaForUI, BasePdf, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps } from './schema.js';
5
6
  export type PropPanelSchema = _PropPanelSchema;
6
7
  export type ChangeSchemas = (objs: {
7
8
  key: string;
@@ -41,6 +42,8 @@ export interface PDFRenderProps<T extends Schema> {
41
42
  * @property {(value: string) => void} [onChange] - Used to change the value. Only applicable when the mode is 'form' or 'designer'.
42
43
  * @property {HTMLDivElement} rootElement - The root HTMLDivElement for the UI.
43
44
  * @property {UIOptions} options - Options object passed from the Viewer, Form, or Designer.
45
+ * @property {ThemeConfig} theme - An object that merges the 'theme' passed as an options with the default theme.
46
+ * @property {(key: keyof Dict | string) => string} i18n - An object merged based on the options 'lang' and 'labels'.
44
47
  */
45
48
  export type UIRenderProps<T extends Schema> = {
46
49
  schema: T;
@@ -52,7 +55,22 @@ export type UIRenderProps<T extends Schema> = {
52
55
  onChange?: (value: string) => void;
53
56
  rootElement: HTMLDivElement;
54
57
  options: UIOptions;
58
+ theme: GlobalToken;
59
+ i18n: (key: keyof Dict | string) => string;
55
60
  };
61
+ /**
62
+ * Type for properties used in configuring the property panel.
63
+ *
64
+ * @property {HTMLDivElement} rootElement - The root HTML element of the property panel.
65
+ * @property {SchemaForUI} activeSchema - The currently active schema for UI rendering.
66
+ * @property {HTMLElement[]} activeElements - Array of currently active HTML elements in the UI.
67
+ * @property {ChangeSchemas} changeSchemas - Function to change multiple schemas simultaneously.
68
+ * @property {SchemaForUI[]} schemas - Array of schemas for UI rendering.
69
+ * @property {Size} pageSize - The size of the page being edited.
70
+ * @property {UIOptions} options - UI options for the property panel.
71
+ * @property {GlobalToken} theme - The theme configuration used in the UI.
72
+ * @property {(key: keyof Dict | string) => string} i18n - Internationalization dictionary for UI labels and texts.
73
+ */
56
74
  type PropPanelProps = {
57
75
  rootElement: HTMLDivElement;
58
76
  activeSchema: SchemaForUI;
@@ -61,6 +79,8 @@ type PropPanelProps = {
61
79
  schemas: SchemaForUI[];
62
80
  pageSize: Size;
63
81
  options: UIOptions;
82
+ theme: GlobalToken;
83
+ i18n: (key: keyof Dict | string) => string;
64
84
  };
65
85
  export type PropPanelWidgetProps = _PropPanelWidgetProps & PropPanelProps;
66
86
  /**
@@ -97,6 +117,7 @@ export type Plugins = {
97
117
  [key: string]: Plugin<any> | undefined;
98
118
  };
99
119
  export type Lang = z.infer<typeof Lang>;
120
+ export type Dict = z.infer<typeof Dict>;
100
121
  export type Size = z.infer<typeof Size>;
101
122
  export type Schema = z.infer<typeof Schema>;
102
123
  export type SchemaForUI = z.infer<typeof SchemaForUI>;
@@ -114,7 +135,9 @@ export type GeneratorOptions = z.infer<typeof GeneratorOptions>;
114
135
  export type GenerateProps = z.infer<typeof GenerateProps> & {
115
136
  plugins?: Plugins;
116
137
  };
117
- export type UIOptions = z.infer<typeof UIOptions>;
138
+ export type UIOptions = z.infer<typeof UIOptions> & {
139
+ theme?: ThemeConfig;
140
+ };
118
141
  export type UIProps = z.infer<typeof UIProps> & {
119
142
  plugins?: Plugins;
120
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/common",
3
- "version": "3.0.1-dev.22",
3
+ "version": "3.0.1-dev.24",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -50,6 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@pdfme/pdf-lib": "^1.17.3",
53
+ "antd": "^5.11.2",
53
54
  "buffer": "^6.0.3",
54
55
  "form-render": "^2.2.20",
55
56
  "zod": "^3.20.2"
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ import type {
15
15
  UIRenderProps,
16
16
  Plugin,
17
17
  Lang,
18
+ Dict,
18
19
  Size,
19
20
  Schema,
20
21
  SchemaForUI,
@@ -73,6 +74,7 @@ export {
73
74
 
74
75
  export type {
75
76
  Lang,
77
+ Dict,
76
78
  Size,
77
79
  Schema,
78
80
  SchemaForUI,
package/src/schema.ts CHANGED
@@ -3,6 +3,53 @@ import { z } from 'zod';
3
3
  const langs = ['en', 'ja', 'ar', 'th', 'pl', 'it'] as const;
4
4
 
5
5
  export const Lang = z.enum(langs);
6
+ export const Dict = z.object({
7
+ // -----------------used in ui-----------------
8
+ cancel: z.string(),
9
+ field: z.string(),
10
+ fieldName: z.string(),
11
+ align: z.string(),
12
+ width: z.string(),
13
+ height: z.string(),
14
+ rotate: z.string(),
15
+ edit: z.string(),
16
+ plsInputName: z.string(),
17
+ fieldMustUniq: z.string(),
18
+ notUniq: z.string(),
19
+ noKeyName: z.string(),
20
+ fieldsList: z.string(),
21
+ addNewField: z.string(),
22
+ editField: z.string(),
23
+ type: z.string(),
24
+ errorOccurred: z.string(),
25
+ errorBulkUpdateFieldName: z.string(),
26
+ commitBulkUpdateFieldName: z.string(),
27
+ bulkUpdateFieldName: z.string(),
28
+ // -----------------used in schemas-----------------
29
+ 'schemas.textColor': z.string(),
30
+ 'schemas.bgColor': z.string(),
31
+ 'schemas.horizontal': z.string(),
32
+ 'schemas.vertical': z.string(),
33
+ 'schemas.left': z.string(),
34
+ 'schemas.center': z.string(),
35
+ 'schemas.right': z.string(),
36
+ 'schemas.top': z.string(),
37
+ 'schemas.middle': z.string(),
38
+ 'schemas.bottom': z.string(),
39
+
40
+ 'schemas.text.fontName': z.string(),
41
+ 'schemas.text.size': z.string(),
42
+ 'schemas.text.spacing': z.string(),
43
+ 'schemas.text.textAlign': z.string(),
44
+ 'schemas.text.verticalAlign': z.string(),
45
+ 'schemas.text.lineHeight': z.string(),
46
+ 'schemas.text.min': z.string(),
47
+ 'schemas.text.max': z.string(),
48
+ 'schemas.text.fit': z.string(),
49
+ 'schemas.text.dynamicFontSize': z.string(),
50
+
51
+ 'schemas.barcodes.barColor': z.string(),
52
+ });
6
53
 
7
54
  export const Size = z.object({ height: z.number(), width: z.number() });
8
55
 
@@ -64,7 +111,11 @@ export const GenerateProps = CommonProps.extend({
64
111
 
65
112
  // ---------------------ui------------------------
66
113
 
67
- export const UIOptions = CommonOptions.extend({ lang: Lang.optional() });
114
+ export const UIOptions = CommonOptions.extend({
115
+ lang: Lang.optional(),
116
+ labels: z.record(z.string(), z.string()).optional(),
117
+ theme: z.record(z.string(), z.unknown()).optional(),
118
+ });
68
119
 
69
120
  const HTMLElementSchema: z.ZodSchema<HTMLElement> = z.any().refine((v) => v instanceof HTMLElement);
70
121
 
package/src/types.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
3
+ import type { ThemeConfig, GlobalToken } from 'antd';
3
4
  import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
4
5
  // prettier-ignore
5
- import {Lang, Size, Schema, Font, SchemaForUI, BasePdf, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps} from './schema.js';
6
+ import {Lang, Dict, Size, Schema, Font, SchemaForUI, BasePdf, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps} from './schema.js';
6
7
 
7
8
  export type PropPanelSchema = _PropPanelSchema;
8
9
  export type ChangeSchemas = (objs: { key: string; value: any; schemaId: string }[]) => void;
@@ -42,6 +43,8 @@ export interface PDFRenderProps<T extends Schema> {
42
43
  * @property {(value: string) => void} [onChange] - Used to change the value. Only applicable when the mode is 'form' or 'designer'.
43
44
  * @property {HTMLDivElement} rootElement - The root HTMLDivElement for the UI.
44
45
  * @property {UIOptions} options - Options object passed from the Viewer, Form, or Designer.
46
+ * @property {ThemeConfig} theme - An object that merges the 'theme' passed as an options with the default theme.
47
+ * @property {(key: keyof Dict | string) => string} i18n - An object merged based on the options 'lang' and 'labels'.
45
48
  */
46
49
  export type UIRenderProps<T extends Schema> = {
47
50
  schema: T;
@@ -53,8 +56,23 @@ export type UIRenderProps<T extends Schema> = {
53
56
  onChange?: (value: string) => void;
54
57
  rootElement: HTMLDivElement;
55
58
  options: UIOptions;
59
+ theme: GlobalToken;
60
+ i18n: (key: keyof Dict | string) => string;
56
61
  };
57
62
 
63
+ /**
64
+ * Type for properties used in configuring the property panel.
65
+ *
66
+ * @property {HTMLDivElement} rootElement - The root HTML element of the property panel.
67
+ * @property {SchemaForUI} activeSchema - The currently active schema for UI rendering.
68
+ * @property {HTMLElement[]} activeElements - Array of currently active HTML elements in the UI.
69
+ * @property {ChangeSchemas} changeSchemas - Function to change multiple schemas simultaneously.
70
+ * @property {SchemaForUI[]} schemas - Array of schemas for UI rendering.
71
+ * @property {Size} pageSize - The size of the page being edited.
72
+ * @property {UIOptions} options - UI options for the property panel.
73
+ * @property {GlobalToken} theme - The theme configuration used in the UI.
74
+ * @property {(key: keyof Dict | string) => string} i18n - Internationalization dictionary for UI labels and texts.
75
+ */
58
76
  type PropPanelProps = {
59
77
  rootElement: HTMLDivElement;
60
78
  activeSchema: SchemaForUI;
@@ -63,7 +81,10 @@ type PropPanelProps = {
63
81
  schemas: SchemaForUI[];
64
82
  pageSize: Size;
65
83
  options: UIOptions;
84
+ theme: GlobalToken;
85
+ i18n: (key: keyof Dict | string) => string;
66
86
  };
87
+
67
88
  export type PropPanelWidgetProps = _PropPanelWidgetProps & PropPanelProps;
68
89
 
69
90
  /**
@@ -102,6 +123,7 @@ export type Plugin<T extends Schema & { [key: string]: any }> = {
102
123
  export type Plugins = { [key: string]: Plugin<any> | undefined };
103
124
 
104
125
  export type Lang = z.infer<typeof Lang>;
126
+ export type Dict = z.infer<typeof Dict>;
105
127
  export type Size = z.infer<typeof Size>;
106
128
  export type Schema = z.infer<typeof Schema>;
107
129
  export type SchemaForUI = z.infer<typeof SchemaForUI>;
@@ -118,7 +140,7 @@ export type BasePdf = z.infer<typeof BasePdf>;
118
140
  export type Template = z.infer<typeof Template>;
119
141
  export type GeneratorOptions = z.infer<typeof GeneratorOptions>;
120
142
  export type GenerateProps = z.infer<typeof GenerateProps> & { plugins?: Plugins };
121
- export type UIOptions = z.infer<typeof UIOptions>;
143
+ export type UIOptions = z.infer<typeof UIOptions> & { theme?: ThemeConfig };
122
144
  export type UIProps = z.infer<typeof UIProps> & { plugins?: Plugins };
123
145
  export type PreviewProps = z.infer<typeof PreviewProps> & { plugins?: Plugins };
124
146
  export type DesignerProps = z.infer<typeof DesignerProps> & { plugins?: Plugins };