@pdfme/schemas 3.2.3-dev.1 → 4.0.0-alpha.0
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/cjs/__tests__/text.test.js +5 -4
- package/dist/cjs/__tests__/text.test.js.map +1 -1
- package/dist/cjs/__tests__/utils.test.js +3 -0
- package/dist/cjs/__tests__/utils.test.js.map +1 -1
- package/dist/cjs/src/barcodes/propPanel.js +11 -11
- package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
- package/dist/cjs/src/barcodes/uiRender.js +1 -1
- package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
- package/dist/cjs/src/graphics/image.js +5 -11
- package/dist/cjs/src/graphics/image.js.map +1 -1
- package/dist/cjs/src/graphics/svg.js +2 -3
- package/dist/cjs/src/graphics/svg.js.map +1 -1
- package/dist/cjs/src/index.js +6 -1
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/shapes/line.js +5 -9
- package/dist/cjs/src/shapes/line.js.map +1 -1
- package/dist/cjs/src/shapes/rectAndEllipse.js +3 -2
- package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/cjs/src/tables/cell.js +125 -0
- package/dist/cjs/src/tables/cell.js.map +1 -0
- package/dist/cjs/src/tables/classes.js +467 -0
- package/dist/cjs/src/tables/classes.js.map +1 -0
- package/dist/cjs/src/tables/dynamicTemplate.js +71 -0
- package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -0
- package/dist/cjs/src/tables/helper.js +171 -0
- package/dist/cjs/src/tables/helper.js.map +1 -0
- package/dist/cjs/src/tables/index.js +12 -0
- package/dist/cjs/src/tables/index.js.map +1 -0
- package/dist/cjs/src/tables/pdfRender.js +95 -0
- package/dist/cjs/src/tables/pdfRender.js.map +1 -0
- package/dist/cjs/src/tables/propPanel.js +87 -0
- package/dist/cjs/src/tables/propPanel.js.map +1 -0
- package/dist/cjs/src/tables/tableHelper.js +231 -0
- package/dist/cjs/src/tables/tableHelper.js.map +1 -0
- package/dist/cjs/src/tables/types.js +3 -0
- package/dist/cjs/src/tables/types.js.map +1 -0
- package/dist/cjs/src/tables/uiRender.js +321 -0
- package/dist/cjs/src/tables/uiRender.js.map +1 -0
- package/dist/cjs/src/text/helper.js +21 -6
- package/dist/cjs/src/text/helper.js.map +1 -1
- package/dist/cjs/src/text/index.js +0 -1
- package/dist/cjs/src/text/index.js.map +1 -1
- package/dist/cjs/src/text/pdfRender.js +5 -8
- package/dist/cjs/src/text/pdfRender.js.map +1 -1
- package/dist/cjs/src/text/propPanel.js +6 -4
- package/dist/cjs/src/text/propPanel.js.map +1 -1
- package/dist/cjs/src/text/uiRender.js +18 -17
- package/dist/cjs/src/text/uiRender.js.map +1 -1
- package/dist/cjs/src/utils.js +9 -1
- package/dist/cjs/src/utils.js.map +1 -1
- package/dist/esm/__tests__/text.test.js +5 -4
- package/dist/esm/__tests__/text.test.js.map +1 -1
- package/dist/esm/__tests__/utils.test.js +3 -0
- package/dist/esm/__tests__/utils.test.js.map +1 -1
- package/dist/esm/src/barcodes/propPanel.js +11 -11
- package/dist/esm/src/barcodes/propPanel.js.map +1 -1
- package/dist/esm/src/barcodes/uiRender.js +1 -1
- package/dist/esm/src/barcodes/uiRender.js.map +1 -1
- package/dist/esm/src/graphics/image.js +4 -10
- package/dist/esm/src/graphics/image.js.map +1 -1
- package/dist/esm/src/graphics/svg.js +2 -3
- package/dist/esm/src/graphics/svg.js.map +1 -1
- package/dist/esm/src/index.js +3 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/shapes/line.js +5 -9
- package/dist/esm/src/shapes/line.js.map +1 -1
- package/dist/esm/src/shapes/rectAndEllipse.js +3 -2
- package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/esm/src/tables/cell.js +120 -0
- package/dist/esm/src/tables/cell.js.map +1 -0
- package/dist/esm/src/tables/classes.js +460 -0
- package/dist/esm/src/tables/classes.js.map +1 -0
- package/dist/esm/src/tables/dynamicTemplate.js +66 -0
- package/dist/esm/src/tables/dynamicTemplate.js.map +1 -0
- package/dist/esm/src/tables/helper.js +163 -0
- package/dist/esm/src/tables/helper.js.map +1 -0
- package/dist/esm/src/tables/index.js +10 -0
- package/dist/esm/src/tables/index.js.map +1 -0
- package/dist/esm/src/tables/pdfRender.js +88 -0
- package/dist/esm/src/tables/pdfRender.js.map +1 -0
- package/dist/esm/src/tables/propPanel.js +84 -0
- package/dist/esm/src/tables/propPanel.js.map +1 -0
- package/dist/esm/src/tables/tableHelper.js +226 -0
- package/dist/esm/src/tables/tableHelper.js.map +1 -0
- package/dist/esm/src/tables/types.js +2 -0
- package/dist/esm/src/tables/types.js.map +1 -0
- package/dist/esm/src/tables/uiRender.js +314 -0
- package/dist/esm/src/tables/uiRender.js.map +1 -0
- package/dist/esm/src/text/helper.js +19 -5
- package/dist/esm/src/text/helper.js.map +1 -1
- package/dist/esm/src/text/index.js +0 -1
- package/dist/esm/src/text/index.js.map +1 -1
- package/dist/esm/src/text/pdfRender.js +6 -9
- package/dist/esm/src/text/pdfRender.js.map +1 -1
- package/dist/esm/src/text/propPanel.js +6 -4
- package/dist/esm/src/text/propPanel.js.map +1 -1
- package/dist/esm/src/text/uiRender.js +19 -18
- package/dist/esm/src/text/uiRender.js.map +1 -1
- package/dist/esm/src/utils.js +6 -0
- package/dist/esm/src/utils.js.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/shapes/rectAndEllipse.d.ts +13 -27
- package/dist/types/src/tables/cell.d.ts +4 -0
- package/dist/types/src/tables/classes.d.ts +68 -0
- package/dist/types/src/tables/dynamicTemplate.d.ts +13 -0
- package/dist/types/src/tables/helper.d.ts +252 -0
- package/dist/types/src/tables/index.d.ts +4 -0
- package/dist/types/src/tables/pdfRender.d.ts +3 -0
- package/dist/types/src/tables/propPanel.d.ts +3 -0
- package/dist/types/src/tables/tableHelper.d.ts +11 -0
- package/dist/types/src/tables/types.d.ts +91 -0
- package/dist/types/src/tables/uiRender.d.ts +3 -0
- package/dist/types/src/text/helper.d.ts +8 -1
- package/dist/types/src/utils.d.ts +2 -0
- package/package.json +1 -1
- package/src/barcodes/propPanel.ts +12 -12
- package/src/barcodes/uiRender.ts +1 -1
- package/src/graphics/image.ts +6 -11
- package/src/graphics/svg.ts +2 -3
- package/src/index.ts +5 -0
- package/src/shapes/line.ts +4 -9
- package/src/shapes/rectAndEllipse.ts +4 -4
- package/src/tables/cell.ts +157 -0
- package/src/tables/classes.ts +398 -0
- package/src/tables/dynamicTemplate.ts +81 -0
- package/src/tables/helper.ts +198 -0
- package/src/tables/index.ts +12 -0
- package/src/tables/pdfRender.ts +115 -0
- package/src/tables/propPanel.ts +90 -0
- package/src/tables/tableHelper.ts +322 -0
- package/src/tables/types.ts +88 -0
- package/src/tables/uiRender.ts +362 -0
- package/src/text/helper.ts +30 -6
- package/src/text/index.ts +0 -1
- package/src/text/pdfRender.ts +7 -11
- package/src/text/propPanel.ts +6 -4
- package/src/text/uiRender.ts +18 -18
- package/src/utils.ts +8 -0
@@ -10,9 +10,9 @@ const position = { x: 0, y: 0 };
|
|
10
10
|
const default40x20 = { width: 40, height: 20 };
|
11
11
|
const barcodeDefaults = [
|
12
12
|
{
|
13
|
-
defaultValue: 'https://pdfme.com/',
|
14
13
|
defaultSchema: {
|
15
14
|
type: 'qrcode',
|
15
|
+
content: 'https://pdfme.com/',
|
16
16
|
position,
|
17
17
|
...defaultColors,
|
18
18
|
width: 30,
|
@@ -22,9 +22,9 @@ const barcodeDefaults = [
|
|
22
22
|
},
|
23
23
|
},
|
24
24
|
{
|
25
|
-
defaultValue: '6540123789-A-K-Z',
|
26
25
|
defaultSchema: {
|
27
26
|
type: 'japanpost',
|
27
|
+
content: '6540123789-A-K-Z',
|
28
28
|
position,
|
29
29
|
...defaultColors,
|
30
30
|
...defaultTextColors,
|
@@ -36,9 +36,9 @@ const barcodeDefaults = [
|
|
36
36
|
},
|
37
37
|
},
|
38
38
|
{
|
39
|
-
defaultValue: '2112345678900',
|
40
39
|
defaultSchema: {
|
41
40
|
type: 'ean13',
|
41
|
+
content: '2112345678900',
|
42
42
|
position,
|
43
43
|
...defaultColors,
|
44
44
|
...defaultTextColors,
|
@@ -50,9 +50,9 @@ const barcodeDefaults = [
|
|
50
50
|
},
|
51
51
|
},
|
52
52
|
{
|
53
|
-
defaultValue: '02345673',
|
54
53
|
defaultSchema: {
|
55
54
|
type: 'ean8',
|
55
|
+
content: '02345673',
|
56
56
|
position,
|
57
57
|
...defaultColors,
|
58
58
|
...defaultTextColors,
|
@@ -63,9 +63,9 @@ const barcodeDefaults = [
|
|
63
63
|
},
|
64
64
|
},
|
65
65
|
{
|
66
|
-
defaultValue: 'THIS IS CODE 39',
|
67
66
|
defaultSchema: {
|
68
67
|
type: 'code39',
|
68
|
+
content: 'THIS IS CODE 39',
|
69
69
|
position,
|
70
70
|
...defaultColors,
|
71
71
|
...defaultTextColors,
|
@@ -75,9 +75,9 @@ const barcodeDefaults = [
|
|
75
75
|
},
|
76
76
|
},
|
77
77
|
{
|
78
|
-
defaultValue: 'This is Code 128!',
|
79
78
|
defaultSchema: {
|
80
79
|
type: 'code128',
|
80
|
+
content: 'This is Code 128!',
|
81
81
|
position,
|
82
82
|
...defaultColors,
|
83
83
|
...defaultTextColors,
|
@@ -88,9 +88,9 @@ const barcodeDefaults = [
|
|
88
88
|
},
|
89
89
|
},
|
90
90
|
{
|
91
|
-
defaultValue: 'A0123456789B',
|
92
91
|
defaultSchema: {
|
93
92
|
type: 'nw7',
|
93
|
+
content: 'A0123456789B',
|
94
94
|
position,
|
95
95
|
...defaultColors,
|
96
96
|
...defaultTextColors,
|
@@ -101,9 +101,9 @@ const barcodeDefaults = [
|
|
101
101
|
},
|
102
102
|
},
|
103
103
|
{
|
104
|
-
defaultValue: '04601234567893',
|
105
104
|
defaultSchema: {
|
106
105
|
type: 'itf14',
|
106
|
+
content: '04601234567893',
|
107
107
|
position,
|
108
108
|
...defaultColors,
|
109
109
|
...defaultTextColors,
|
@@ -115,9 +115,9 @@ const barcodeDefaults = [
|
|
115
115
|
},
|
116
116
|
},
|
117
117
|
{
|
118
|
-
defaultValue: '416000336108',
|
119
118
|
defaultSchema: {
|
120
119
|
type: 'upca',
|
120
|
+
content: '416000336108',
|
121
121
|
position,
|
122
122
|
...defaultColors,
|
123
123
|
...defaultTextColors,
|
@@ -129,9 +129,9 @@ const barcodeDefaults = [
|
|
129
129
|
},
|
130
130
|
},
|
131
131
|
{
|
132
|
-
defaultValue: '00123457',
|
133
132
|
defaultSchema: {
|
134
133
|
type: 'upce',
|
134
|
+
content: '00123457',
|
135
135
|
position,
|
136
136
|
...defaultColors,
|
137
137
|
...defaultTextColors,
|
@@ -142,9 +142,9 @@ const barcodeDefaults = [
|
|
142
142
|
},
|
143
143
|
},
|
144
144
|
{
|
145
|
-
defaultValue: '(01)03453120000011(17)191125(10)ABCD1234',
|
146
145
|
defaultSchema: {
|
147
146
|
type: 'gs1datamatrix',
|
147
|
+
content: '(01)03453120000011(17)191125(10)ABCD1234',
|
148
148
|
position,
|
149
149
|
...defaultColors,
|
150
150
|
width: 30,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/barcodes/propPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,wBAAwB;IACzC,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AACF,MAAM,iBAAiB,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AAC/D,MAAM,kBAAkB,GAAG,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;AACxE,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CA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,CAAC;gBACxC,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE;oBACL;wBACE,OAAO,EAAE,iBAAiB;wBAC1B,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC;qBAChC;iBACF;aACF;YACD,eAAe,EAAE;gBACf,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC;gBAC9B,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE;oBACL;wBACE,OAAO,EAAE,iBAAiB;wBAC1B,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC;qBAChC;iBACF;aACF;YACD,GAAG,CAAC,cAAc;gBAChB,CAAC,CAAC;oBACE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;oBAChF,WAAW,EAAE;wBACX,KAAK,EAAE,IAAI,CAAC,8BAA8B,CAAC;wBAC3C,IAAI,EAAE,SAAS;wBACf,MAAM,EAAE,QAAQ;qBACjB;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QACF,GAAG,QAAQ;KACZ,CAAC;AACJ,CAAC,CAAC"}
|
@@ -58,7 +58,7 @@ export const uiRender = async (arg) => {
|
|
58
58
|
input.placeholder = placeholder || '';
|
59
59
|
input.tabIndex = tabIndex || 0;
|
60
60
|
input.addEventListener('change', (e) => {
|
61
|
-
onChange && onChange(e.target.value);
|
61
|
+
onChange && onChange({ key: 'content', value: e.target.value });
|
62
62
|
});
|
63
63
|
input.addEventListener('blur', () => {
|
64
64
|
stopEditing && stopEditing();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/barcodes/uiRender.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,aAAa,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AiB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,IAAI,KAAK,UAAU,EAAE;YACvB,KAAK,CAAC,KAAK,EAAE,CAAC;SACf;KACF;IAED,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,IAAI;QACF,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1D,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KAC/B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,CAAC;QACpC,SAAS,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;KACzC;AACH,CAAC,CAAC"}
|
@@ -1,12 +1,7 @@
|
|
1
1
|
import { Buffer } from 'buffer';
|
2
|
-
import { convertForPdfLayoutProps, addAlphaToHex, isEditable, readFile } from '../utils.js';
|
2
|
+
import { convertForPdfLayoutProps, addAlphaToHex, isEditable, readFile, px2mm } from '../utils.js';
|
3
3
|
import { DEFAULT_OPACITY } from '../constants.js';
|
4
4
|
import { imageSize } from './helper.js';
|
5
|
-
const px2mm = (px) => {
|
6
|
-
// http://www.endmemo.com/sconvert/millimeterpixel.php
|
7
|
-
const ratio = 0.26458333333333;
|
8
|
-
return parseFloat(String(px)) * ratio;
|
9
|
-
};
|
10
5
|
const getCacheKey = (schema, input) => `${schema.type}${input}`;
|
11
6
|
const fullSize = { width: '100%', height: '100%' };
|
12
7
|
const defaultValue = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAAGQBAMAAAA+V+RCAAAAAXNSR0IArs4c6QAAABtQTFRFAAAAR3BMAAAAAAAAAAAAAAAAAAAAAAAAAAAAqmQqwQA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eezaMmIpiykiehHiEe+aN/tmuYuMxktuby4NnxYitzchOjkrDLR6cZWCYMrIiXc7zoUnj3nX1s8ZUTbqc5eWhMeLpoibvkdJmemBejSPVeIn6V4ssr0nXo7QzNCxp+th4KVKEQXkmRvLQcaxcANKPXTO+eICkgWvIW0JkEDsWyB4hkgbuBRKRQexcIBFJA/cCichg5o5x7VUg6SCzTMN0YYikiSvIL1SNDGLnRg0i6ch2g2PeNUTSmQvIBwIknAtZLXgWiEgKY+sdckTfQ9J+Yte4eUOIhHJkQ4mJABGJSvvGeiT1F7aMyzH9KJL2biyN6zdUjUTlr6l54vZDj+qQWPrXmWEi5KUEJBa//26RGRMuP449+jEkprV8TLPGgenjx8uomkj0N73+g6V/XjknAAAAAElFTkSuQmCC';
|
@@ -104,7 +99,7 @@ const imageSchema = {
|
|
104
99
|
};
|
105
100
|
Object.assign(button.style, buttonStyle);
|
106
101
|
button.addEventListener('click', () => {
|
107
|
-
onChange && onChange('');
|
102
|
+
onChange && onChange({ key: 'content', value: '' });
|
108
103
|
});
|
109
104
|
container.appendChild(button);
|
110
105
|
}
|
@@ -138,7 +133,7 @@ const imageSchema = {
|
|
138
133
|
input.accept = 'image/jpeg, image/png';
|
139
134
|
input.addEventListener('change', (event) => {
|
140
135
|
const changeEvent = event;
|
141
|
-
readFile(changeEvent.target.files).then((result) => onChange && onChange(result));
|
136
|
+
readFile(changeEvent.target.files).then((result) => onChange && onChange({ key: 'content', value: result }));
|
142
137
|
});
|
143
138
|
input.addEventListener('blur', () => stopEditing && stopEditing());
|
144
139
|
label.appendChild(input);
|
@@ -146,9 +141,9 @@ const imageSchema = {
|
|
146
141
|
},
|
147
142
|
propPanel: {
|
148
143
|
schema: {},
|
149
|
-
defaultValue,
|
150
144
|
defaultSchema: {
|
151
145
|
type: 'image',
|
146
|
+
content: defaultValue,
|
152
147
|
position: { x: 0, y: 0 },
|
153
148
|
width: 40,
|
154
149
|
height: 40,
|
@@ -169,7 +164,6 @@ export const readOnlyImage = {
|
|
169
164
|
...imageSchema.propPanel.defaultSchema,
|
170
165
|
type: 'readOnlyImage',
|
171
166
|
readOnly: true,
|
172
|
-
readOnlyValue: defaultValue,
|
173
167
|
},
|
174
168
|
},
|
175
169
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../src/graphics/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../src/graphics/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;AAChF,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACnD,MAAM,YAAY,GAChB,wsHAAwsH,CAAC;AAI3sH,MAAM,WAAW,GAAwB;IACvC,GAAG,EAAE,KAAK,EAAE,GAAgC,EAAE,EAAE;QAC9C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QACpD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC;YAAE,OAAO;QAEvD,MAAM,kBAAkB,GAAG,WA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AAM,EAAE,EAAE;YACV,uGAAuG;YACvG,4GAA4G;YAC5G,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,eAAe;SACzB;KACF;CACF,CAAC;AAEF,eAAe,WAAW,CAAC;AAE3B,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,GAAG,EAAE,WAAW,CAAC,GAAG;IACpB,EAAE,EAAE,WAAW,CAAC,EAAE;IAClB,SAAS,EAAE;QACT,GAAG,WAAW,CAAC,SAAS;QACxB,aAAa,EAAE;YACb,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa;YACtC,IAAI,EAAE,eAAe;YACrB,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC"}
|
@@ -34,7 +34,7 @@ const svgSchema = {
|
|
34
34
|
}
|
35
35
|
textarea.addEventListener('change', (e) => {
|
36
36
|
const newValue = e.target.value;
|
37
|
-
onChange && onChange(newValue);
|
37
|
+
onChange && onChange({ key: 'content', value: newValue });
|
38
38
|
});
|
39
39
|
rootElement.appendChild(container);
|
40
40
|
textarea.setSelectionRange(value.length, value.length);
|
@@ -67,9 +67,9 @@ const svgSchema = {
|
|
67
67
|
},
|
68
68
|
propPanel: {
|
69
69
|
schema: {},
|
70
|
-
defaultValue,
|
71
70
|
defaultSchema: {
|
72
71
|
type: 'svg',
|
72
|
+
content: defaultValue,
|
73
73
|
position: { x: 0, y: 0 },
|
74
74
|
width: 40,
|
75
75
|
height: 40,
|
@@ -86,7 +86,6 @@ export const readOnlySvg = {
|
|
86
86
|
...svgSchema.propPanel.defaultSchema,
|
87
87
|
type: 'readOnlySvg',
|
88
88
|
readOnly: true,
|
89
|
-
readOnlyValue: defaultValue,
|
90
89
|
},
|
91
90
|
},
|
92
91
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../../src/graphics/svg.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,wB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EAAE,GAAG,QAAQ,CAAC;QAC1B,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;YACxB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,WAAW,GAAsB;IAC5C,GAAG,EAAE,SAAS,CAAC,GAAG;IAClB,EAAE,EAAE,SAAS,CAAC,EAAE;IAChB,SAAS,EAAE;QACT,GAAG,SAAS,CAAC,SAAS;QACtB,aAAa,EAAE;YACb,GAAG,SAAS,CAAC,SAAS,CAAC,aAAa;YACpC,IAAI,EAAE,aAAa;YACnB,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC"}
|
package/dist/esm/src/index.js
CHANGED
@@ -3,8 +3,10 @@ import image, { readOnlyImage } from './graphics/image.js';
|
|
3
3
|
import svg, { readOnlySvg } from './graphics/svg.js';
|
4
4
|
import barcodes from './barcodes/index.js';
|
5
5
|
import line from './shapes/line.js';
|
6
|
+
import table from './tables/index.js';
|
7
|
+
import { modifyTemplateForTable, getDynamicHeightForTable } from './tables/dynamicTemplate.js';
|
6
8
|
import { rectangle, ellipse } from './shapes/rectAndEllipse.js';
|
7
9
|
import { convertForPdfLayoutProps, rotatePoint } from './utils.js';
|
8
10
|
const builtInPlugins = { Text: text };
|
9
|
-
export { text, readOnlyText, image, readOnlyImage, svg, readOnlySvg, barcodes, line, rectangle, ellipse, builtInPlugins, convertForPdfLayoutProps, rotatePoint, };
|
11
|
+
export { text, readOnlyText, image, readOnlyImage, svg, readOnlySvg, barcodes, line, table, modifyTemplateForTable, getDynamicHeightForTable, rectangle, ellipse, builtInPlugins, convertForPdfLayoutProps, rotatePoint, };
|
10
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,GAAG,EACH,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,cAAc,EACd,wBAAwB,EACxB,WAAW,GACZ,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,GAAG,EACH,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,sBAAsB,EACtB,wBAAwB,EACxB,SAAS,EACT,OAAO,EACP,cAAc,EACd,wBAAwB,EACxB,WAAW,GACZ,CAAC"}
|
@@ -4,6 +4,8 @@ const DEFAULT_LINE_COLOR = '#000000';
|
|
4
4
|
const lineSchema = {
|
5
5
|
pdf: (arg) => {
|
6
6
|
const { page, schema } = arg;
|
7
|
+
if (schema.width === 0 || schema.height === 0 || !schema.color)
|
8
|
+
return;
|
7
9
|
const pageHeight = page.getHeight();
|
8
10
|
const { width, height, rotate, position: { x, y }, opacity, } = convertForPdfLayoutProps({ schema, pageHeight, applyRotateTranslate: false });
|
9
11
|
const pivot = { x: x + width / 2, y: y + height / 2 };
|
@@ -11,14 +13,14 @@ const lineSchema = {
|
|
11
13
|
start: rotatePoint({ x, y: y + height / 2 }, pivot, rotate.angle),
|
12
14
|
end: rotatePoint({ x: x + width, y: y + height / 2 }, pivot, rotate.angle),
|
13
15
|
thickness: height,
|
14
|
-
color: hex2RgbColor(schema.color
|
16
|
+
color: hex2RgbColor(schema.color),
|
15
17
|
opacity: opacity,
|
16
18
|
});
|
17
19
|
},
|
18
20
|
ui: (arg) => {
|
19
21
|
const { schema, rootElement } = arg;
|
20
22
|
const div = document.createElement('div');
|
21
|
-
div.style.backgroundColor = schema.color ??
|
23
|
+
div.style.backgroundColor = schema.color ?? 'transparent';
|
22
24
|
div.style.width = '100%';
|
23
25
|
div.style.height = '100%';
|
24
26
|
rootElement.appendChild(div);
|
@@ -30,15 +32,9 @@ const lineSchema = {
|
|
30
32
|
type: 'string',
|
31
33
|
widget: 'color',
|
32
34
|
required: true,
|
33
|
-
rules: [
|
34
|
-
{
|
35
|
-
pattern: HEX_COLOR_PATTERN,
|
36
|
-
message: i18n('hexColorPrompt'),
|
37
|
-
},
|
38
|
-
],
|
35
|
+
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
39
36
|
},
|
40
37
|
}),
|
41
|
-
defaultValue: '',
|
42
38
|
defaultSchema: {
|
43
39
|
type: 'line',
|
44
40
|
position: { x: 0, y: 0 },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../src/shapes/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAMrC,MAAM,UAAU,GAAuB;IACrC,GAAG,EAAE,CAAC,GAA+B,EAAE,EAAE;QACvC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAClB,OAAO,GACR,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;QAClF,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,QAAQ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E,CAAC;aACzE;SACF,CAAC;QACF,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;YACxB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,kBAAkB;SAC1B;KACF;CACF,CAAC;AACF,eAAe,UAAU,CAAC"}
|
@@ -19,6 +19,8 @@ const shape = {
|
|
19
19
|
},
|
20
20
|
pdf: (arg) => {
|
21
21
|
const { schema, page } = arg;
|
22
|
+
if (!schema.color && !schema.borderColor)
|
23
|
+
return;
|
22
24
|
const pageHeight = page.getHeight();
|
23
25
|
const cArg = { schema, pageHeight };
|
24
26
|
const { position, width, height, rotate, opacity } = convertForPdfLayoutProps(cArg);
|
@@ -57,7 +59,7 @@ const shape = {
|
|
57
59
|
title: i18n('schemas.borderWidth'),
|
58
60
|
type: 'number',
|
59
61
|
widget: 'inputNumber',
|
60
|
-
min: 0,
|
62
|
+
props: { min: 0 },
|
61
63
|
step: 1,
|
62
64
|
},
|
63
65
|
borderColor: {
|
@@ -73,7 +75,6 @@ const shape = {
|
|
73
75
|
rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
|
74
76
|
},
|
75
77
|
}),
|
76
|
-
defaultValue: '',
|
77
78
|
defaultSchema: {
|
78
79
|
type: 'rectangle',
|
79
80
|
position: { x: 0, y: 0 },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rectAndEllipse.js","sourceRoot":"","sources":["../../../../src/shapes/rectAndEllipse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM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MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,SAAS;YACtB,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAA6B,EAAE,EAAE,CAAC,CAAC;IAC7D,GAAG,KAAK,CAAC,SAAS;IAClB,aAAa,EAAE,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE;CAC1D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;AAElF,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC"}
|
@@ -0,0 +1,120 @@
|
|
1
|
+
import { DEFAULT_FONT_NAME, getFallbackFontName, } from '@pdfme/common';
|
2
|
+
import { uiRender as textUiRender } from '../text/uiRender.js';
|
3
|
+
import { pdfRender as textPdfRender } from '../text/pdfRender.js';
|
4
|
+
import line from '../shapes/line.js';
|
5
|
+
import { rectangle } from '../shapes/rectAndEllipse.js';
|
6
|
+
import { getCellPropPanelSchema, getDefaultCellStyles } from './helper.js';
|
7
|
+
const linePdfRender = line.pdf;
|
8
|
+
const rectanglePdfRender = rectangle.pdf;
|
9
|
+
const renderLine = async (arg, schema, position, width, height) => linePdfRender({
|
10
|
+
...arg,
|
11
|
+
schema: { ...schema, type: 'line', position, width, height, color: schema.borderColor },
|
12
|
+
});
|
13
|
+
const createTextDiv = (schema) => {
|
14
|
+
const { borderWidth: bw, width, height, padding: pd } = schema;
|
15
|
+
const textDiv = document.createElement('div');
|
16
|
+
textDiv.style.position = 'absolute';
|
17
|
+
textDiv.style.zIndex = '1';
|
18
|
+
textDiv.style.width = `${width - bw.left - bw.right - pd.left - pd.right}mm`;
|
19
|
+
textDiv.style.height = `${height - bw.top - bw.bottom - pd.top - pd.bottom}mm`;
|
20
|
+
textDiv.style.top = `${bw.top + pd.top}mm`;
|
21
|
+
textDiv.style.left = `${bw.left + pd.left}mm`;
|
22
|
+
return textDiv;
|
23
|
+
};
|
24
|
+
const createLineDiv = (width, height, top, right, bottom, left, borderColor) => {
|
25
|
+
const div = document.createElement('div');
|
26
|
+
div.style.width = width;
|
27
|
+
div.style.height = height;
|
28
|
+
div.style.position = 'absolute';
|
29
|
+
if (top !== null)
|
30
|
+
div.style.top = top;
|
31
|
+
if (right !== null)
|
32
|
+
div.style.right = right;
|
33
|
+
if (bottom !== null)
|
34
|
+
div.style.bottom = bottom;
|
35
|
+
if (left !== null)
|
36
|
+
div.style.left = left;
|
37
|
+
div.style.backgroundColor = borderColor;
|
38
|
+
return div;
|
39
|
+
};
|
40
|
+
const cellSchema = {
|
41
|
+
pdf: async (arg) => {
|
42
|
+
const { schema } = arg;
|
43
|
+
const { position, width, height, borderWidth, padding } = schema;
|
44
|
+
await Promise.all([
|
45
|
+
// BACKGROUND
|
46
|
+
rectanglePdfRender({
|
47
|
+
...arg,
|
48
|
+
schema: {
|
49
|
+
...schema,
|
50
|
+
type: 'rectangle',
|
51
|
+
width: schema.width,
|
52
|
+
height: schema.height,
|
53
|
+
borderWidth: 0,
|
54
|
+
borderColor: '',
|
55
|
+
color: schema.backgroundColor,
|
56
|
+
},
|
57
|
+
}),
|
58
|
+
// TOP
|
59
|
+
renderLine(arg, schema, { x: position.x, y: position.y }, width, borderWidth.top),
|
60
|
+
// RIGHT
|
61
|
+
renderLine(arg, schema, { x: position.x + width - borderWidth.right, y: position.y }, borderWidth.right, height),
|
62
|
+
// BOTTOM
|
63
|
+
renderLine(arg, schema, { x: position.x, y: position.y + height - borderWidth.bottom }, width, borderWidth.bottom),
|
64
|
+
// LEFT
|
65
|
+
renderLine(arg, schema, { x: position.x, y: position.y }, borderWidth.left, height),
|
66
|
+
]);
|
67
|
+
// TEXT
|
68
|
+
await textPdfRender({
|
69
|
+
...arg,
|
70
|
+
schema: {
|
71
|
+
...schema,
|
72
|
+
type: 'text',
|
73
|
+
backgroundColor: '',
|
74
|
+
position: {
|
75
|
+
x: position.x + borderWidth.left + padding.left,
|
76
|
+
y: position.y + borderWidth.top + padding.top,
|
77
|
+
},
|
78
|
+
width: width - borderWidth.left - borderWidth.right - padding.left - padding.right,
|
79
|
+
height: height - borderWidth.top - borderWidth.bottom - padding.top - padding.bottom,
|
80
|
+
},
|
81
|
+
});
|
82
|
+
},
|
83
|
+
ui: async (arg) => {
|
84
|
+
const { schema, rootElement } = arg;
|
85
|
+
const { borderWidth, width, height, borderColor, backgroundColor } = schema;
|
86
|
+
rootElement.style.backgroundColor = backgroundColor;
|
87
|
+
const textDiv = createTextDiv(schema);
|
88
|
+
await textUiRender({
|
89
|
+
...arg,
|
90
|
+
schema: { ...schema, backgroundColor: '' },
|
91
|
+
rootElement: textDiv,
|
92
|
+
});
|
93
|
+
rootElement.appendChild(textDiv);
|
94
|
+
const lines = [
|
95
|
+
createLineDiv(`${width}mm`, `${borderWidth.top}mm`, '0mm', null, null, '0mm', borderColor),
|
96
|
+
createLineDiv(`${width}mm`, `${borderWidth.bottom}mm`, null, null, '0mm', '0mm', borderColor),
|
97
|
+
createLineDiv(`${borderWidth.left}mm`, `${height}mm`, '0mm', null, null, '0mm', borderColor),
|
98
|
+
createLineDiv(`${borderWidth.right}mm`, `${height}mm`, '0mm', '0mm', null, null, borderColor),
|
99
|
+
];
|
100
|
+
lines.forEach((line) => rootElement.appendChild(line));
|
101
|
+
},
|
102
|
+
propPanel: {
|
103
|
+
schema: ({ options, i18n }) => {
|
104
|
+
const font = options.font || { [DEFAULT_FONT_NAME]: { data: '', fallback: true } };
|
105
|
+
const fontNames = Object.keys(font);
|
106
|
+
const fallbackFontName = getFallbackFontName(font);
|
107
|
+
return getCellPropPanelSchema({ i18n, fontNames, fallbackFontName });
|
108
|
+
},
|
109
|
+
defaultSchema: {
|
110
|
+
type: 'cell',
|
111
|
+
content: 'Type Something...',
|
112
|
+
position: { x: 0, y: 0 },
|
113
|
+
width: 50,
|
114
|
+
height: 15,
|
115
|
+
...getDefaultCellStyles(),
|
116
|
+
},
|
117
|
+
},
|
118
|
+
};
|
119
|
+
export default cellSchema;
|
120
|
+
//# sourceMappingURL=cell.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cell.js","sourceRoot":"","sources":["../../../../src/tables/cell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAIjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC;AAC/B,MAAM,kBAAkB,GAAG,SAAS,CAAC,GAAG,CAAC;AAEzC,MAAM,UAAU,GAAG,KAAK,EACtB,GAA+B,EAC/B,MAAkB,EAClB,QAAkC,EAClC,KAAa,EACb,MAAc,EACd,EAAE,CACF,aAAa,CAAC;IACZ,GAAG,GAAG;IACN,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE;CACxF,CAAC,CAAC;AAEL,MAAM,aAAa,GAAG,CAAC,MAAkB,EAAE,EAAE;IAC3C,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,MAAM,CAA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