@pdfme/schemas 3.1.3 → 3.1.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 (66) hide show
  1. package/dist/cjs/__tests__/text.test.js +47 -25
  2. package/dist/cjs/__tests__/text.test.js.map +1 -1
  3. package/dist/cjs/src/barcodes/constants.js +1 -2
  4. package/dist/cjs/src/barcodes/constants.js.map +1 -1
  5. package/dist/cjs/src/barcodes/propPanel.js +34 -13
  6. package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
  7. package/dist/cjs/src/constants.js +6 -0
  8. package/dist/cjs/src/constants.js.map +1 -0
  9. package/dist/cjs/src/image/propPanel.js +2 -2
  10. package/dist/cjs/src/image/propPanel.js.map +1 -1
  11. package/dist/cjs/src/text/constants.js +2 -2
  12. package/dist/cjs/src/text/constants.js.map +1 -1
  13. package/dist/cjs/src/text/helper.js +8 -7
  14. package/dist/cjs/src/text/helper.js.map +1 -1
  15. package/dist/cjs/src/text/pdfRender.js +14 -11
  16. package/dist/cjs/src/text/pdfRender.js.map +1 -1
  17. package/dist/cjs/src/text/propPanel.js +24 -3
  18. package/dist/cjs/src/text/propPanel.js.map +1 -1
  19. package/dist/cjs/src/text/uiRender.js +72 -42
  20. package/dist/cjs/src/text/uiRender.js.map +1 -1
  21. package/dist/esm/__tests__/text.test.js +47 -25
  22. package/dist/esm/__tests__/text.test.js.map +1 -1
  23. package/dist/esm/src/barcodes/constants.js +0 -1
  24. package/dist/esm/src/barcodes/constants.js.map +1 -1
  25. package/dist/esm/src/barcodes/propPanel.js +24 -3
  26. package/dist/esm/src/barcodes/propPanel.js.map +1 -1
  27. package/dist/esm/src/constants.js +3 -0
  28. package/dist/esm/src/constants.js.map +1 -0
  29. package/dist/esm/src/image/propPanel.js +1 -1
  30. package/dist/esm/src/image/propPanel.js.map +1 -1
  31. package/dist/esm/src/text/constants.js +1 -1
  32. package/dist/esm/src/text/constants.js.map +1 -1
  33. package/dist/esm/src/text/helper.js +8 -7
  34. package/dist/esm/src/text/helper.js.map +1 -1
  35. package/dist/esm/src/text/pdfRender.js +15 -12
  36. package/dist/esm/src/text/pdfRender.js.map +1 -1
  37. package/dist/esm/src/text/propPanel.js +24 -3
  38. package/dist/esm/src/text/propPanel.js.map +1 -1
  39. package/dist/esm/src/text/uiRender.js +73 -43
  40. package/dist/esm/src/text/uiRender.js.map +1 -1
  41. package/dist/types/src/barcodes/constants.d.ts +0 -1
  42. package/dist/types/src/constants.d.ts +2 -0
  43. package/dist/types/src/text/constants.d.ts +1 -1
  44. package/dist/types/src/text/helper.d.ts +4 -3
  45. package/package.json +1 -1
  46. package/src/barcodes/constants.ts +0 -2
  47. package/src/barcodes/propPanel.ts +24 -3
  48. package/src/constants.ts +2 -0
  49. package/src/image/propPanel.ts +1 -1
  50. package/src/text/constants.ts +1 -1
  51. package/src/text/helper.ts +11 -7
  52. package/src/text/pdfRender.ts +31 -13
  53. package/src/text/propPanel.ts +23 -3
  54. package/src/text/uiRender.ts +83 -46
  55. package/dist/cjs/src/image/constants.js +0 -5
  56. package/dist/cjs/src/image/constants.js.map +0 -1
  57. package/dist/cjs/src/image/helper.js +0 -3
  58. package/dist/cjs/src/image/helper.js.map +0 -1
  59. package/dist/esm/src/image/constants.js +0 -2
  60. package/dist/esm/src/image/constants.js.map +0 -1
  61. package/dist/esm/src/image/helper.js +0 -2
  62. package/dist/esm/src/image/helper.js.map +0 -1
  63. package/dist/types/src/image/constants.d.ts +0 -1
  64. package/dist/types/src/image/helper.d.ts +0 -1
  65. package/src/image/constants.ts +0 -1
  66. package/src/image/helper.ts +0 -1
