@pdfme/common 5.5.10-dev.125 → 5.5.10-dev.127

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/types.ts +11 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/common",
3
- "version": "5.5.10-dev.125",
3
+ "version": "5.5.10-dev.127",
4
4
  "description": "TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!",
5
5
  "keywords": [
6
6
  "pdf",
@@ -53,7 +53,7 @@
53
53
  "@types/estree": "^1.0.6"
54
54
  },
55
55
  "peerDependencies": {
56
- "antd": "^5.11.2",
56
+ "antd": "^5.11.2 || ^6.0.0",
57
57
  "form-render": "^2.2.20"
58
58
  }
59
59
  }
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
3
- import type { ThemeConfig, GlobalToken } from 'antd';
3
+ import type { ThemeConfig } from 'antd';
4
4
  import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
5
5
  import {
6
6
  Lang,
@@ -34,6 +34,12 @@ export type ChangeSchemaItem = {
34
34
  };
35
35
  export type ChangeSchemas = (objs: ChangeSchemaItem[]) => void;
36
36
 
37
+ export type UITheme = {
38
+ colorPrimary: string;
39
+ colorPrimaryBg: string;
40
+ colorWhite: string;
41
+ };
42
+
37
43
  /**
38
44
  * Properties used for PDF rendering.
39
45
  * @template T Type of the extended Schema object.
@@ -72,7 +78,7 @@ export interface PDFRenderProps<T extends Schema> {
72
78
  * @property {(arg: { key: string; value: unknown } | { key: string; value: unknown }[]) => void} [onChange] - Used to change the value and schema properties. Only applicable when the mode is 'form' or 'designer'.
73
79
  * @property {HTMLDivElement} rootElement - The root HTMLDivElement for the UI.
74
80
  * @property {UIOptions} options - Options object passed from the Viewer, Form, or Designer.
75
- * @property {ThemeConfig} theme - An object that merges the 'theme' passed as an options with the default theme.
81
+ * @property {UITheme} theme - A merged token object used for UI rendering.
76
82
  * @property {(key: keyof Dict | string) => string} i18n - An object merged based on the options 'lang' and 'labels'.
77
83
  * @property {number} scale - The scale of the UI.
78
84
  * @property {Map<string | number, unknown>} _cache - Cache shared only during the execution of the render function (useful for caching images, etc. if needed).
@@ -88,7 +94,7 @@ export type UIRenderProps<T extends Schema> = {
88
94
  onChange?: (arg: { key: string; value: unknown } | { key: string; value: unknown }[]) => void;
89
95
  rootElement: HTMLDivElement;
90
96
  options: UIOptions;
91
- theme: GlobalToken;
97
+ theme: UITheme;
92
98
  i18n: (key: string) => string;
93
99
  scale: number;
94
100
  _cache: Map<string | number, unknown>;
@@ -104,7 +110,7 @@ export type UIRenderProps<T extends Schema> = {
104
110
  * @property {SchemaForUI[]} schemas - Array of schemas for UI rendering.
105
111
  * @property {Size} pageSize - The size of the page being edited.
106
112
  * @property {UIOptions} options - UI options for the property panel.
107
- * @property {GlobalToken} theme - The theme configuration used in the UI.
113
+ * @property {UITheme} theme - The theme token used in the UI.
108
114
  * @property {(key: keyof Dict | string) => string} i18n - Internationalization dictionary for UI labels and texts.
109
115
  */
110
116
  type PropPanelProps = {
@@ -114,7 +120,7 @@ type PropPanelProps = {
114
120
  changeSchemas: ChangeSchemas;
115
121
  schemas: SchemaForUI[];
116
122
  options: UIOptions;
117
- theme: GlobalToken;
123
+ theme: UITheme;
118
124
  i18n: (key: string) => string;
119
125
  };
120
126