@pdfme/common 6.0.5-dev.1 → 6.0.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.
Files changed (2) hide show
  1. package/dist/types.d.ts +5 -47
  2. package/package.json +5 -1
package/dist/types.d.ts CHANGED
@@ -1,44 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
3
+ import type { ThemeConfig } from 'antd';
4
+ import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
3
5
  import { Lang, Dict, Mode, Size, Schema, Font, SchemaForUI, BasePdf, BlankPdf, CustomPdf, CommonOptions, Template, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, DesignerProps, ColorType, LegacySchemaPageArray, SchemaPageArray } from './schema.js';
4
- export interface UIOptionsThemeToken {
5
- colorPrimary?: string;
6
- colorPrimaryBg?: string;
7
- colorWhite?: string;
8
- [key: string]: unknown;
9
- }
10
- export interface UIOptionsTheme {
11
- token?: UIOptionsThemeToken;
12
- components?: Record<string, Record<string, unknown>>;
13
- [key: string]: unknown;
14
- }
15
- export interface PropPanelRule {
16
- validator?: (...args: any[]) => unknown;
17
- message?: string;
18
- pattern?: RegExp | string;
19
- [key: string]: unknown;
20
- }
21
- export interface PropPanelSchema {
22
- title?: string;
23
- type?: string;
24
- widget?: string;
25
- default?: unknown;
26
- placeholder?: string;
27
- format?: string;
28
- required?: boolean;
29
- hidden?: boolean | string;
30
- disabled?: boolean;
31
- bind?: string | false | string[];
32
- span?: number;
33
- column?: number;
34
- min?: number;
35
- max?: number;
36
- props?: Record<string, unknown>;
37
- rules?: PropPanelRule[];
38
- properties?: Record<string, PropPanelSchema>;
39
- items?: PropPanelSchema | PropPanelSchema[];
40
- [key: string]: unknown;
41
- }
6
+ export type PropPanelSchema = _PropPanelSchema;
42
7
  export type ChangeSchemaItem = {
43
8
  key: string;
44
9
  value: unknown;
@@ -136,14 +101,7 @@ type PropPanelProps = {
136
101
  theme: UITheme;
137
102
  i18n: (key: string) => string;
138
103
  };
139
- type PropPanelWidgetRuntimeProps = {
140
- schema?: PropPanelSchema;
141
- value?: unknown;
142
- onChange?: (...args: any[]) => unknown;
143
- error?: unknown;
144
- [key: string]: unknown;
145
- };
146
- export type PropPanelWidgetProps = PropPanelWidgetRuntimeProps & PropPanelProps;
104
+ export type PropPanelWidgetProps = _PropPanelWidgetProps & PropPanelProps;
147
105
  /**
148
106
  * Used for customizing the property panel.
149
107
  * @template T - Type of the extended Schema object.
@@ -212,7 +170,7 @@ export type GenerateProps = Omit<z.infer<typeof GenerateProps>, 'plugins'> & {
212
170
  plugins?: Plugins;
213
171
  };
214
172
  export type UIOptions = z.infer<typeof UIOptions> & {
215
- theme?: UIOptionsTheme;
173
+ theme?: ThemeConfig;
216
174
  };
217
175
  export type UIProps = Omit<z.infer<typeof UIProps>, 'plugins'> & {
218
176
  plugins?: Plugins;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/common",
3
- "version": "6.0.5-dev.1",
3
+ "version": "6.0.5",
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",
@@ -55,5 +55,9 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/estree": "^1.0.6"
58
+ },
59
+ "peerDependencies": {
60
+ "antd": "^5.11.2 || ^6.0.0",
61
+ "form-render": "^2.2.20"
58
62
  }
59
63
  }