@@ -21,16 +21,19 @@ const hex2rgb = (hex) => {
21
21
  };
22
22
  const hex2RgbColor = (hexString) => {
23
23
  if (hexString) {
24
+ const isValid = (0, common_1.isHexValid)(hexString);
25
+ if (!isValid) {
26
+ throw new Error(`Invalid hex color value ${hexString}`);
27
+ }
24
28
  const [r, g, b] = hex2rgb(hexString);
25
29
  return (0, pdf_lib_1.rgb)(r / 255, g / 255, b / 255);
26
30
  }
27
31
  return undefined;
28
32
  };
29
- const embedAndGetFontObjCache = new WeakMap();
30
33
  const embedAndGetFontObj = async (arg) => {
31
- const { pdfDoc, font } = arg;
32
- if (embedAndGetFontObjCache.has(pdfDoc)) {
33
- return embedAndGetFontObjCache.get(pdfDoc);
34
+ const { pdfDoc, font, _cache } = arg;
35
+ if (_cache.has(pdfDoc)) {
36
+ return _cache.get(pdfDoc);
34
37
  }
35
38
  const fontValues = await Promise.all(Object.values(font).map(async (v) => {
36
39
  let fontData = v.data;
@@ -42,12 +45,12 @@ const embedAndGetFontObj = async (arg) => {
42
45
  });
43
46
  }));
44
47
  const fontObj = Object.keys(font).reduce((acc, cur, i) => Object.assign(acc, { [cur]: fontValues[i] }), {});
45
- embedAndGetFontObjCache.set(pdfDoc, fontObj);
48
+ _cache.set(pdfDoc, fontObj);
46
49
  return fontObj;
47
50
  };
48
- const getFontProp = async ({ value, font, schema, }) => {
51
+ const getFontProp = async ({ value, font, schema, _cache, }) => {
49
52
  const fontSize = schema.dynamicFontSize
50
- ? await (0, helper_js_1.calculateDynamicFontSize)({ textSchema: schema, font, value })
53
+ ? await (0, helper_js_1.calculateDynamicFontSize)({ textSchema: schema, font, value, _cache })
51
54
  : schema.fontSize ?? constants_js_1.DEFAULT_FONT_SIZE;
52
55
  const color = hex2RgbColor(schema.fontColor || constants_js_1.DEFAULT_FONT_COLOR);
53
56
  return {
@@ -60,12 +63,12 @@ const getFontProp = async ({ value, font, schema, }) => {
60
63
  };
61
64
  };
62
65
  const pdfRender = async (arg) => {
63
- const { value, pdfDoc, pdfLib, page, options, schema } = arg;
66
+ const { value, pdfDoc, pdfLib, page, options, schema, _cache } = arg;
64
67
  const { font = (0, common_1.getDefaultFont)() } = options;
65
68
  const [pdfFontObj, fontKitFont, fontProp] = await Promise.all([
66
- embedAndGetFontObj({ pdfDoc, font }),
67
- (0, helper_js_1.getFontKitFont)(schema, font),
68
- getFontProp({ value, font, schema }),
69
+ embedAndGetFontObj({ pdfDoc, font, _cache }),
70
+ (0, helper_js_1.getFontKitFont)(schema, font, _cache),
71
+ getFontProp({ value, font, schema, _cache }),
69
72
  ]);
70
73
  const { fontSize, color, alignment, verticalAlignment, lineHeight, characterSpacing } = fontProp;
71
74
  const fontName = (schema.fontName ? schema.fontName : (0, common_1.getFallbackFontName)(font));
@@ -1 +1 @@
1
- {"version":3,"file":"pdfRender.js","sourceRoot":"","sources":["../../../../src/text/pdfRender.ts"],"names":[],"mappings":";;;AAAA,4CAA2D;AAC3D,0CAAiG;AAEjG,iDAUwB;AACxB,2CAOqB;AACrB,sDAA0E;AAE1E,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9B,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG;QAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChD,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAClB,GAAG;YACD,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,C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AC,CAAC,CAAC;SACxB;QAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YAClB,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,KAAK;YACR,MAAM;YACN,IAAI,EAAE,QAAQ;YACd,KAAK;YACL,UAAU,EAAE,UAAU,GAAG,QAAQ;YACjC,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE,CAAC,EAAE,CAAC;YAChB,OAAO;SACR,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArGW,QAAA,SAAS,aAqGpB"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.propPanel = void 0;
4
4
  const common_1 = require("@pdfme/common");
5
5
  const constants_js_1 = require("./constants.js");
6
+ const constants_js_2 = require("../constants.js");
6
7
  const UseDynamicFontSize = (props) => {
7
8
  const { rootElement, changeSchemas, activeSchema, i18n } = props;
8
9
  const checkbox = document.createElement('input');
@@ -119,8 +120,28 @@ exports.propPanel = {
119
120
  },
120
121
  },
121
122
  },
122
- fontColor: { title: i18n('schemas.textColor'), type: 'string', widget: 'color' },
123
- backgroundColor: { title: i18n('schemas.bgColor'), type: 'string', widget: 'color' },
123
+ fontColor: {
124
+ title: i18n('schemas.textColor'),
125
+ type: 'string',
126
+ widget: 'color',
127
+ rules: [
128
+ {
129
+ pattern: constants_js_2.HEX_COLOR_PATTERN,
130
+ message: 'Please enter a valid hex color code.',
131
+ },
132
+ ],
133
+ },
134
+ backgroundColor: {
135
+ title: i18n('schemas.bgColor'),
136
+ type: 'string',
137
+ widget: 'color',
138
+ rules: [
139
+ {
140
+ pattern: constants_js_2.HEX_COLOR_PATTERN,
141
+ message: 'Please enter a valid hex color code.',
142
+ },
143
+ ],
144
+ },
124
145
  };
125
146
  return textSchema;
126
147
  },
@@ -143,7 +164,7 @@ exports.propPanel = {
143
164
  fontColor: constants_js_1.DEFAULT_FONT_COLOR,
144
165
  fontName: undefined,
145
166
  backgroundColor: '',
146
- opacity: constants_js_1.DEFAULT_OPACITY,
167
+ opacity: constants_js_2.DEFAULT_OPACITY,
147
168
  },
148
169
  };
