@pdfme/schemas 3.4.1 → 3.4.2-dev.1
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 +10 -4
- package/dist/cjs/__tests__/text.test.js.map +1 -1
- package/dist/cjs/src/text/helper.js +27 -7
- package/dist/cjs/src/text/helper.js.map +1 -1
- package/dist/cjs/src/text/uiRender.js +22 -1
- package/dist/cjs/src/text/uiRender.js.map +1 -1
- package/dist/esm/__tests__/text.test.js +10 -4
- package/dist/esm/__tests__/text.test.js.map +1 -1
- package/dist/esm/src/text/helper.js +25 -6
- package/dist/esm/src/text/helper.js.map +1 -1
- package/dist/esm/src/text/uiRender.js +23 -2
- package/dist/esm/src/text/uiRender.js.map +1 -1
- package/dist/types/src/text/helper.d.ts +1 -0
- package/package.json +1 -1
- package/src/text/helper.ts +28 -6
- package/src/text/uiRender.ts +22 -1
@@ -80,19 +80,25 @@ describe('getSplitPosition test with mocked font width calculations', () => {
|
|
80
80
|
expect((0, helper_1.getSplittedLines)('a', mockCalcValues)).toEqual(['a']);
|
81
81
|
expect((0, helper_1.getSplittedLines)('aaaa', mockCalcValues)).toEqual(['aaaa']);
|
82
82
|
});
|
83
|
-
it('splits a line to the nearest previous
|
83
|
+
it('splits a line to the nearest previous breakable char', () => {
|
84
84
|
expect((0, helper_1.getSplittedLines)('aaa bbb', mockCalcValues)).toEqual(['aaa', 'bbb']);
|
85
|
+
expect((0, helper_1.getSplittedLines)('top-hat', mockCalcValues)).toEqual(['top-', 'hat']);
|
86
|
+
expect((0, helper_1.getSplittedLines)('top—hat', mockCalcValues)).toEqual(['top—', 'hat']); // em dash
|
87
|
+
expect((0, helper_1.getSplittedLines)('top–hat', mockCalcValues)).toEqual(['top–', 'hat']); // en dash
|
85
88
|
});
|
86
|
-
it('splits a line where the split point is on a
|
89
|
+
it('splits a line where the split point is on a breakable char', () => {
|
87
90
|
expect((0, helper_1.getSplittedLines)('aaaaa bbbbb', mockCalcValues)).toEqual(['aaaaa', 'bbbbb']);
|
91
|
+
expect((0, helper_1.getSplittedLines)('left-hand', mockCalcValues)).toEqual(['left-', 'hand']);
|
88
92
|
});
|
89
93
|
it('splits a long line in the middle of a word if too long', () => {
|
90
94
|
expect((0, helper_1.getSplittedLines)('aaaaaa bbb', mockCalcValues)).toEqual(['aaaaa', 'a bbb']);
|
95
|
+
expect((0, helper_1.getSplittedLines)('aaaaaa-a b', mockCalcValues)).toEqual(['aaaaa', 'a-a b']);
|
96
|
+
expect((0, helper_1.getSplittedLines)('aaaaa-aa b', mockCalcValues)).toEqual(['aaaaa', '-aa b']);
|
91
97
|
});
|
92
|
-
it('splits a long line without
|
98
|
+
it('splits a long line without breakable chars at exactly 5 chars', () => {
|
93
99
|
expect((0, helper_1.getSplittedLines)('abcdef', mockCalcValues)).toEqual(['abcde', 'f']);
|
94
100
|
});
|
95
|
-
it('splits a very long line without
|
101
|
+
it('splits a very long line without breakable chars at exactly 5 chars', () => {
|
96
102
|
expect((0, helper_1.getSplittedLines)('abcdefghijklmn', mockCalcValues)).toEqual(['abcde', 'fghij', 'klmn']);
|
97
103
|
});
|
98
104
|
it('splits a line with lots of words', () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.test.js","sourceRoot":"","sources":["../../../__tests__/text.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAkC;AAClC,2CAA6B;AAE7B,0CAAqD;AACrD,+CAM4B;AAG5B,MAAM,QAAQ,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC,CAAC;AACxF,MAAM,SAAS,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG,GAAS,EAAE,CAAC,CAAC;IACjC,cAAc,EAAE,EAAE,QAAQ,EAAE,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Q,CAAC,CAAC,CAAC,OAAO,CAAC;YACzE,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,QAAQ;SACpB,CAAC,CAAC;QACH,MAAM,CAAC,IAAA,0CAAiC,EAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,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,IAAA,0CAAiC,EAAC,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,IAAA,0CAAiC,EAAC,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"}
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.calculateDynamicFontSize = exports.getSplittedLines = exports.getFontKitFont = exports.widthOfTextAtSize = exports.heightOfFontAtSize = exports.getFontDescentInPt = exports.getBrowserVerticalFontAdjustments = void 0;
|
26
|
+
exports.isFirefox = exports.calculateDynamicFontSize = exports.getSplittedLines = exports.getFontKitFont = exports.widthOfTextAtSize = exports.heightOfFontAtSize = exports.getFontDescentInPt = exports.getBrowserVerticalFontAdjustments = void 0;
|
27
27
|
const fontkit = __importStar(require("fontkit"));
|
28
28
|
const common_1 = require("@pdfme/common");
|
29
29
|
const buffer_1 = require("buffer");
|
@@ -125,20 +125,38 @@ const getOverPosition = (textLine, calcValues) => {
|
|
125
125
|
}
|
126
126
|
return null;
|
127
127
|
};
|
128
|
+
/**
|
129
|
+
* Line breakable chars depend on the language and writing system.
|
130
|
+
* Western writing systems typically use spaces and hyphens as line breakable chars.
|
131
|
+
* Other writing systems often break on word boundaries so the following
|
132
|
+
* does not negatively impact them.
|
133
|
+
* However, this might need to be revisited for broader language support.
|
134
|
+
*/
|
135
|
+
const isLineBreakableChar = (char) => {
|
136
|
+
const lineBreakableChars = [' ', '-', "\u2014", "\u2013"];
|
137
|
+
return lineBreakableChars.includes(char);
|
138
|
+
};
|
128
139
|
/**
|
129
140
|
* Gets the position of the split. Splits the exceeding line at
|
130
|
-
* the last
|
141
|
+
* the last breakable char prior to it exceeding the bounding box width.
|
131
142
|
*/
|
132
143
|
const getSplitPosition = (textLine, calcValues) => {
|
133
144
|
const overPos = getOverPosition(textLine, calcValues);
|
134
145
|
if (overPos === null)
|
135
146
|
return textLine.length; // input line is shorter than the available space
|
136
|
-
|
137
|
-
|
147
|
+
if (textLine[overPos] === ' ') {
|
148
|
+
// if the character immediately beyond the boundary is a space, split
|
149
|
+
return overPos;
|
150
|
+
}
|
151
|
+
let overPosTmp = overPos - 1;
|
152
|
+
while (overPosTmp >= 0) {
|
153
|
+
if (isLineBreakableChar(textLine[overPosTmp])) {
|
154
|
+
return overPosTmp + 1;
|
155
|
+
}
|
138
156
|
overPosTmp--;
|
139
157
|
}
|
140
|
-
// For very long lines with no
|
141
|
-
return
|
158
|
+
// For very long lines with no breakable chars use the original overPos
|
159
|
+
return overPos;
|
142
160
|
};
|
143
161
|
/**
|
144
162
|
* Recursively splits the line at getSplitPosition.
|
@@ -146,7 +164,7 @@ const getSplitPosition = (textLine, calcValues) => {
|
|
146
164
|
*/
|
147
165
|
const getSplittedLines = (textLine, calcValues) => {
|
148
166
|
const splitPos = getSplitPosition(textLine, calcValues);
|
149
|
-
const splittedLine = textLine.substring(0, splitPos);
|
167
|
+
const splittedLine = textLine.substring(0, splitPos).trimEnd();
|
150
168
|
const rest = textLine.substring(splitPos).trimStart();
|
151
169
|
if (rest === textLine) {
|
152
170
|
// if we went so small that we want to split on the first char
|
@@ -258,4 +276,6 @@ const calculateDynamicFontSize = async ({ textSchema, font, value, startingFontS
|
|
258
276
|
return dynamicFontSize;
|
259
277
|
};
|
260
278
|
exports.calculateDynamicFontSize = calculateDynamicFontSize;
|
279
|
+
const isFirefox = () => navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
280
|
+
exports.isFirefox = isFirefox;
|
261
281
|
//# sourceMappingURL=helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/text/helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,0CASuB;AACvB,mCAAgC;AAEhC,iDASwB;AAEjB,MAAM,iCAAiC,GAAG,CAC/C,WAAwB,EACxB,QAAgB,EAChB,UAAkB,EAClB,iBAAyB,EACzB,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;IAEpD,8FAA8F;IAC9F,MAAM,kBAAkB,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,UAAU,CAAC;IAE3D,6BAA6B;IAC7B,6FAA6F;IAC7F,wDAAwD;IACxD,+FAA+F;IAC/F,qFAAqF;IACrF,MAAM,aAAa,GAAG,CAAC,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAErE,IAAI,iBAAiB,KAAK,iCAAkB,EAAE;QAC5C,OAAO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ender = async (arg) => {
|
|
79
79
|
const textBlock = document.createElement('div');
|
80
80
|
Object.assign(textBlock.style, textBlockStyle);
|
81
81
|
if ((0, utils_js_1.isEditable)(mode, schema)) {
|
82
|
-
|
82
|
+
if (!(0, helper_js_1.isFirefox)()) {
|
83
|
+
textBlock.contentEditable = 'plaintext-only';
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
textBlock.contentEditable = 'true';
|
87
|
+
textBlock.addEventListener('keydown', (e) => {
|
88
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
89
|
+
e.preventDefault();
|
90
|
+
document.execCommand('insertLineBreak', false, undefined);
|
91
|
+
}
|
92
|
+
});
|
93
|
+
textBlock.addEventListener('paste', (e) => {
|
94
|
+
e.preventDefault();
|
95
|
+
const paste = e.clipboardData?.getData('text');
|
96
|
+
const selection = window.getSelection();
|
97
|
+
if (!selection?.rangeCount)
|
98
|
+
return;
|
99
|
+
selection.deleteFromDocument();
|
100
|
+
selection.getRangeAt(0).insertNode(document.createTextNode(paste || ''));
|
101
|
+
selection.collapseToEnd();
|
102
|
+
});
|
103
|
+
}
|
83
104
|
textBlock.tabIndex = tabIndex || 0;
|
84
105
|
textBlock.innerText = value;
|
85
106
|
textBlock.addEventListener('blur', (e) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":";;;AACA,0CAAsE;AAEtE,iDAWwB;AACxB,
|
1
|
+
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":";;;AACA,0CAAsE;AAEtE,iDAWwB;AACxB,2CAKqB;AACrB,0CAAwD;AAExD,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,K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F;SAAM;QACL,SAAS,CAAC,SAAS,GAAG,KAAK;aACxB,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CACF,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CACvB,+BACE,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SACvC,MAAM,CAAC,SAAS,CACnB;aACA,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAClC;AACH,CAAC,CAAC;AA3KW,QAAA,QAAQ,YA2KnB"}
|
@@ -55,19 +55,25 @@ describe('getSplitPosition test with mocked font width calculations', () => {
|
|
55
55
|
expect(getSplittedLines('a', mockCalcValues)).toEqual(['a']);
|
56
56
|
expect(getSplittedLines('aaaa', mockCalcValues)).toEqual(['aaaa']);
|
57
57
|
});
|
58
|
-
it('splits a line to the nearest previous
|
58
|
+
it('splits a line to the nearest previous breakable char', () => {
|
59
59
|
expect(getSplittedLines('aaa bbb', mockCalcValues)).toEqual(['aaa', 'bbb']);
|
60
|
+
expect(getSplittedLines('top-hat', mockCalcValues)).toEqual(['top-', 'hat']);
|
61
|
+
expect(getSplittedLines('top—hat', mockCalcValues)).toEqual(['top—', 'hat']); // em dash
|
62
|
+
expect(getSplittedLines('top–hat', mockCalcValues)).toEqual(['top–', 'hat']); // en dash
|
60
63
|
});
|
61
|
-
it('splits a line where the split point is on a
|
64
|
+
it('splits a line where the split point is on a breakable char', () => {
|
62
65
|
expect(getSplittedLines('aaaaa bbbbb', mockCalcValues)).toEqual(['aaaaa', 'bbbbb']);
|
66
|
+
expect(getSplittedLines('left-hand', mockCalcValues)).toEqual(['left-', 'hand']);
|
63
67
|
});
|
64
68
|
it('splits a long line in the middle of a word if too long', () => {
|
65
69
|
expect(getSplittedLines('aaaaaa bbb', mockCalcValues)).toEqual(['aaaaa', 'a bbb']);
|
70
|
+
expect(getSplittedLines('aaaaaa-a b', mockCalcValues)).toEqual(['aaaaa', 'a-a b']);
|
71
|
+
expect(getSplittedLines('aaaaa-aa b', mockCalcValues)).toEqual(['aaaaa', '-aa b']);
|
66
72
|
});
|
67
|
-
it('splits a long line without
|
73
|
+
it('splits a long line without breakable chars at exactly 5 chars', () => {
|
68
74
|
expect(getSplittedLines('abcdef', mockCalcValues)).toEqual(['abcde', 'f']);
|
69
75
|
});
|
70
|
-
it('splits a very long line without
|
76
|
+
it('splits a very long line without breakable chars at exactly 5 chars', () => {
|
71
77
|
expect(getSplittedLines('abcdefghijklmn', mockCalcValues)).toEqual(['abcde', 'fghij', 'klmn']);
|
72
78
|
});
|
73
79
|
it('splits a line with lots of words', () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.test.js","sourceRoot":"","sources":["../../../__tests__/text.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAQ,cAAc,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC,CAAC;AACxF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG,GAAS,EAAE,CAAC,CAAC;IACjC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClD,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;CACrC,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,MAAM,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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"}
|
@@ -94,20 +94,38 @@ const getOverPosition = (textLine, calcValues) => {
|
|
94
94
|
}
|
95
95
|
return null;
|
96
96
|
};
|
97
|
+
/**
|
98
|
+
* Line breakable chars depend on the language and writing system.
|
99
|
+
* Western writing systems typically use spaces and hyphens as line breakable chars.
|
100
|
+
* Other writing systems often break on word boundaries so the following
|
101
|
+
* does not negatively impact them.
|
102
|
+
* However, this might need to be revisited for broader language support.
|
103
|
+
*/
|
104
|
+
const isLineBreakableChar = (char) => {
|
105
|
+
const lineBreakableChars = [' ', '-', "\u2014", "\u2013"];
|
106
|
+
return lineBreakableChars.includes(char);
|
107
|
+
};
|
97
108
|
/**
|
98
109
|
* Gets the position of the split. Splits the exceeding line at
|
99
|
-
* the last
|
110
|
+
* the last breakable char prior to it exceeding the bounding box width.
|
100
111
|
*/
|
101
112
|
const getSplitPosition = (textLine, calcValues) => {
|
102
113
|
const overPos = getOverPosition(textLine, calcValues);
|
103
114
|
if (overPos === null)
|
104
115
|
return textLine.length; // input line is shorter than the available space
|
105
|
-
|
106
|
-
|
116
|
+
if (textLine[overPos] === ' ') {
|
117
|
+
// if the character immediately beyond the boundary is a space, split
|
118
|
+
return overPos;
|
119
|
+
}
|
120
|
+
let overPosTmp = overPos - 1;
|
121
|
+
while (overPosTmp >= 0) {
|
122
|
+
if (isLineBreakableChar(textLine[overPosTmp])) {
|
123
|
+
return overPosTmp + 1;
|
124
|
+
}
|
107
125
|
overPosTmp--;
|
108
126
|
}
|
109
|
-
// For very long lines with no
|
110
|
-
return
|
127
|
+
// For very long lines with no breakable chars use the original overPos
|
128
|
+
return overPos;
|
111
129
|
};
|
112
130
|
/**
|
113
131
|
* Recursively splits the line at getSplitPosition.
|
@@ -115,7 +133,7 @@ const getSplitPosition = (textLine, calcValues) => {
|
|
115
133
|
*/
|
116
134
|
export const getSplittedLines = (textLine, calcValues) => {
|
117
135
|
const splitPos = getSplitPosition(textLine, calcValues);
|
118
|
-
const splittedLine = textLine.substring(0, splitPos);
|
136
|
+
const splittedLine = textLine.substring(0, splitPos).trimEnd();
|
119
137
|
const rest = textLine.substring(splitPos).trimStart();
|
120
138
|
if (rest === textLine) {
|
121
139
|
// if we went so small that we want to split on the first char
|
@@ -225,4 +243,5 @@ export const calculateDynamicFontSize = async ({ textSchema, font, value, starti
|
|
225
243
|
}
|
226
244
|
return dynamicFontSize;
|
227
245
|
};
|
246
|
+
export const isFirefox = () => navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
228
247
|
//# sourceMappingURL=helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/text/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,KAAK,EACL,KAAK,EACL,KAAK,EAEL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,WAAwB,EACxB,QAAgB,EAChB,UAAkB,EAClB,iBAAyB,EACzB,EAAE;IACF,MA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AoB,CAAC,eAAe,CAAC,CAAC,CAAC;KAC/E;IAED,OAAO,eAAe,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { getDefaultFont } from '@pdfme/common';
|
2
2
|
import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, VERTICAL_ALIGN_TOP, VERTICAL_ALIGN_MIDDLE, VERTICAL_ALIGN_BOTTOM, DEFAULT_VERTICAL_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, PLACEHOLDER_FONT_COLOR, } from './constants.js';
|
3
|
-
import { calculateDynamicFontSize, getFontKitFont, getBrowserVerticalFontAdjustments, } from './helper.js';
|
3
|
+
import { calculateDynamicFontSize, getFontKitFont, getBrowserVerticalFontAdjustments, isFirefox, } from './helper.js';
|
4
4
|
import { addAlphaToHex, isEditable } from '../utils.js';
|
5
5
|
const mapVerticalAlignToFlex = (verticalAlignmentValue) => {
|
6
6
|
switch (verticalAlignmentValue) {
|
@@ -76,7 +76,28 @@ export const uiRender = async (arg) => {
|
|
76
76
|
const textBlock = document.createElement('div');
|
77
77
|
Object.assign(textBlock.style, textBlockStyle);
|
78
78
|
if (isEditable(mode, schema)) {
|
79
|
-
|
79
|
+
if (!isFirefox()) {
|
80
|
+
textBlock.contentEditable = 'plaintext-only';
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
textBlock.contentEditable = 'true';
|
84
|
+
textBlock.addEventListener('keydown', (e) => {
|
85
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
86
|
+
e.preventDefault();
|
87
|
+
document.execCommand('insertLineBreak', false, undefined);
|
88
|
+
}
|
89
|
+
});
|
90
|
+
textBlock.addEventListener('paste', (e) => {
|
91
|
+
e.preventDefault();
|
92
|
+
const paste = e.clipboardData?.getData('text');
|
93
|
+
const selection = window.getSelection();
|
94
|
+
if (!selection?.rangeCount)
|
95
|
+
return;
|
96
|
+
selection.deleteFromDocument();
|
97
|
+
selection.getRangeAt(0).insertNode(document.createTextNode(paste || ''));
|
98
|
+
selection.collapseToEnd();
|
99
|
+
});
|
100
|
+
}
|
80
101
|
textBlock.tabIndex = tabIndex || 0;
|
81
102
|
textBlock.innerText = value;
|
82
103
|
textBlock.addEventListener('blur', (e) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,iCAAiC,
|
1
|
+
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,iCAAiC,EACjC,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,sBAAsB,GAAG,CAAC,sBAA0C,EAAE,EAAE;IAC5E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,CAAC;YAC7B,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC5B;KACF;SAAM;QACL,SAAS,CAAC,SAAS,GAAG,KAAK;aACxB,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CACF,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CACvB,+BACE,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SACvC,MAAM,CAAC,SAAS,CACnB;aACA,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAClC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/text/helper.ts
CHANGED
@@ -152,21 +152,41 @@ const getOverPosition = (textLine: string, calcValues: FontWidthCalcValues) => {
|
|
152
152
|
return null;
|
153
153
|
};
|
154
154
|
|
155
|
+
/**
|
156
|
+
* Line breakable chars depend on the language and writing system.
|
157
|
+
* Western writing systems typically use spaces and hyphens as line breakable chars.
|
158
|
+
* Other writing systems often break on word boundaries so the following
|
159
|
+
* does not negatively impact them.
|
160
|
+
* However, this might need to be revisited for broader language support.
|
161
|
+
*/
|
162
|
+
const isLineBreakableChar = (char: string) => {
|
163
|
+
const lineBreakableChars = [' ', '-', "\u2014", "\u2013"];
|
164
|
+
return lineBreakableChars.includes(char);
|
165
|
+
}
|
166
|
+
|
155
167
|
/**
|
156
168
|
* Gets the position of the split. Splits the exceeding line at
|
157
|
-
* the last
|
169
|
+
* the last breakable char prior to it exceeding the bounding box width.
|
158
170
|
*/
|
159
171
|
const getSplitPosition = (textLine: string, calcValues: FontWidthCalcValues) => {
|
160
172
|
const overPos = getOverPosition(textLine, calcValues);
|
161
173
|
if (overPos === null) return textLine.length; // input line is shorter than the available space
|
162
174
|
|
163
|
-
|
164
|
-
|
175
|
+
if (textLine[overPos] === ' ') {
|
176
|
+
// if the character immediately beyond the boundary is a space, split
|
177
|
+
return overPos;
|
178
|
+
}
|
179
|
+
|
180
|
+
let overPosTmp = overPos - 1;
|
181
|
+
while (overPosTmp >= 0) {
|
182
|
+
if (isLineBreakableChar(textLine[overPosTmp])) {
|
183
|
+
return overPosTmp+1;
|
184
|
+
}
|
165
185
|
overPosTmp--;
|
166
186
|
}
|
167
187
|
|
168
|
-
// For very long lines with no
|
169
|
-
return
|
188
|
+
// For very long lines with no breakable chars use the original overPos
|
189
|
+
return overPos;
|
170
190
|
};
|
171
191
|
|
172
192
|
/**
|
@@ -175,7 +195,7 @@ const getSplitPosition = (textLine: string, calcValues: FontWidthCalcValues) =>
|
|
175
195
|
*/
|
176
196
|
export const getSplittedLines = (textLine: string, calcValues: FontWidthCalcValues): string[] => {
|
177
197
|
const splitPos = getSplitPosition(textLine, calcValues);
|
178
|
-
const splittedLine = textLine.substring(0, splitPos);
|
198
|
+
const splittedLine = textLine.substring(0, splitPos).trimEnd();
|
179
199
|
const rest = textLine.substring(splitPos).trimStart();
|
180
200
|
|
181
201
|
if (rest === textLine) {
|
@@ -318,3 +338,5 @@ export const calculateDynamicFontSize = async ({
|
|
318
338
|
|
319
339
|
return dynamicFontSize;
|
320
340
|
};
|
341
|
+
|
342
|
+
export const isFirefox = () => navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
package/src/text/uiRender.ts
CHANGED
@@ -17,6 +17,7 @@ import {
|
|
17
17
|
calculateDynamicFontSize,
|
18
18
|
getFontKitFont,
|
19
19
|
getBrowserVerticalFontAdjustments,
|
20
|
+
isFirefox,
|
20
21
|
} from './helper.js';
|
21
22
|
import { addAlphaToHex, isEditable } from '../utils.js';
|
22
23
|
|
@@ -118,7 +119,27 @@ export const uiRender = async (arg: UIRenderProps<TextSchema>) => {
|
|
118
119
|
Object.assign(textBlock.style, textBlockStyle);
|
119
120
|
|
120
121
|
if (isEditable(mode, schema)) {
|
121
|
-
|
122
|
+
if (!isFirefox()) {
|
123
|
+
textBlock.contentEditable = 'plaintext-only';
|
124
|
+
} else {
|
125
|
+
textBlock.contentEditable = 'true';
|
126
|
+
textBlock.addEventListener('keydown', (e: KeyboardEvent) => {
|
127
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
128
|
+
e.preventDefault();
|
129
|
+
document.execCommand('insertLineBreak', false, undefined);
|
130
|
+
}
|
131
|
+
});
|
132
|
+
|
133
|
+
textBlock.addEventListener('paste', (e: ClipboardEvent) => {
|
134
|
+
e.preventDefault();
|
135
|
+
const paste = e.clipboardData?.getData('text');
|
136
|
+
const selection = window.getSelection();
|
137
|
+
if (!selection?.rangeCount) return;
|
138
|
+
selection.deleteFromDocument();
|
139
|
+
selection.getRangeAt(0).insertNode(document.createTextNode(paste || ''));
|
140
|
+
selection.collapseToEnd();
|
141
|
+
});
|
142
|
+
}
|
122
143
|
textBlock.tabIndex = tabIndex || 0;
|
123
144
|
textBlock.innerText = value;
|
124
145
|
textBlock.addEventListener('blur', (e: Event) => {
|