@pdfme/common 2.0.1 → 2.1.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__/font.test.js +193 -27
- package/dist/cjs/__tests__/font.test.js.map +1 -1
- package/dist/cjs/__tests__/helper.test.js +15 -0
- package/dist/cjs/__tests__/helper.test.js.map +1 -1
- package/dist/cjs/src/constants.js +8 -5
- package/dist/cjs/src/constants.js.map +1 -1
- package/dist/cjs/src/font.js +147 -38
- package/dist/cjs/src/font.js.map +1 -1
- package/dist/cjs/src/helper.js +10 -1
- package/dist/cjs/src/helper.js.map +1 -1
- package/dist/cjs/src/index.js +11 -5
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/schema.js +2 -1
- package/dist/cjs/src/schema.js.map +1 -1
- package/dist/esm/__tests__/font.test.js +194 -28
- package/dist/esm/__tests__/font.test.js.map +1 -1
- package/dist/esm/__tests__/helper.test.js +16 -1
- package/dist/esm/__tests__/helper.test.js.map +1 -1
- package/dist/esm/src/constants.js +7 -4
- package/dist/esm/src/constants.js.map +1 -1
- package/dist/esm/src/font.js +145 -38
- package/dist/esm/src/font.js.map +1 -1
- package/dist/esm/src/helper.js +8 -1
- package/dist/esm/src/helper.js.map +1 -1
- package/dist/esm/src/index.js +4 -4
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/schema.js +2 -1
- package/dist/esm/src/schema.js.map +1 -1
- package/dist/types/src/constants.d.ts +7 -4
- package/dist/types/src/font.d.ts +20 -1
- package/dist/types/src/helper.d.ts +2 -0
- package/dist/types/src/index.d.ts +5 -5
- package/dist/types/src/schema.d.ts +123 -29
- package/dist/types/src/type.d.ts +1 -0
- package/package.json +1 -1
- package/src/constants.ts +7 -4
- package/src/font.ts +195 -63
- package/src/helper.ts +10 -1
- package/src/index.ts +24 -9
- package/src/schema.ts +2 -1
package/dist/esm/src/font.js
CHANGED
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
import * as fontkit from 'fontkit';
|
11
11
|
import { isTextSchema } from './type';
|
12
12
|
import { Buffer } from 'buffer';
|
13
|
-
import { DEFAULT_FONT_VALUE, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_CHARACTER_SPACING,
|
13
|
+
import { DEFAULT_FONT_VALUE, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_CHARACTER_SPACING, DEFAULT_LINE_HEIGHT, FONT_SIZE_ADJUSTMENT, PT_TO_PX_RATIO, DEFAULT_DYNAMIC_FIT, DYNAMIC_FIT_HORIZONTAL, DYNAMIC_FIT_VERTICAL, } from './constants';
|
14
|
+
import { mm2pt, pt2mm } from './helper';
|
14
15
|
import { b64toUint8Array } from ".";
|
15
16
|
export const getFallbackFontName = (font) => {
|
16
17
|
const initial = '';
|
@@ -55,7 +56,7 @@ export const checkFont = (arg) => {
|
|
55
56
|
};
|
56
57
|
export const getFontAlignmentValue = (fontKitFont, fontSize) => {
|
57
58
|
const { ascent, descent, unitsPerEm } = fontKitFont;
|
58
|
-
const fontSizeInPx = fontSize *
|
59
|
+
const fontSizeInPx = fontSize * PT_TO_PX_RATIO;
|
59
60
|
// Convert ascent and descent to px values
|
60
61
|
const ascentInPixels = (ascent / unitsPerEm) * fontSizeInPx;
|
61
62
|
const descentInPixels = (descent / unitsPerEm) * fontSizeInPx;
|
@@ -73,28 +74,15 @@ export const heightOfFontAtSize = (fontKitFont, fontSize) => {
|
|
73
74
|
height -= Math.abs(descent * scale) || 0;
|
74
75
|
return (height / 1000) * fontSize;
|
75
76
|
};
|
76
|
-
const widthOfTextAtSize = (input, fontKitFont, fontSize) => {
|
77
|
-
const { glyphs } = fontKitFont.layout(input);
|
78
|
-
const scale = 1000 / fontKitFont.unitsPerEm;
|
79
|
-
return glyphs.reduce((totalWidth, glyph) => totalWidth + glyph.advanceWidth * scale, 0) * (fontSize / 1000);
|
80
|
-
};
|
81
77
|
const calculateCharacterSpacing = (textContent, textCharacterSpacing) => {
|
82
|
-
|
83
|
-
return (numberOfCharacters - 1) * textCharacterSpacing;
|
78
|
+
return (textContent.length - 1) * textCharacterSpacing;
|
84
79
|
};
|
85
|
-
const
|
86
|
-
const
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
const lineWidth = calculateTextWidthInMm(line, textWidth, characterSpacingCount);
|
92
|
-
if (lineWidth > maxLineWidth) {
|
93
|
-
longestLine = line;
|
94
|
-
maxLineWidth = lineWidth;
|
95
|
-
}
|
96
|
-
});
|
97
|
-
return longestLine;
|
80
|
+
export const widthOfTextAtSize = (text, fontKitFont, fontSize, characterSpacing) => {
|
81
|
+
const { glyphs } = fontKitFont.layout(text);
|
82
|
+
const scale = 1000 / fontKitFont.unitsPerEm;
|
83
|
+
const standardWidth = glyphs.reduce((totalWidth, glyph) => totalWidth + glyph.advanceWidth * scale, 0) *
|
84
|
+
(fontSize / 1000);
|
85
|
+
return standardWidth + calculateCharacterSpacing(text, characterSpacing);
|
98
86
|
};
|
99
87
|
const fontKitFontCache = {};
|
100
88
|
export const getFontKitFont = (textSchema, font) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -111,28 +99,147 @@ export const getFontKitFont = (textSchema, font) => __awaiter(void 0, void 0, vo
|
|
111
99
|
fontKitFontCache[fontName] = fontKitFont;
|
112
100
|
return fontKitFont;
|
113
101
|
});
|
114
|
-
const
|
115
|
-
const
|
116
|
-
|
102
|
+
const isTextExceedingBoxWidth = (text, calcValues) => {
|
103
|
+
const { font, fontSize, characterSpacing, boxWidthInPt } = calcValues;
|
104
|
+
const textWidth = widthOfTextAtSize(text, font, fontSize, characterSpacing);
|
105
|
+
return textWidth > boxWidthInPt;
|
117
106
|
};
|
118
|
-
|
119
|
-
|
120
|
-
|
107
|
+
/**
|
108
|
+
* Incrementally checks the current line for its real length
|
109
|
+
* and returns the position where it exceeds the box width.
|
110
|
+
* Returns `null` to indicate if textLine is shorter than the available box.
|
111
|
+
*/
|
112
|
+
const getOverPosition = (textLine, calcValues) => {
|
113
|
+
for (let i = 0; i <= textLine.length; i++) {
|
114
|
+
if (isTextExceedingBoxWidth(textLine.slice(0, i + 1), calcValues)) {
|
115
|
+
return i;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
return null;
|
119
|
+
};
|
120
|
+
/**
|
121
|
+
* Gets the position of the split. Splits the exceeding line at
|
122
|
+
* the last whitespace prior to it exceeding the bounding box width.
|
123
|
+
*/
|
124
|
+
const getSplitPosition = (textLine, calcValues) => {
|
125
|
+
const overPos = getOverPosition(textLine, calcValues);
|
126
|
+
if (overPos === null)
|
127
|
+
return textLine.length; // input line is shorter than the available space
|
128
|
+
let overPosTmp = overPos;
|
129
|
+
while (textLine[overPosTmp] !== ' ' && overPosTmp >= 0) {
|
130
|
+
overPosTmp--;
|
131
|
+
}
|
132
|
+
// For very long lines with no whitespace use the original overPos
|
133
|
+
return overPosTmp > 0 ? overPosTmp : overPos;
|
134
|
+
};
|
135
|
+
/**
|
136
|
+
* Recursively splits the line at getSplitPosition.
|
137
|
+
* If there is some leftover, split the rest again in the same manner.
|
138
|
+
*/
|
139
|
+
export const getSplittedLines = (textLine, calcValues) => {
|
140
|
+
const splitPos = getSplitPosition(textLine, calcValues);
|
141
|
+
const splittedLine = textLine.substring(0, splitPos);
|
142
|
+
const rest = textLine.substring(splitPos).trimStart();
|
143
|
+
if (rest === textLine) {
|
144
|
+
// if we went so small that we want to split on the first char
|
145
|
+
// then end recursion to avoid infinite loop
|
146
|
+
return [textLine];
|
147
|
+
}
|
148
|
+
if (rest.length === 0) {
|
149
|
+
// end recursion if there is no leftover
|
150
|
+
return [splittedLine];
|
151
|
+
}
|
152
|
+
return [splittedLine, ...getSplittedLines(rest, calcValues)];
|
153
|
+
};
|
154
|
+
/**
|
155
|
+
* If using dynamic font size, iteratively increment or decrement the
|
156
|
+
* font size to fit the containing box.
|
157
|
+
* Calculating space usage involves splitting lines where they exceed
|
158
|
+
* the box width based on the proposed size.
|
159
|
+
*/
|
160
|
+
export const calculateDynamicFontSize = ({ textSchema, font, input, startingFontSize, }) => __awaiter(void 0, void 0, void 0, function* () {
|
161
|
+
var _a;
|
162
|
+
const { fontSize: schemaFontSize, dynamicFontSize: dynamicFontSizeSetting, characterSpacing: schemaCharacterSpacing, width: boxWidth, height: boxHeight, lineHeight = DEFAULT_LINE_HEIGHT, } = textSchema;
|
163
|
+
const fontSize = startingFontSize || schemaFontSize || DEFAULT_FONT_SIZE;
|
121
164
|
if (!dynamicFontSizeSetting)
|
122
165
|
return fontSize;
|
123
|
-
|
166
|
+
if (dynamicFontSizeSetting.max < dynamicFontSizeSetting.min)
|
167
|
+
return fontSize;
|
168
|
+
const characterSpacing = schemaCharacterSpacing !== null && schemaCharacterSpacing !== void 0 ? schemaCharacterSpacing : DEFAULT_CHARACTER_SPACING;
|
124
169
|
const fontKitFont = yield getFontKitFont(textSchema, font);
|
125
|
-
const
|
126
|
-
const textWidth = widthOfTextAtSize(textContent, fontKitFont, fontSize);
|
170
|
+
const textContentRows = input.split('\n');
|
127
171
|
let dynamicFontSize = fontSize;
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
172
|
+
if (dynamicFontSize < dynamicFontSizeSetting.min) {
|
173
|
+
dynamicFontSize = dynamicFontSizeSetting.min;
|
174
|
+
}
|
175
|
+
else if (dynamicFontSize > dynamicFontSizeSetting.max) {
|
176
|
+
dynamicFontSize = dynamicFontSizeSetting.max;
|
177
|
+
}
|
178
|
+
const dynamicFontFit = (_a = dynamicFontSizeSetting.fit) !== null && _a !== void 0 ? _a : DEFAULT_DYNAMIC_FIT;
|
179
|
+
const calculateConstraints = (size) => {
|
180
|
+
let totalWidthInMm = 0;
|
181
|
+
let totalHeightInMm = 0;
|
182
|
+
const boxWidthInPt = mm2pt(boxWidth);
|
183
|
+
const textHeight = heightOfFontAtSize(fontKitFont, size);
|
184
|
+
const textHeightInMm = pt2mm(textHeight * lineHeight);
|
185
|
+
textContentRows.forEach((paragraph) => {
|
186
|
+
const lines = getSplittedLines(paragraph, {
|
187
|
+
font: fontKitFont,
|
188
|
+
fontSize: size,
|
189
|
+
characterSpacing,
|
190
|
+
boxWidthInPt,
|
191
|
+
});
|
192
|
+
lines.forEach((line) => {
|
193
|
+
if (dynamicFontFit === DYNAMIC_FIT_VERTICAL) {
|
194
|
+
// For vertical fit we want to consider the width of text lines where we detect a split
|
195
|
+
const textWidth = widthOfTextAtSize(line, fontKitFont, size, characterSpacing);
|
196
|
+
const textWidthInMm = pt2mm(textWidth);
|
197
|
+
totalWidthInMm = Math.max(totalWidthInMm, textWidthInMm);
|
198
|
+
}
|
199
|
+
totalHeightInMm += textHeightInMm;
|
200
|
+
});
|
201
|
+
if (dynamicFontFit === DYNAMIC_FIT_HORIZONTAL) {
|
202
|
+
// For horizontal fit we want to consider the line's width 'unsplit'
|
203
|
+
const textWidth = widthOfTextAtSize(paragraph, fontKitFont, size, characterSpacing);
|
204
|
+
const textWidthInMm = pt2mm(textWidth);
|
205
|
+
totalWidthInMm = Math.max(totalWidthInMm, textWidthInMm);
|
206
|
+
}
|
207
|
+
});
|
208
|
+
return { totalWidthInMm, totalHeightInMm };
|
209
|
+
};
|
210
|
+
const shouldFontGrowToFit = (totalWidthInMm, totalHeightInMm) => {
|
211
|
+
if (dynamicFontSize >= dynamicFontSizeSetting.max) {
|
212
|
+
return false;
|
213
|
+
}
|
214
|
+
if (dynamicFontFit === DYNAMIC_FIT_HORIZONTAL) {
|
215
|
+
return totalWidthInMm < boxWidth;
|
216
|
+
}
|
217
|
+
return totalHeightInMm < boxHeight;
|
218
|
+
};
|
219
|
+
const shouldFontShrinkToFit = (totalWidthInMm, totalHeightInMm) => {
|
220
|
+
if (dynamicFontSize <= dynamicFontSizeSetting.min || dynamicFontSize <= 0) {
|
221
|
+
return false;
|
222
|
+
}
|
223
|
+
return totalWidthInMm > boxWidth || totalHeightInMm > boxHeight;
|
224
|
+
};
|
225
|
+
let { totalWidthInMm, totalHeightInMm } = calculateConstraints(dynamicFontSize);
|
226
|
+
// Attempt to increase the font size up to desired fit
|
227
|
+
while (shouldFontGrowToFit(totalWidthInMm, totalHeightInMm)) {
|
228
|
+
dynamicFontSize += FONT_SIZE_ADJUSTMENT;
|
229
|
+
const { totalWidthInMm: newWidth, totalHeightInMm: newHeight } = calculateConstraints(dynamicFontSize);
|
230
|
+
if (newHeight < boxHeight) {
|
231
|
+
totalWidthInMm = newWidth;
|
232
|
+
totalHeightInMm = newHeight;
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
dynamicFontSize -= FONT_SIZE_ADJUSTMENT;
|
236
|
+
break;
|
237
|
+
}
|
132
238
|
}
|
133
|
-
|
134
|
-
|
135
|
-
|
239
|
+
// Attempt to decrease the font size down to desired fit
|
240
|
+
while (shouldFontShrinkToFit(totalWidthInMm, totalHeightInMm)) {
|
241
|
+
dynamicFontSize -= FONT_SIZE_ADJUSTMENT;
|
242
|
+
({ totalWidthInMm, totalHeightInMm } = calculateConstraints(dynamicFontSize));
|
136
243
|
}
|
137
244
|
return dynamicFontSize;
|
138
245
|
});
|
package/dist/esm/src/font.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../../src/font.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAA0B,YAAY,EAAc,MAAM,QAAQ,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,
|
1
|
+
{"version":3,"file":"font.js","sourceRoot":"","sources":["../../../src/font.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EAA0B,YAAY,EAAc,MAAM,QAAQ,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM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,CAAC,CAAC;KAC/E;IAED,OAAO,eAAe,CAAC;AACzB,CAAC,CAAA,CAAC"}
|
package/dist/esm/src/helper.js
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
import { Buffer } from 'buffer';
|
3
3
|
import { Inputs as InputsSchema, UIOptions as UIOptionsSchema, Template as TemplateSchema, PreviewProps as PreviewPropsSchema, DesignerProps as DesignerPropsSchema, GenerateProps as GeneratePropsSchema, UIProps as UIPropsSchema, } from './schema';
|
4
|
-
import {
|
4
|
+
import { MM_TO_PT_RATIO, PT_TO_MM_RATIO } from './constants';
|
5
|
+
import { checkFont } from './font';
|
6
|
+
export const mm2pt = (mm) => {
|
7
|
+
return parseFloat(String(mm)) * MM_TO_PT_RATIO;
|
8
|
+
};
|
9
|
+
export const pt2mm = (pt) => {
|
10
|
+
return pt * PT_TO_MM_RATIO;
|
11
|
+
};
|
5
12
|
const blob2Base64Pdf = (blob) => {
|
6
13
|
return new Promise((resolve, reject) => {
|
7
14
|
const reader = new FileReader();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,MAAM,IAAI,YAAY,EACtB,SAAS,IAAI,eAAe,EAC5B,QAAQ,IAAI,cAAc,EAC1B,YAAY,IAAI,kBAAkB,EAClC,aAAa,IAAI,mBAAmB,EACpC,aAAa,IAAI,mBAAmB,EACpC,OAAO,IAAI,aAAa,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA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,CAAC;KACZ;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
package/dist/esm/src/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR,
|
1
|
+
import { DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, DYNAMIC_FIT_VERTICAL, DYNAMIC_FIT_HORIZONTAL, DEFAULT_DYNAMIC_FIT, FONT_SIZE_ADJUSTMENT, MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, DEFAULT_FONT_VALUE, } from './constants.js';
|
2
2
|
import { schemaTypes, isImageSchema, isBarcodeSchema, isTextSchema } from './type.js';
|
3
|
-
import { getB64BasePdf, b64toUint8Array, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, } from './helper.js';
|
4
|
-
import { calculateDynamicFontSize, getFallbackFontName, getDefaultFont, heightOfFontAtSize, checkFont, getFontKitFont, getFontAlignmentValue, } from './font.js';
|
5
|
-
export { DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR,
|
3
|
+
import { getB64BasePdf, b64toUint8Array, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, mm2pt, validateBarcodeInput, } from './helper.js';
|
4
|
+
import { calculateDynamicFontSize, getFallbackFontName, getDefaultFont, heightOfFontAtSize, widthOfTextAtSize, checkFont, getFontKitFont, getFontAlignmentValue, getSplittedLines, } from './font.js';
|
5
|
+
export { DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, DYNAMIC_FIT_VERTICAL, DYNAMIC_FIT_HORIZONTAL, DEFAULT_DYNAMIC_FIT, FONT_SIZE_ADJUSTMENT, MM_TO_PT_RATIO, PT_TO_MM_RATIO, PT_TO_PX_RATIO, BLANK_PDF, DEFAULT_FONT_VALUE, schemaTypes, isTextSchema, isImageSchema, isBarcodeSchema, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, getSplittedLines, heightOfFontAtSize, widthOfTextAtSize, mm2pt, checkFont, getFontKitFont, getFontAlignmentValue, checkInputs, checkUIOptions, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, calculateDynamicFontSize, };
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AA0BtF,OAAO,EACL,aAAa,EACb,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,EACL,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,CAAC"}
|
package/dist/esm/src/schema.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint dot-notation: "off"*/
|
2
2
|
import { z } from 'zod';
|
3
|
-
const langs = ['en', 'ja', 'ar', 'th'];
|
3
|
+
const langs = ['en', 'ja', 'ar', 'th', 'pl'];
|
4
4
|
export const Lang = z.enum(langs);
|
5
5
|
export const Size = z.object({ height: z.number(), width: z.number() });
|
6
6
|
const alignments = ['left', 'center', 'right'];
|
@@ -30,6 +30,7 @@ export const TextSchema = CommonSchema.extend({
|
|
30
30
|
dynamicFontSize: z.object({
|
31
31
|
max: z.number(),
|
32
32
|
min: z.number(),
|
33
|
+
fit: z.string().optional(),
|
33
34
|
}).optional(),
|
34
35
|
});
|
35
36
|
export const ImageSchema = CommonSchema.extend({ type: z.literal(SchemaType.Enum.image) });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/schema.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AACtD,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,UAAU,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAE5C,kBAAkB;AAClB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,CAAU,CAAC;AAC1J,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,q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