149
170
  //# sourceMappingURL=propPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/text/propPanel.ts"],"names":[],"mappings":";;;AAAA,0CAMuB;AAEvB,iDAkBwB;AAExB,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,GAAG,OAAO,CAAE,YAAoB,EAAE,eAAe,CAAC,CAAC;IACnE,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAM,EAAE,EAAE;QAC7B,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO;YAC1B,CAAC,CAAC;gBACE,GAAG,EAAE,4CAA6B;gBAClC,GAAG,EAAE,4CAA6B;gBAClC,GAAG,EAAE,kCAAmB;aACzB;YACH,CAAC,CAAC,SAAS,CAAC;QACd,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC,CAAC;IACF,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,EAAE,CAAC;IAC7D,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,6BAA6B,CAAC;IACpD,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;I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AAE,IAAI,CAAC,iBAAiB,CAAC;gBAC9B,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE;oBACL;wBACE,OAAO,EAAE,gCAAiB;wBAC1B,OAAO,EAAE,sCAAsC;qBAChD;iBACF;aACF;SACF,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,EAAE,EAAE,kBAAkB,EAAE;IAC/B,YAAY,EAAE,mBAAmB;IACjC,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QACxB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,uGAAuG;QACvG,4GAA4G;QAC5G,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,gCAAiB;QAC5B,iBAAiB,EAAE,yCAA0B;QAC7C,QAAQ,EAAE,gCAAiB;QAC3B,UAAU,EAAE,kCAAmB;QAC/B,gBAAgB,EAAE,wCAAyB;QAC3C,eAAe,EAAE,SAAS;QAC1B,SAAS,EAAE,iCAAkB;QAC7B,QAAQ,EAAE,SAAS;QACnB,eAAe,EAAE,EAAE;QACnB,OAAO,EAAE,8BAAe;KACzB;CACF,CAAC"}
@@ -5,6 +5,7 @@ const common_1 = require("@pdfme/common");
5
5
  const constants_js_1 = require("./constants.js");
6
6
  const helper_js_1 = require("./helper.js");
7
7
  const renderUtils_js_1 = require("../renderUtils.js");
