@pdfme/schemas 4.2.2 → 4.2.3-dev.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.
- package/README.md +27 -13
- package/dist/cjs/src/barcodes/index.js +8 -1
- package/dist/cjs/src/barcodes/index.js.map +1 -1
- package/dist/cjs/src/barcodes/propPanel.js +0 -12
- package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
- package/dist/cjs/src/graphics/image.js +2 -2
- package/dist/cjs/src/graphics/image.js.map +1 -1
- package/dist/cjs/src/graphics/svg.js +2 -2
- package/dist/cjs/src/graphics/svg.js.map +1 -1
- package/dist/cjs/src/multiVariableText/index.js +7 -1
- package/dist/cjs/src/multiVariableText/index.js.map +1 -1
- package/dist/cjs/src/multiVariableText/propPanel.js +0 -1
- package/dist/cjs/src/multiVariableText/propPanel.js.map +1 -1
- package/dist/cjs/src/shapes/line.js +1 -1
- package/dist/cjs/src/shapes/line.js.map +1 -1
- package/dist/cjs/src/shapes/rectAndEllipse.js +10 -3
- package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/cjs/src/tables/dynamicTemplate.js +2 -2
- package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -1
- package/dist/cjs/src/tables/helper.js +6 -1
- package/dist/cjs/src/tables/helper.js.map +1 -1
- package/dist/cjs/src/tables/index.js +1 -0
- package/dist/cjs/src/tables/index.js.map +1 -1
- package/dist/cjs/src/tables/pdfRender.js +1 -1
- package/dist/cjs/src/tables/pdfRender.js.map +1 -1
- package/dist/cjs/src/tables/propPanel.js +0 -1
- package/dist/cjs/src/tables/propPanel.js.map +1 -1
- package/dist/cjs/src/text/index.js +7 -2
- package/dist/cjs/src/text/index.js.map +1 -1
- package/dist/cjs/src/text/propPanel.js +0 -1
- package/dist/cjs/src/text/propPanel.js.map +1 -1
- package/dist/esm/src/barcodes/index.js +8 -1
- package/dist/esm/src/barcodes/index.js.map +1 -1
- package/dist/esm/src/barcodes/propPanel.js +0 -12
- package/dist/esm/src/barcodes/propPanel.js.map +1 -1
- package/dist/esm/src/graphics/image.js +2 -2
- package/dist/esm/src/graphics/image.js.map +1 -1
- package/dist/esm/src/graphics/svg.js +2 -2
- package/dist/esm/src/graphics/svg.js.map +1 -1
- package/dist/esm/src/multiVariableText/index.js +7 -1
- package/dist/esm/src/multiVariableText/index.js.map +1 -1
- package/dist/esm/src/multiVariableText/propPanel.js +0 -1
- package/dist/esm/src/multiVariableText/propPanel.js.map +1 -1
- package/dist/esm/src/shapes/line.js +1 -1
- package/dist/esm/src/shapes/line.js.map +1 -1
- package/dist/esm/src/shapes/rectAndEllipse.js +10 -3
- package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/esm/src/tables/dynamicTemplate.js +2 -2
- package/dist/esm/src/tables/dynamicTemplate.js.map +1 -1
- package/dist/esm/src/tables/helper.js +6 -1
- package/dist/esm/src/tables/helper.js.map +1 -1
- package/dist/esm/src/tables/index.js +1 -0
- package/dist/esm/src/tables/index.js.map +1 -1
- package/dist/esm/src/tables/pdfRender.js +1 -1
- package/dist/esm/src/tables/pdfRender.js.map +1 -1
- package/dist/esm/src/tables/propPanel.js +0 -1
- package/dist/esm/src/tables/propPanel.js.map +1 -1
- package/dist/esm/src/text/index.js +7 -2
- package/dist/esm/src/text/index.js.map +1 -1
- package/dist/esm/src/text/propPanel.js +0 -1
- package/dist/esm/src/text/propPanel.js.map +1 -1
- package/dist/types/src/shapes/rectAndEllipse.d.ts +2 -6
- package/dist/types/src/tables/helper.d.ts +2 -2
- package/package.json +1 -1
- package/src/barcodes/index.ts +9 -1
- package/src/barcodes/propPanel.ts +0 -13
- package/src/graphics/image.ts +2 -2
- package/src/graphics/svg.ts +2 -2
- package/src/multiVariableText/index.ts +7 -1
- package/src/multiVariableText/propPanel.ts +0 -1
- package/src/shapes/line.ts +1 -1
- package/src/shapes/rectAndEllipse.ts +10 -3
- package/src/tables/dynamicTemplate.ts +4 -2
- package/src/tables/helper.ts +7 -2
- package/src/tables/index.ts +1 -0
- package/src/tables/pdfRender.ts +5 -1
- package/src/tables/propPanel.ts +0 -1
- package/src/text/index.ts +7 -2
- package/src/text/propPanel.ts +0 -1
@@ -1,7 +1,12 @@
|
|
1
1
|
import { pdfRender } from './pdfRender.js';
|
2
2
|
import { propPanel } from './propPanel.js';
|
3
3
|
import { uiRender } from './uiRender.js';
|
4
|
-
const textSchema = {
|
4
|
+
const textSchema = {
|
5
|
+
pdf: pdfRender,
|
6
|
+
ui: uiRender,
|
7
|
+
propPanel,
|
8
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor-input"><path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1"/><path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5"/><path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"/><path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"/><path d="M9 7v10"/></svg>',
|
9
|
+
};
|
5
10
|
export default textSchema;
|
6
11
|
export const readOnlyText = {
|
7
12
|
pdf: textSchema.pdf,
|
@@ -11,9 +16,9 @@ export const readOnlyText = {
|
|
11
16
|
defaultSchema: {
|
12
17
|
...textSchema.propPanel.defaultSchema,
|
13
18
|
type: 'readOnlyText',
|
14
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
15
19
|
readOnly: true,
|
16
20
|
},
|
17
21
|
},
|
22
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
18
23
|
};
|
19
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/text/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,UAAU,GAAuB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/text/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,UAAU,GAAuB;IACrC,GAAG,EAAE,SAAS;IACd,EAAE,EAAE,QAAQ;IACZ,SAAS;IACT,IAAI,EAAE,mcAAmc;CAC1c,CAAC;AAEF,eAAe,UAAU,CAAC;AAE1B,MAAM,CAAC,MAAM,YAAY,GAAuB;IAC9C,GAAG,EAAE,UAAU,CAAC,GAAG;IACnB,EAAE,EAAE,UAAU,CAAC,EAAE;IACjB,SAAS,EAAE;QACT,GAAG,UAAU,CAAC,SAAS;QACvB,aAAa,EAAE;YACb,GAAG,UAAU,CAAC,SAAS,CAAC,aAAa;YACrC,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE,IAAI;SACf;KACF;IACD,IAAI,EAAE,0UAA0U;CACjV,CAAC"}
|
@@ -123,7 +123,6 @@ export const propPanel = {
|
|
123
123
|
widgets: { UseDynamicFontSize },
|
124
124
|
defaultSchema: {
|
125
125
|
type: 'text',
|
126
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor-input"><path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1"/><path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5"/><path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"/><path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"/><path d="M9 7v10"/></svg>',
|
127
126
|
content: 'Type Something...',
|
128
127
|
position: { x: 0, y: 0 },
|
129
128
|
width: 45,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/text/propPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAIjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EACzB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,kBAAkB,GAAG,CAAC,KAA2B,EAAE,EAAE;IACzD,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEjE,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACjD,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAC;IAC3B,QAAQ,CAAC,OAAO,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EAAE;QACxB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,uGAAuG;QACvG,4GAA4G;QAC5G,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,iBAAiB;QAC5B,iBAAiB,EAAE,0BAA0B;QAC7C,QAAQ,EAAE,iBAAiB;QAC3B,UAAU,EAAE,mBAAmB;QAC/B,gBAAgB,EAAE,yBAAyB;QAC3C,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,kBAAkB;QAC7B,QAAQ,EAAE,SAAS;QACnB,eAAe,EAAE,EAAE;QACnB,OAAO,EAAE,eAAe;QACxB,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,KAAK;KACjB;CACF,CAAC"}
|
@@ -9,7 +9,6 @@ export declare const rectangle: {
|
|
9
9
|
propPanel: {
|
10
10
|
defaultSchema: {
|
11
11
|
type: "ellipse" | "rectangle";
|
12
|
-
icon: string;
|
13
12
|
borderWidth: number;
|
14
13
|
borderColor: string;
|
15
14
|
color: string;
|
@@ -38,7 +37,6 @@ export declare const rectangle: {
|
|
38
37
|
key: string;
|
39
38
|
opacity?: number | undefined;
|
40
39
|
rotate?: number | undefined;
|
41
|
-
icon?: string | undefined;
|
42
40
|
content?: string | undefined;
|
43
41
|
readOnly?: boolean | undefined;
|
44
42
|
};
|
@@ -56,7 +54,6 @@ export declare const rectangle: {
|
|
56
54
|
key: string;
|
57
55
|
opacity?: number | undefined;
|
58
56
|
rotate?: number | undefined;
|
59
|
-
icon?: string | undefined;
|
60
57
|
content?: string | undefined;
|
61
58
|
readOnly?: boolean | undefined;
|
62
59
|
}[];
|
@@ -66,6 +63,7 @@ export declare const rectangle: {
|
|
66
63
|
}, "rootElement">) => Record<string, Partial<import("form-render").SchemaBase>>) | Record<string, Partial<import("form-render").SchemaBase>>;
|
67
64
|
widgets?: Record<string, (props: import("@pdfme/common").PropPanelWidgetProps) => void> | undefined;
|
68
65
|
};
|
66
|
+
icon: string;
|
69
67
|
pdf: (arg: import("@pdfme/common").PDFRenderProps<ShapeSchema>) => void | Promise<void>;
|
70
68
|
ui: (arg: import("@pdfme/common").UIRenderProps<ShapeSchema>) => void | Promise<void>;
|
71
69
|
uninterruptedEditMode?: boolean | undefined;
|
@@ -74,7 +72,6 @@ export declare const ellipse: {
|
|
74
72
|
propPanel: {
|
75
73
|
defaultSchema: {
|
76
74
|
type: "ellipse" | "rectangle";
|
77
|
-
icon: string;
|
78
75
|
borderWidth: number;
|
79
76
|
borderColor: string;
|
80
77
|
color: string;
|
@@ -103,7 +100,6 @@ export declare const ellipse: {
|
|
103
100
|
key: string;
|
104
101
|
opacity?: number | undefined;
|
105
102
|
rotate?: number | undefined;
|
106
|
-
icon?: string | undefined;
|
107
103
|
content?: string | undefined;
|
108
104
|
readOnly?: boolean | undefined;
|
109
105
|
};
|
@@ -121,7 +117,6 @@ export declare const ellipse: {
|
|
121
117
|
key: string;
|
122
118
|
opacity?: number | undefined;
|
123
119
|
rotate?: number | undefined;
|
124
|
-
icon?: string | undefined;
|
125
120
|
content?: string | undefined;
|
126
121
|
readOnly?: boolean | undefined;
|
127
122
|
}[];
|
@@ -131,6 +126,7 @@ export declare const ellipse: {
|
|
131
126
|
}, "rootElement">) => Record<string, Partial<import("form-render").SchemaBase>>) | Record<string, Partial<import("form-render").SchemaBase>>;
|
132
127
|
widgets?: Record<string, (props: import("@pdfme/common").PropPanelWidgetProps) => void> | undefined;
|
133
128
|
};
|
129
|
+
icon: string;
|
134
130
|
pdf: (arg: import("@pdfme/common").PDFRenderProps<ShapeSchema>) => void | Promise<void>;
|
135
131
|
ui: (arg: import("@pdfme/common").UIRenderProps<ShapeSchema>) => void | Promise<void>;
|
136
132
|
uninterruptedEditMode?: boolean | undefined;
|
@@ -245,8 +245,8 @@ export declare const getColumnStylesPropPanelSchema: ({ head, i18n, }: {
|
|
245
245
|
properties: {};
|
246
246
|
};
|
247
247
|
};
|
248
|
-
export declare const getBody: (value: string) => string[][];
|
249
|
-
export declare const getBodyWithRange: (value: string, range?: {
|
248
|
+
export declare const getBody: (value: string | string[][]) => string[][];
|
249
|
+
export declare const getBodyWithRange: (value: string | string[][], range?: {
|
250
250
|
start: number;
|
251
251
|
end?: number | undefined;
|
252
252
|
}) => string[][];
|
package/package.json
CHANGED
package/src/barcodes/index.ts
CHANGED
@@ -5,10 +5,18 @@ import type { BarcodeSchema, BarcodeTypes } from './types';
|
|
5
5
|
import { BARCODE_TYPES } from './constants.js';
|
6
6
|
import { Plugin } from '@pdfme/common';
|
7
7
|
|
8
|
+
const qrIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-qr-code"><rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/></svg>';
|
9
|
+
const barcodeIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-barcode"><path d="M3 5v14"/><path d="M8 5v14"/><path d="M12 5v14"/><path d="M17 5v14"/><path d="M21 5v14"/></svg>';
|
10
|
+
|
8
11
|
const barcodes = BARCODE_TYPES.reduce(
|
9
12
|
(acc, type) =>
|
10
13
|
Object.assign(acc, {
|
11
|
-
[type]: {
|
14
|
+
[type]: {
|
15
|
+
pdf: pdfRender,
|
16
|
+
ui: uiRender,
|
17
|
+
propPanel: getPropPanelByBarcodeType(type),
|
18
|
+
icon: type == 'qrcode' ? qrIcon : barcodeIcon
|
19
|
+
},
|
12
20
|
}),
|
13
21
|
{} as Record<BarcodeTypes, Plugin<BarcodeSchema>>
|
14
22
|
);
|
@@ -16,14 +16,11 @@ const defaultIncludetext = { includetext: DEFAULT_BARCODE_INCLUDETEXT };
|
|
16
16
|
const position = { x: 0, y: 0 };
|
17
17
|
const default40x20 = { width: 40, height: 20 };
|
18
18
|
|
19
|
-
const barcodeIcon =
|
20
|
-
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-barcode"><path d="M3 5v14"/><path d="M8 5v14"/><path d="M12 5v14"/><path d="M17 5v14"/><path d="M21 5v14"/></svg>';
|
21
19
|
|
22
20
|
const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
23
21
|
{
|
24
22
|
defaultSchema: {
|
25
23
|
type: 'qrcode',
|
26
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-qr-code"><rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/></svg>',
|
27
24
|
content: 'https://pdfme.com/',
|
28
25
|
position,
|
29
26
|
...defaultColors,
|
@@ -36,7 +33,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
36
33
|
{
|
37
34
|
defaultSchema: {
|
38
35
|
type: 'japanpost',
|
39
|
-
icon: barcodeIcon,
|
40
36
|
content: '6540123789-A-K-Z',
|
41
37
|
position,
|
42
38
|
...defaultColors,
|
@@ -51,7 +47,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
51
47
|
{
|
52
48
|
defaultSchema: {
|
53
49
|
type: 'ean13',
|
54
|
-
icon: barcodeIcon,
|
55
50
|
content: '2112345678900',
|
56
51
|
position,
|
57
52
|
...defaultColors,
|
@@ -66,7 +61,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
66
61
|
{
|
67
62
|
defaultSchema: {
|
68
63
|
type: 'ean8',
|
69
|
-
icon: barcodeIcon,
|
70
64
|
content: '02345673',
|
71
65
|
position,
|
72
66
|
...defaultColors,
|
@@ -80,7 +74,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
80
74
|
{
|
81
75
|
defaultSchema: {
|
82
76
|
type: 'code39',
|
83
|
-
icon: barcodeIcon,
|
84
77
|
content: 'THIS IS CODE 39',
|
85
78
|
position,
|
86
79
|
...defaultColors,
|
@@ -93,7 +86,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
93
86
|
{
|
94
87
|
defaultSchema: {
|
95
88
|
type: 'code128',
|
96
|
-
icon: barcodeIcon,
|
97
89
|
content: 'This is Code 128!',
|
98
90
|
position,
|
99
91
|
...defaultColors,
|
@@ -107,7 +99,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
107
99
|
{
|
108
100
|
defaultSchema: {
|
109
101
|
type: 'nw7',
|
110
|
-
icon: barcodeIcon,
|
111
102
|
content: 'A0123456789B',
|
112
103
|
position,
|
113
104
|
...defaultColors,
|
@@ -121,7 +112,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
121
112
|
{
|
122
113
|
defaultSchema: {
|
123
114
|
type: 'itf14',
|
124
|
-
icon: barcodeIcon,
|
125
115
|
content: '04601234567893',
|
126
116
|
position,
|
127
117
|
...defaultColors,
|
@@ -136,7 +126,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
136
126
|
{
|
137
127
|
defaultSchema: {
|
138
128
|
type: 'upca',
|
139
|
-
icon: barcodeIcon,
|
140
129
|
content: '416000336108',
|
141
130
|
position,
|
142
131
|
...defaultColors,
|
@@ -151,7 +140,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
151
140
|
{
|
152
141
|
defaultSchema: {
|
153
142
|
type: 'upce',
|
154
|
-
icon: barcodeIcon,
|
155
143
|
content: '00123457',
|
156
144
|
position,
|
157
145
|
...defaultColors,
|
@@ -165,7 +153,6 @@ const barcodeDefaults: { defaultSchema: BarcodeSchema }[] = [
|
|
165
153
|
{
|
166
154
|
defaultSchema: {
|
167
155
|
type: 'gs1datamatrix',
|
168
|
-
icon: barcodeIcon,
|
169
156
|
content: '(01)03453120000011(17)191125(10)ABCD1234',
|
170
157
|
position,
|
171
158
|
...defaultColors,
|
package/src/graphics/image.ts
CHANGED
@@ -182,7 +182,6 @@ const imageSchema: Plugin<ImageSchema> = {
|
|
182
182
|
schema: {},
|
183
183
|
defaultSchema: {
|
184
184
|
type: 'image',
|
185
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
|
186
185
|
content: defaultValue,
|
187
186
|
position: { x: 0, y: 0 },
|
188
187
|
width: 40,
|
@@ -193,6 +192,7 @@ const imageSchema: Plugin<ImageSchema> = {
|
|
193
192
|
opacity: DEFAULT_OPACITY,
|
194
193
|
},
|
195
194
|
},
|
195
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
|
196
196
|
};
|
197
197
|
|
198
198
|
export default imageSchema;
|
@@ -205,8 +205,8 @@ export const readOnlyImage: Plugin<ImageSchema> = {
|
|
205
205
|
defaultSchema: {
|
206
206
|
...imageSchema.propPanel.defaultSchema,
|
207
207
|
type: 'readOnlyImage',
|
208
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M10.41 10.41a2 2 0 1 1-2.83-2.83"/><line x1="13.5" x2="6" y1="13.5" y2="21"/><line x1="18" x2="21" y1="12" y2="15"/><path d="M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"/><path d="M21 15V5a2 2 0 0 0-2-2H9"/></svg>',
|
209
208
|
readOnly: true,
|
210
209
|
},
|
211
210
|
},
|
211
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M10.41 10.41a2 2 0 1 1-2.83-2.83"/><line x1="13.5" x2="6" y1="13.5" y2="21"/><line x1="18" x2="21" y1="12" y2="15"/><path d="M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"/><path d="M21 15V5a2 2 0 0 0-2-2H9"/></svg>',
|
212
212
|
};
|
package/src/graphics/svg.ts
CHANGED
@@ -73,13 +73,13 @@ const svgSchema: Plugin<SVGSchema> = {
|
|
73
73
|
schema: {},
|
74
74
|
defaultSchema: {
|
75
75
|
type: 'svg',
|
76
|
-
icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"/><circle cx="18" cy="5" r="3"/></svg>',
|
77
76
|
content: defaultValue,
|
78
77
|
position: { x: 0, y: 0 },
|
79
78
|
width: 40,
|
80
79
|
height: 40,
|
81
80
|
},
|
82
81
|
},
|
82
|
+
icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"/><circle cx="18" cy="5" r="3"/></svg>',
|
83
83
|
};
|
84
84
|
|
85
85
|
export default svgSchema;
|
@@ -92,8 +92,8 @@ export const readOnlySvg: Plugin<SVGSchema> = {
|
|
92
92
|
defaultSchema: {
|
93
93
|
...svgSchema.propPanel.defaultSchema,
|
94
94
|
type: 'readOnlySvg',
|
95
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route-off"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5c.4 0 .9-.1 1.3-.2"/><path d="M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12"/><path d="m2 2 20 20"/><path d="M21 15.3a3.5 3.5 0 0 0-3.3-3.3"/><path d="M15 5h-4.3"/><circle cx="18" cy="5" r="3"/></svg>',
|
96
95
|
readOnly: true,
|
97
96
|
},
|
98
97
|
},
|
98
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route-off"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5c.4 0 .9-.1 1.3-.2"/><path d="M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12"/><path d="m2 2 20 20"/><path d="M21 15.3a3.5 3.5 0 0 0-3.3-3.3"/><path d="M15 5h-4.3"/><circle cx="18" cy="5" r="3"/></svg>',
|
99
99
|
};
|
@@ -4,5 +4,11 @@ import { propPanel } from './propPanel.js';
|
|
4
4
|
import { uiRender } from './uiRender.js';
|
5
5
|
import type { MultiVariableTextSchema } from './types';
|
6
6
|
|
7
|
-
const schema: Plugin<MultiVariableTextSchema> = {
|
7
|
+
const schema: Plugin<MultiVariableTextSchema> = {
|
8
|
+
pdf: pdfRender,
|
9
|
+
ui: uiRender,
|
10
|
+
propPanel,
|
11
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
12
|
+
uninterruptedEditMode: true
|
13
|
+
};
|
8
14
|
export default schema;
|
@@ -97,7 +97,6 @@ export const propPanel: PropPanel<MultiVariableTextSchema> = {
|
|
97
97
|
defaultSchema: {
|
98
98
|
...parentPropPanel.defaultSchema,
|
99
99
|
type: 'multiVariableText',
|
100
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
101
100
|
text: 'Type something...',
|
102
101
|
content: '{}',
|
103
102
|
variables: [],
|
package/src/shapes/line.ts
CHANGED
@@ -50,7 +50,6 @@ const lineSchema: Plugin<LineSchema> = {
|
|
50
50
|
}),
|
51
51
|
defaultSchema: {
|
52
52
|
type: 'line',
|
53
|
-
icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-minus"><path d="M5 12h14"/></svg>',
|
54
53
|
position: { x: 0, y: 0 },
|
55
54
|
width: 50,
|
56
55
|
height: 1,
|
@@ -60,5 +59,6 @@ const lineSchema: Plugin<LineSchema> = {
|
|
60
59
|
color: DEFAULT_LINE_COLOR,
|
61
60
|
},
|
62
61
|
},
|
62
|
+
icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-minus"><path d="M5 12h14"/></svg>',
|
63
63
|
};
|
64
64
|
export default lineSchema;
|
@@ -111,10 +111,17 @@ const getPropPanelSchema = (type: 'rectangle' | 'ellipse') => ({
|
|
111
111
|
defaultSchema: {
|
112
112
|
...shape.propPanel.defaultSchema,
|
113
113
|
type,
|
114
|
-
icon: type === 'rectangle' ? rectangleIcon : ellipseIcon,
|
115
114
|
},
|
116
115
|
});
|
117
116
|
|
118
|
-
export const rectangle = {
|
117
|
+
export const rectangle = {
|
118
|
+
...shape,
|
119
|
+
propPanel: getPropPanelSchema('rectangle'),
|
120
|
+
icon: rectangleIcon
|
121
|
+
};
|
119
122
|
|
120
|
-
export const ellipse = {
|
123
|
+
export const ellipse = {
|
124
|
+
...shape,
|
125
|
+
propPanel: getPropPanelSchema('ellipse'),
|
126
|
+
icon: ellipseIcon
|
127
|
+
};
|
@@ -17,7 +17,8 @@ export const modifyTemplateForTable = async (arg: {
|
|
17
17
|
for (const [key, schema] of Object.entries(schemaObj)) {
|
18
18
|
if (schema.type === 'table') {
|
19
19
|
schema.__bodyRange = undefined;
|
20
|
-
|
20
|
+
|
21
|
+
const body = getBody(input?.[key]);
|
21
22
|
const tables = await createMultiTables(body, {
|
22
23
|
schema,
|
23
24
|
basePdf: template.basePdf,
|
@@ -42,7 +43,8 @@ export const modifyTemplateForTable = async (arg: {
|
|
42
43
|
start: allBodies.slice(0, i + 1).reduce((acc, cur) => acc + cur.length, 0),
|
43
44
|
end: allBodies.slice(0, i + 2).reduce((acc, cur) => acc + cur.length, 0),
|
44
45
|
},
|
45
|
-
content:
|
46
|
+
content:
|
47
|
+
typeof input[key] !== 'string' ? JSON.stringify(input[key] || '[]') : input[key],
|
46
48
|
},
|
47
49
|
};
|
48
50
|
additionalSchemaObjs[additionalPageIndex] = additionalSchemaObj;
|
package/src/tables/helper.ts
CHANGED
@@ -186,10 +186,15 @@ export const getColumnStylesPropPanelSchema = ({
|
|
186
186
|
},
|
187
187
|
});
|
188
188
|
|
189
|
-
export const getBody = (value: string
|
189
|
+
export const getBody = (value: string | string[][]): string[][] => {
|
190
|
+
if (typeof value === 'string') {
|
191
|
+
return JSON.parse(value || '[]') as string[][];
|
192
|
+
}
|
193
|
+
return value || [];
|
194
|
+
};
|
190
195
|
|
191
196
|
export const getBodyWithRange = (
|
192
|
-
value: string,
|
197
|
+
value: string | string[][],
|
193
198
|
range?: { start: number; end?: number | undefined }
|
194
199
|
) => {
|
195
200
|
const body = getBody(value);
|
package/src/tables/index.ts
CHANGED
@@ -8,5 +8,6 @@ const tableSchema: Plugin<TableSchema> = {
|
|
8
8
|
pdf: pdfRender,
|
9
9
|
ui: uiRender,
|
10
10
|
propPanel,
|
11
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table"><path d="M12 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/></svg>',
|
11
12
|
};
|
12
13
|
export default tableSchema;
|
package/src/tables/pdfRender.ts
CHANGED
@@ -107,7 +107,11 @@ async function drawTable(arg: PDFRenderProps<TableSchema>, table: Table): Promis
|
|
107
107
|
|
108
108
|
export const pdfRender = async (arg: PDFRenderProps<TableSchema>) => {
|
109
109
|
const { value, schema } = arg;
|
110
|
-
|
110
|
+
|
111
|
+
const body = getBodyWithRange(
|
112
|
+
typeof value !== 'string' ? JSON.stringify(value || '[]') : value,
|
113
|
+
schema.__bodyRange
|
114
|
+
);
|
111
115
|
const table = await createSingleTable(body, arg);
|
112
116
|
await drawTable(arg, table);
|
113
117
|
};
|
package/src/tables/propPanel.ts
CHANGED
@@ -62,7 +62,6 @@ export const propPanel: PropPanel<TableSchema> = {
|
|
62
62
|
},
|
63
63
|
defaultSchema: {
|
64
64
|
type: 'table',
|
65
|
-
icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table"><path d="M12 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/></svg>',
|
66
65
|
position: { x: 0, y: 0 },
|
67
66
|
width: 150,
|
68
67
|
height: 20,
|
package/src/text/index.ts
CHANGED
@@ -4,7 +4,12 @@ import { propPanel } from './propPanel.js';
|
|
4
4
|
import { uiRender } from './uiRender.js';
|
5
5
|
import type { TextSchema } from './types';
|
6
6
|
|
7
|
-
const textSchema: Plugin<TextSchema> = {
|
7
|
+
const textSchema: Plugin<TextSchema> = {
|
8
|
+
pdf: pdfRender,
|
9
|
+
ui: uiRender,
|
10
|
+
propPanel,
|
11
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor-input"><path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1"/><path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5"/><path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"/><path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"/><path d="M9 7v10"/></svg>',
|
12
|
+
};
|
8
13
|
|
9
14
|
export default textSchema;
|
10
15
|
|
@@ -16,8 +21,8 @@ export const readOnlyText: Plugin<TextSchema> = {
|
|
16
21
|
defaultSchema: {
|
17
22
|
...textSchema.propPanel.defaultSchema,
|
18
23
|
type: 'readOnlyText',
|
19
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
20
24
|
readOnly: true,
|
21
25
|
},
|
22
26
|
},
|
27
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-type"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" x2="15" y1="20" y2="20"/><line x1="12" x2="12" y1="4" y2="20"/></svg>',
|
23
28
|
};
|
package/src/text/propPanel.ts
CHANGED
@@ -148,7 +148,6 @@ export const propPanel: PropPanel<TextSchema> = {
|
|
148
148
|
widgets: { UseDynamicFontSize },
|
149
149
|
defaultSchema: {
|
150
150
|
type: 'text',
|
151
|
-
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor-input"><path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1"/><path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5"/><path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"/><path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"/><path d="M9 7v10"/></svg>',
|
152
151
|
content: 'Type Something...',
|
153
152
|
position: { x: 0, y: 0 },
|
154
153
|
width: 45,
|