8
+ const constants_js_2 = require("../constants.js");
8
9
  const mapVerticalAlignToFlex = (verticalAlignmentValue) => {
9
10
  switch (verticalAlignmentValue) {
10
11
  case constants_js_1.VERTICAL_ALIGN_TOP:
@@ -28,23 +29,25 @@ const getBackgroundColor = (mode, value, schema, defaultBackgroundColor) => {
28
29
  }
29
30
  };
30
31
  const uiRender = async (arg) => {
31
- const { value, schema, rootElement, mode, onChange, stopEditing, tabIndex, placeholder, options, theme, } = arg;
32
+ const { value, schema, rootElement, mode, onChange, stopEditing, tabIndex, placeholder, options, theme, _cache, } = arg;
32
33
  const font = options?.font || (0, common_1.getDefaultFont)();
33
34
  let dynamicFontSize = undefined;
35
+ const getCdfArg = (v) => ({
36
+ textSchema: schema,
37
+ font,
38
+ value: v,
39
+ startingFontSize: dynamicFontSize,
40
+ _cache,
41
+ });
34
42
  if (schema.dynamicFontSize && value) {
35
- dynamicFontSize = await (0, helper_js_1.calculateDynamicFontSize)({
36
- textSchema: schema,
37
- font,
38
- value,
39
- startingFontSize: dynamicFontSize,
40
- });
43
+ dynamicFontSize = await (0, helper_js_1.calculateDynamicFontSize)(getCdfArg(value));
41
44
  }
42
- const fontKitFont = await (0, helper_js_1.getFontKitFont)(schema, font);
45
+ const fontKitFont = await (0, helper_js_1.getFontKitFont)(schema, font, _cache);
43
46
  // Depending on vertical alignment, we need to move the top or bottom of the font to keep
44
47
  // it within it's defined box and align it with the generated pdf.
45
48
  const { topAdj, bottomAdj } = (0, helper_js_1.getBrowserVerticalFontAdjustments)(fontKitFont, dynamicFontSize ?? schema.fontSize ?? constants_js_1.DEFAULT_FONT_SIZE, schema.lineHeight ?? constants_js_1.DEFAULT_LINE_HEIGHT, schema.verticalAlignment ?? constants_js_1.DEFAULT_VERTICAL_ALIGNMENT);
46
- const topAdjustment = topAdj;
47
- const bottomAdjustment = bottomAdj;
49
+ const topAdjustment = topAdj.toString();
50
+ const bottomAdjustment = bottomAdj.toString();
48
51
  const container = document.createElement('div');
49
52
  const containerStyle = {
50
53
  padding: 0,
@@ -56,12 +59,13 @@ const uiRender = async (arg) => {
56
59
  justifyContent: mapVerticalAlignToFlex(schema.verticalAlignment),
57
60
  width: '100%',
58
61
  height: '100%',
59
- opacity: schema.opacity,
62
+ opacity: schema.opacity ?? constants_js_2.DEFAULT_OPACITY,
60
63
  };
61
64
  Object.assign(container.style, containerStyle);
62
65
  rootElement.innerHTML = '';
63
66
  rootElement.appendChild(container);
64
- const fontStyles = {
67
+ const textBlockStyle = {
68
+ // Font formatting styles
65
69
  fontFamily: schema.fontName ? `'${schema.fontName}'` : 'inherit',
66
70
  color: schema.fontColor ? schema.fontColor : constants_js_1.DEFAULT_FONT_COLOR,
67
71
  fontSize: `${dynamicFontSize ?? schema.fontSize ?? constants_js_1.DEFAULT_FONT_SIZE}pt`,
@@ -70,45 +74,71 @@ const uiRender = async (arg) => {
70
74
  textAlign: schema.alignment ?? constants_js_1.DEFAULT_ALIGNMENT,
71
75
  whiteSpace: 'pre-wrap',
72
76
  wordBreak: 'break-word',
77
+ // Block layout styles
78
+ resize: 'none',
79
+ border: 'none',
80
+ outline: 'none',
81
+ marginBottom: bottomAdjustment + 'px',
82
+ paddingTop: topAdjustment + 'px',
83
+ backgroundColor: 'transparent',
73
84
  };
85
+ const textBlock = document.createElement('div');
86
+ Object.assign(textBlock.style, textBlockStyle);
74
87
  if (mode === 'form' || mode === 'designer') {
75
- const textarea = document.createElement('textarea');
76
- const textareaStyle = {
77
- padding: 0,
78
- resize: 'none',
79
- border: 'none',
80
- outline: 'none',
81
- paddingTop: topAdjustment + 'px',
82
- backgroundColor: 'transparent',
83
- width: '100%',
84
- height: '100%',
85
- };
86
- Object.assign(textarea.style, textareaStyle, fontStyles);
87
- textarea.rows = 1;
88
- textarea.placeholder = placeholder || '';
89
- textarea.tabIndex = tabIndex || 0;
90
- textarea.addEventListener('change', (e) => onChange && onChange(e.target.value));
91
- textarea.addEventListener('blur', () => stopEditing && stopEditing());
92
- textarea.value = value;
93
- container.appendChild(textarea);
88
+ textBlock.contentEditable = 'plaintext-only';
89
+ textBlock.tabIndex = tabIndex || 0;
90
+ textBlock.innerText = value;
91
+ textBlock.addEventListener('blur', (e) => {
92
+ onChange && onChange(e.target.innerText);
93
+ stopEditing && stopEditing();
94
+ });
95
+ if (schema.dynamicFontSize) {
96
+ textBlock.addEventListener('keyup', () => {
97
+ setTimeout(() => {
98
+ void (async () => {
99
+ if (!textBlock.textContent)
100
+ return;
101
+ dynamicFontSize = await (0, helper_js_1.calculateDynamicFontSize)(getCdfArg(textBlock.textContent));
102
+ textBlock.style.fontSize = `${dynamicFontSize}pt`;
103
+ const { topAdj: newTopAdj, bottomAdj: newBottomAdj } = (0, helper_js_1.getBrowserVerticalFontAdjustments)(fontKitFont, dynamicFontSize ?? schema.fontSize ?? constants_js_1.DEFAULT_FONT_SIZE, schema.lineHeight ?? constants_js_1.DEFAULT_LINE_HEIGHT, schema.verticalAlignment ?? constants_js_1.DEFAULT_VERTICAL_ALIGNMENT);
104
+ textBlock.style.paddingTop = newTopAdj.toString() + 'px';
105
+ textBlock.style.marginBottom = newBottomAdj.toString() + 'px';
106
+ })();
107
+ }, 0);
108
+ });
109
+ }
110
+ if (placeholder && !value) {
111
+ textBlock.innerText = placeholder;
112
+ textBlock.style.color = constants_js_1.PLACEHOLDER_FONT_COLOR;
113
+ if (schema.dynamicFontSize) {
114
+ const fontSize = await (0, helper_js_1.calculateDynamicFontSize)(getCdfArg(placeholder));
115
+ textBlock.style.fontSize = `${fontSize}pt`;
116
+ }
117
+ textBlock.addEventListener('focus', () => {
118
+ if (textBlock.innerText === placeholder) {
119
+ textBlock.innerText = '';
120
+ textBlock.style.color = schema.fontColor ?? constants_js_1.DEFAULT_FONT_COLOR;
121
+ }
122
+ });
123
+ }
124
+ container.appendChild(textBlock);
94
125
  if (mode === 'designer') {
95
- textarea.setSelectionRange(value.length, value.length);
96
- textarea.focus();
126
+ textBlock.focus();
127
+ // Set the focus to the end of the editable element when you focus, as we would for a textarea
128
+ const selection = window.getSelection();
129
+ const range = document.createRange();
130
+ range.selectNodeContents(textBlock);
131
+ range.collapse(false); // Collapse range to the end
132
+ selection?.removeAllRanges();
133
+ selection?.addRange(range);
97
134
  }
98
135
  }
99
136
  else {
100
- const div = document.createElement('div');
101
- const divStyle = {
102
- ...fontStyles,
103
- marginBottom: bottomAdjustment + 'px',
104
- paddingTop: topAdjustment + 'px',
105
- };
106
- Object.assign(div.style, divStyle);
107
- div.innerHTML = value
137
+ textBlock.innerHTML = value
108
138
  .split('')
109
139
  .map((l, i) => `<span style="letter-spacing:${String(value).length === i + 1 ? 0 : 'inherit'};">${l}</span>`)
110
140
  .join('');
111
- container.appendChild(div);
141
+ container.appendChild(textBlock);
112
142
  }
113
143
  };
114
144
  exports.uiRender = uiRender;
@@ -1 +1 @@
1
- {"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":";;;AACA,0CAAsE;AAEtE,iDAWwB;AACxB,2CAIqB;AACrB,sDAAkD;AAElD,MAAM,sBAAsB,GAAG,CAAC,sBAA0C,EAAE,EAAE;IAC5E,QAAQ,sBAAsB,EAAE;QAC9B,KAAK,iCAAkB;YACrB,OAAO,YAAY,CAAC;QACtB,KAAK,oCAAqB;YACxB,OAAO,QAAQ,CAAC;QAClB,KAAK,oCAAqB;YACxB,OAAO,UAAU,CAAC;KACrB;IACD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,IAAoC,EACpC,KAAa,EACb,MAAc,EACd,sBAA8B,EAC9B,EAAE;IACF,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,UAAU,CAAC,IAAI,KAAK,IAAI,MAAM,CAAC,eAAe,EAAE;QAC/E,OAAO,MAAM,CAAC,eAAyB,CAAC;KACzC;SAAM,IAAI,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAQ,MAAM,CAAC,eAA0B,IAAI,aAAa,CAAC;KAC5D;SAAM;QACL,OAAO,sBAAsB,CAAC;KAC/B;AACH,CAAC,CAAC;AAEK,MAAM,QAAQ,GAAG,KAAK,EAAE,GAA8B,EAAE,EAAE;IAC/D,MAAM,EACJ,KAAK,EACL,MAAM,EACN,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,WAAW,EACX,OAAO,EACP,KAAK,GACN,GAAG,GAAG,CAAC;IACR,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI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,CAAC;AA5JW,QAAA,QAAQ,YA4JnB"}
@@ -81,29 +81,33 @@ describe('getSplittedLines test with real font width calculations', () => {
81
81
  characterSpacing: 1,
82
82
  boxWidthInPt: 40,
83
83
  };
84
- it('should not split a line when the text is shorter than the width', () => {
85
- getFontKitFont(getTextSchema(), font).then((fontKitFont) => {
84
+ it('should not split a line when the text is shorter than the width', async () => {
85
+ const _cache = new Map();
86
+ await getFontKitFont(getTextSchema(), font, _cache).then((fontKitFont) => {
86
87
  const fontWidthCalcs = Object.assign({}, baseCalcValues, { font: fontKitFont });
87
88
  const result = getSplittedLines('short', fontWidthCalcs);
88
89
  expect(result).toEqual(['short']);
89
90
  });
90
91
  });
91
- it('should split a line when the text is longer than the width', () => {
92
- getFontKitFont(getTextSchema(), font).then((fontKitFont) => {
92
+ it('should split a line when the text is longer than the width', async () => {
93
+ const _cache = new Map();
94
+ await getFontKitFont(getTextSchema(), font, _cache).then((fontKitFont) => {
93
95
  const fontWidthCalcs = Object.assign({}, baseCalcValues, { font: fontKitFont });
94
96
  const result = getSplittedLines('this will wrap', fontWidthCalcs);
95
97
  expect(result).toEqual(['this', 'will', 'wrap']);
96
98
  });
97
99
  });
98
- it('should split a line in the middle when unspaced text will not fit on a line', () => {
99
- getFontKitFont(getTextSchema(), font).then((fontKitFont) => {
100
+ it('should split a line in the middle when unspaced text will not fit on a line', async () => {
101
+ const _cache = new Map();
102
+ await getFontKitFont(getTextSchema(), font, _cache).then((fontKitFont) => {
100
103
  const fontWidthCalcs = Object.assign({}, baseCalcValues, { font: fontKitFont });
101
104
  const result = getSplittedLines('thiswillbecut', fontWidthCalcs);
102
105
  expect(result).toEqual(['thiswi', 'llbecu', 't']);
103
106
  });
104
107
  });
105
- it('should not split text when it is impossible due to size constraints', () => {
106
- getFontKitFont(getTextSchema(), font).then((fontKitFont) => {
108
+ it('should not split text when it is impossible due to size constraints', async () => {
109
+ const _cache = new Map();
110
+ await getFontKitFont(getTextSchema(), font, _cache).then((fontKitFont) => {
107
111
  const fontWidthCalcs = Object.assign({}, baseCalcValues, { font: fontKitFont });
108
112
  fontWidthCalcs.boxWidthInPt = 2;
109
113
  const result = getSplittedLines('thiswillnotbecut', fontWidthCalcs);
@@ -113,29 +117,30 @@ describe('getSplittedLines test with real font width calculations', () => {
113
117
  });
114
118
  describe('calculateDynamicFontSize with Default font', () => {
115
119
  const font = getDefaultFont();
120
+ const _cache = new Map();
116
121
  it('should return default font size when dynamicFontSizeSetting is not provided', async () => {
117
122
  const textSchema = getTextSchema();
118
- const result = await calculateDynamicFontSize({ textSchema, font, value: 'test' });
123
+ const result = await calculateDynamicFontSize({ textSchema, font, value: 'test', _cache });
119
124
  expect(result).toBe(14);
120
125
  });
121
126
  it('should return default font size when dynamicFontSizeSetting max is less than min', async () => {
122
127
  const textSchema = getTextSchema();
123
128
  textSchema.dynamicFontSize = { min: 11, max: 10, fit: 'vertical' };
124
- const result = await calculateDynamicFontSize({ textSchema, font, value: 'test' });
129
+ const result = await calculateDynamicFontSize({ textSchema, font, value: 'test', _cache });
125
130
  expect(result).toBe(14);
126
131
  });
127
132
  it('should calculate a dynamic font size of vertical fit between min and max', async () => {
128
133
  const textSchema = getTextSchema();
129
134
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
130
135
  const value = 'test with a length string\n and a new line';
131
- const result = await calculateDynamicFontSize({ textSchema, font, value });
136
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
132
137
  expect(result).toBe(19.25);
133
138
  });
134
139
  it('should calculate a dynamic font size of horizontal fit between min and max', async () => {
135
140
  const textSchema = getTextSchema();
136
141
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'horizontal' };
137
142
  const value = 'test with a length string\n and a new line';
138
- const result = await calculateDynamicFontSize({ textSchema, font, value });
143
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
139
144
  expect(result).toBe(11.25);
140
145
  });
141
146
  it('should calculate a dynamic font size between min and max regardless of current font size', async () => {
@@ -143,10 +148,10 @@ describe('calculateDynamicFontSize with Default font', () => {
143
148
  textSchema.fontSize = 2;
144
149
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
145
150
  const value = 'test with a length string\n and a new line';
146
- let result = await calculateDynamicFontSize({ textSchema, font, value });
151
+ let result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
147
152
  expect(result).toBe(19.25);
148
153
  textSchema.fontSize = 40;
149
- result = await calculateDynamicFontSize({ textSchema, font, value });
154
+ result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
150
155
  expect(result).toBe(19.25);
151
156
  });
152
157
  it('should return min font size when content is too big to fit given constraints', async () => {
@@ -154,7 +159,7 @@ describe('calculateDynamicFontSize with Default font', () => {
154
159
  textSchema.width = 10;
155
160
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
156
161
  const value = 'test with a length string\n and a new line';
157
- const result = await calculateDynamicFontSize({ textSchema, font, value });
162
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
158
163
  expect(result).toBe(10);
159
164
  });
160
165
  it('should return max font size when content is too small to fit given constraints', async () => {
@@ -163,7 +168,7 @@ describe('calculateDynamicFontSize with Default font', () => {
163
168
  textSchema.height = 200;
164
169
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
165
170
  const value = 'test with a length string\n and a new line';
166
- const result = await calculateDynamicFontSize({ textSchema, font, value });
171
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
167
172
  expect(result).toBe(30);
168
173
  });
169
174
  it('should not reduce font size below 0', async () => {
@@ -172,7 +177,7 @@ describe('calculateDynamicFontSize with Default font', () => {
172
177
  textSchema.width = 4;
173
178
  textSchema.height = 1;
174
179
  const value = 'a very \nlong \nmulti-line \nstring\nto';
175
- const result = await calculateDynamicFontSize({ textSchema, font, value });
180
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
176
181
  expect(result).toBeGreaterThan(0);
177
182
  });
178
183
  it('should calculate a dynamic font size when a starting font size is passed that is lower than the eventual', async () => {
@@ -180,7 +185,13 @@ describe('calculateDynamicFontSize with Default font', () => {
180
185
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
181
186
  const value = 'test with a length string\n and a new line';
182
187
  const startingFontSize = 18;
183
- const result = await calculateDynamicFontSize({ textSchema, font, value, startingFontSize });
188
+ const result = await calculateDynamicFontSize({
189
+ textSchema,
190
+ font,
191
+ value,
192
+ startingFontSize,
193
+ _cache,
194
+ });
184
195
  expect(result).toBe(19.25);
185
196
  });
186
197
  it('should calculate a dynamic font size when a starting font size is passed that is higher than the eventual', async () => {
@@ -188,14 +199,20 @@ describe('calculateDynamicFontSize with Default font', () => {
188
199
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'horizontal' };
189
200
  const value = 'test with a length string\n and a new line';
190
201
  const startingFontSize = 36;
191
- const result = await calculateDynamicFontSize({ textSchema, font, value, startingFontSize });
202
+ const result = await calculateDynamicFontSize({
203
+ textSchema,
204
+ font,
205
+ value,
206
+ startingFontSize,
207
+ _cache,
208
+ });
192
209
  expect(result).toBe(11.25);
193
210
  });
194
211
  it('should calculate a dynamic font size using vertical fit as a default if no fit provided', async () => {
195
212
  const textSchema = getTextSchema();
196
213
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
197
214
  const value = 'test with a length string\n and a new line';
198
- const result = await calculateDynamicFontSize({ textSchema, font, value });
215
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
199
216
  expect(result).toBe(19.25);
200
217
  });
201
218
  });
@@ -203,37 +220,42 @@ describe('calculateDynamicFontSize with Custom font', () => {
203
220
  const font = getSampleFont();
204
221
  it('should return smaller font size when dynamicFontSizeSetting is provided with horizontal fit', async () => {
205
222
  const textSchema = getTextSchema();
223
+ const _cache = new Map();
206
224
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'horizontal' };
207
225
  const value = 'あいうあいうあい';
208
- const result = await calculateDynamicFontSize({ textSchema, font, value });
226
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
209
227
  expect(result).toBe(16.75);
210
228
  });
211
229
  it('should return smaller font size when dynamicFontSizeSetting is provided with vertical fit', async () => {
212
230
  const textSchema = getTextSchema();
231
+ const _cache = new Map();
213
232
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
214
233
  const value = 'あいうあいうあい';
215
- const result = await calculateDynamicFontSize({ textSchema, font, value });
234
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
216
235
  expect(result).toBe(26);
217
236
  });
218
237
  it('should return min font size when content is too big to fit given constraints', async () => {
219
238
  const textSchema = getTextSchema();
239
+ const _cache = new Map();
220
240
  textSchema.dynamicFontSize = { min: 20, max: 30, fit: 'vertical' };
221
241
  const value = 'あいうあいうあいうあいうあいうあいうあいうあいうあいう';
222
- const result = await calculateDynamicFontSize({ textSchema, font, value });
242
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
223
243
  expect(result).toBe(20);
224
244
  });
225
245
  it('should return max font size when content is too small to fit given constraints', async () => {
226
246
  const textSchema = getTextSchema();
247
+ const _cache = new Map();
227
248
  textSchema.dynamicFontSize = { min: 10, max: 30, fit: 'vertical' };
228
249
  const value = 'あ';
229
- const result = await calculateDynamicFontSize({ textSchema, font, value });
250
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
230
251
  expect(result).toBe(30);
231
252
  });
232
253
  it('should return min font size when content is multi-line with too many lines for the container', async () => {
233
254
  const textSchema = getTextSchema();
255
+ const _cache = new Map();
234
256
  textSchema.dynamicFontSize = { min: 5, max: 20, fit: 'vertical' };
235
257
  const value = 'あ\nいう\nあ\nいう\nあ\nいう\nあ\nいう\nあ\nいう\nあ\nいう';
236
- const result = await calculateDynamicFontSize({ textSchema, font, value });
258
+ const result = await calculateDynamicFontSize({ textSchema, font, value, _cache });
237
259
  expect(result).toBe(5);
238
260
  });
239
261
  });
@@ -1 +1 @@
1
- {"version":3,"file":"text.test.js","sourceRoot":"","sources":["../../../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AO,CAAC;YAC1E,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,kBAAkB;SAC9B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iFAAiF,EAAE,GAAG,EAAE;QAC3F,MAAM,CAAC,iCAAiC,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;YAC1E,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,CAAC;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iFAAiF,EAAE,GAAG,EAAE;QAC3F,MAAM,QAAQ,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAiB,CAAC;QAChF,MAAM,CAAC,iCAAiC,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;YAC7E,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,CAAC;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -13,5 +13,4 @@ export const BARCODE_TYPES = [
13
13
  ];
14
14
  export const DEFAULT_BARCODE_BG_COLOR = '#ffffff';
15
15
  export const DEFAULT_BARCODE_COLOR = '#000000';
16
- export const DEFAULT_OPACITY = 1;
17
16
  //# sourceMappingURL=constants.js.map