@mediafly/js-ui 50.4.3 → 50.4.4-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.
@@ -46,7 +46,7 @@ export default class RichTextComponentController implements ng.IComponentControl
46
46
  protected colorInputOpened(): void;
47
47
  protected fontSelected(fontFamily: string): void;
48
48
  /** The user entered/deleted/modified some text. Handle any formatting issues, then store the model. */
49
- protected onTextChange(delta: Delta, _oldContents: Delta, source: EmitterSource): void;
49
+ protected onTextChange(delta: Delta, oldContents: Delta, source: EmitterSource): void;
50
50
  /** The user moved the cursor. Fix missing formats and update the toolbar to reflect the current selection. */
51
51
  protected selectionChange(range: Range, _oldRange: Range, source: EmitterSource): void;
52
52
  private checkValidity;
@@ -62,6 +62,11 @@ export default class RichTextComponentController implements ng.IComponentControl
62
62
  * all our formatting, so we also need to define appropriate values for the Headings.
63
63
  */
64
64
  private fixHeadingFormat;
65
+ /**
66
+ * Toggling bold/italic/underline clears the font, if the font name contains spaces and ends with digits: https://github.com/slab/quill/issues/4370.
67
+ * Spot when that happens and restore the old font(s).
68
+ */
69
+ private fixClearedFonts;
65
70
  /**
66
71
  * Quill likes to default to no formatting: an empty paragraph has no font, size, or color, so the style is inherited
67
72
  * from the CSS.
@@ -72,7 +77,22 @@ export default class RichTextComponentController implements ng.IComponentControl
72
77
  private fixMissingFormats;
73
78
  private getColorFromFormat;
74
79
  private getFontFromFormat;
80
+ /**
81
+ * Scans the entire text and returns an array of objects denoting which font is used for each range.
82
+ */
83
+ private getFontRanges;
84
+ /**
85
+ * If you recently toggled bold/italic/underline with no text selected whilst in a block of text whose font name
86
+ * contains spaces and ends in a number, it will have forgotten the font.
87
+ * There's no event for the bold/italic/underline toggle, so we detect this when the user types the first letter.
88
+ */
89
+ private getRangeOfAddedFontlessText;
75
90
  private getSizeFromFormat;
91
+ /**
92
+ * Reapply the old fonts to a given range.
93
+ * @returns If the whole range is of the same font, returns that font. Otherwise undefined.
94
+ */
95
+ private reinstateMissingFonts;
76
96
  private sanitizeAndValidate;
77
97
  /** Updates the color shown in the toolbar. Does not change the color being used in the text. */
78
98
  private updateColorPicker;
@@ -144,17 +144,19 @@ let RichTextComponentController = class RichTextComponentController {
144
144
  this.debouncedSanitizeAndValidate();
145
145
  }
146
146
  /** The user entered/deleted/modified some text. Handle any formatting issues, then store the model. */
147
- onTextChange(delta, _oldContents, source) {
147
+ onTextChange(delta, oldContents, source) {
148
148
  if (source !== 'user') {
149
149
  return;
150
150
  }
151
151
  this.$timeout(() => {
152
+ // In some cases, toggling Bold/Italic/Underline clears the font.
153
+ this.fixClearedFonts(oldContents, delta);
152
154
  // When we choose "Heading 1" or "Heading 2", we also need to set the font, size, and color.
153
155
  this.fixHeadingFormat(delta);
154
156
  // Quill's "Clear formatting" button leaves us inheriting styles from the CSS. We want to keep things explicit.
155
157
  this.fixClearFormatting(delta);
156
158
  // Also, things like adding a line break can leave us with no style.
157
- this.fixMissingFormats();
159
+ this.fixMissingFormats(delta);
158
160
  });
159
161
  this.debouncedSanitizeAndValidate();
160
162
  }
@@ -195,7 +197,7 @@ let RichTextComponentController = class RichTextComponentController {
195
197
  var _a, _b, _c;
196
198
  return op.retain && (((_a = op.attributes) === null || _a === void 0 ? void 0 : _a.font) === null || ((_b = op.attributes) === null || _b === void 0 ? void 0 : _b.size) === null || ((_c = op.attributes) === null || _c === void 0 ? void 0 : _c.color) === null);
197
199
  })) {
198
- this.editor.format('font', this.DEFAULT_FONT);
200
+ this.editor.format('font', `"${this.DEFAULT_FONT}"`);
199
201
  this.updateFontPicker(this.DEFAULT_FONT);
200
202
  this.editor.format('size', this.DEFAULT_SIZE);
201
203
  this.updateSizePicker(this.DEFAULT_SIZE);
@@ -247,7 +249,7 @@ let RichTextComponentController = class RichTextComponentController {
247
249
  }
248
250
  for (const line of lines) {
249
251
  const range = new quill_1.Range(line.offset(), line.length());
250
- this.editor.formatText(range, 'font', font);
252
+ this.editor.formatText(range, 'font', `"${font}"`);
251
253
  this.editor.formatText(range, 'size', size);
252
254
  this.editor.formatText(range, 'color', color);
253
255
  }
@@ -255,6 +257,50 @@ let RichTextComponentController = class RichTextComponentController {
255
257
  this.updateSizePicker(size);
256
258
  this.updateColorPicker(color);
257
259
  }
260
+ /**
261
+ * Toggling bold/italic/underline clears the font, if the font name contains spaces and ends with digits: https://github.com/slab/quill/issues/4370.
262
+ * Spot when that happens and restore the old font(s).
263
+ */
264
+ fixClearedFonts(oldContents, delta) {
265
+ let currentPos = 0;
266
+ let haveFirstFont = false;
267
+ let allIsFont;
268
+ let fontRanges;
269
+ // The changes come as an array of ops. Most will be just { retain: ... } where nothing has changed,
270
+ // but some will have attributes indicating what has changed.
271
+ // If the change crosses a line break, there will be multiple ops with attributes. Loop through them all.
272
+ for (const op of delta.ops) {
273
+ if (typeof op.retain !== 'number') {
274
+ // I've only ever seen this be a number, but the interface says it can be something more complex.
275
+ // We can't handle that, so get out.
276
+ return;
277
+ }
278
+ if (op.retain && op.attributes && !op.attributes.font
279
+ && ('bold' in op.attributes || 'italic' in op.attributes || 'underline' in op.attributes)) {
280
+ // The bad thing has happened, so get a list of how the fonts used to be (if we don't have it already).
281
+ if (!fontRanges) {
282
+ fontRanges = this.getFontRanges(oldContents);
283
+ }
284
+ const affectedRange = {
285
+ index: currentPos,
286
+ length: op.retain,
287
+ };
288
+ const fontOfRange = this.reinstateMissingFonts(affectedRange, fontRanges);
289
+ if (!haveFirstFont) {
290
+ allIsFont = fontOfRange;
291
+ haveFirstFont = true;
292
+ }
293
+ else if (fontOfRange !== allIsFont) {
294
+ allIsFont = undefined;
295
+ }
296
+ }
297
+ currentPos += op.retain;
298
+ }
299
+ if (allIsFont) {
300
+ // The whole selection was the same font, so so that in the font picker.
301
+ this.updateFontPicker(allIsFont);
302
+ }
303
+ }
258
304
  /**
259
305
  * Quill likes to default to no formatting: an empty paragraph has no font, size, or color, so the style is inherited
260
306
  * from the CSS.
@@ -262,7 +308,7 @@ let RichTextComponentController = class RichTextComponentController {
262
308
  * reproduced elsewhere.
263
309
  * We try to get the format from the previous line, or fall back to the default.
264
310
  */
265
- fixMissingFormats() {
311
+ fixMissingFormats(delta) {
266
312
  // When debugging this, it can be useful to add this to your CSS to highlight problems:
267
313
  // .ql-editor { color: #f0f; font-family: 'Wingdings', sans-serif; font-size: 9px; }
268
314
  const selection = this.editor.getSelection();
@@ -278,6 +324,7 @@ let RichTextComponentController = class RichTextComponentController {
278
324
  // We are fully formatted; nothing more to do
279
325
  return;
280
326
  }
327
+ const addedFontlessTextRange = this.getRangeOfAddedFontlessText(delta);
281
328
  // Copy missing format from the previous character (or the next, if we're at the start of the document)
282
329
  const nearbyCharIndex = selection.index === 0 ? 1 : selection.index - 1;
283
330
  const nearbyRange = {
@@ -290,7 +337,10 @@ let RichTextComponentController = class RichTextComponentController {
290
337
  this.editor.format('underline', nearbyFormat.underline);
291
338
  if (!format.font) {
292
339
  const font = this.getFontFromFormat(nearbyFormat);
293
- this.editor.format('font', font);
340
+ this.editor.format('font', `"${font}"`);
341
+ if (addedFontlessTextRange) {
342
+ this.editor.formatText(addedFontlessTextRange, 'font', `"${font}"`);
343
+ }
294
344
  this.updateFontPicker(font);
295
345
  }
296
346
  if (!format.size) {
@@ -336,6 +386,67 @@ let RichTextComponentController = class RichTextComponentController {
336
386
  // Fall back to the default (should never get here)
337
387
  return this.DEFAULT_FONT;
338
388
  }
389
+ /**
390
+ * Scans the entire text and returns an array of objects denoting which font is used for each range.
391
+ */
392
+ getFontRanges(contents) {
393
+ let currentPos = 0;
394
+ const fontRanges = [];
395
+ for (const op of contents.ops) {
396
+ if (typeof op.insert === 'string') {
397
+ const font = op.attributes ? this.getFontFromFormat(op.attributes) : this.DEFAULT_FONT;
398
+ fontRanges.push({
399
+ end: currentPos + op.insert.length - 1,
400
+ font,
401
+ length: op.insert.length,
402
+ start: currentPos,
403
+ });
404
+ currentPos += op.insert.length;
405
+ }
406
+ }
407
+ return fontRanges;
408
+ }
409
+ /**
410
+ * If you recently toggled bold/italic/underline with no text selected whilst in a block of text whose font name
411
+ * contains spaces and ends in a number, it will have forgotten the font.
412
+ * There's no event for the bold/italic/underline toggle, so we detect this when the user types the first letter.
413
+ */
414
+ getRangeOfAddedFontlessText(delta) {
415
+ if (!delta) {
416
+ return undefined;
417
+ }
418
+ let currentPos = 0;
419
+ for (const op of delta.ops) {
420
+ if (!('retain' in op)
421
+ && 'insert' in op && typeof op.insert === 'string'
422
+ && op.attributes && !op.attributes.font) {
423
+ // Disclaimer: if you are typing in a block of text whose font name contains spaces and ends in a
424
+ // number, and has bold/italic/underline applied, but you have just turned bold/italic/underline off with
425
+ // no text selected, AND IF the letter you then type matches the prior letter in the existing text,
426
+ // AND that prior letter is the first letter of a word, then the `font` attribute will already be set
427
+ // correctly here, but the font will not be applied to the text you typed. I cannot see a good way to
428
+ // detect this, and quite frankly Quill can go do one at this point.
429
+ // TODO: CE-10797: Yeah right.
430
+ return {
431
+ index: currentPos,
432
+ length: op.insert.length,
433
+ };
434
+ }
435
+ else if ('retain' in op) {
436
+ if (typeof op.retain !== 'number') {
437
+ // I've only ever seen this be a number, but the interface says it can be something more complex.
438
+ // We can't handle that, so get out.
439
+ return undefined;
440
+ }
441
+ currentPos += op.retain;
442
+ }
443
+ else {
444
+ // Neither a 'retain' nor a buggy 'insert', so the type of edit is not one we're interested in here
445
+ return undefined;
446
+ }
447
+ }
448
+ return undefined;
449
+ }
339
450
  getSizeFromFormat(format) {
340
451
  if (!format.size) {
341
452
  // We get no size if the default size is selected; or if the selection contains multiple sizes, one of which is the default.
@@ -352,6 +463,34 @@ let RichTextComponentController = class RichTextComponentController {
352
463
  // Fall back to the default (should never get here)
353
464
  return this.DEFAULT_FONT;
354
465
  }
466
+ /**
467
+ * Reapply the old fonts to a given range.
468
+ * @returns If the whole range is of the same font, returns that font. Otherwise undefined.
469
+ */
470
+ reinstateMissingFonts(affectedRange, fontRanges) {
471
+ let haveFirstFont = false;
472
+ let allIsFont;
473
+ // The affected range might contain multiple fonts. Loop through each font section that overlaps our range.
474
+ let currentStart = affectedRange.index;
475
+ let fontRange = fontRanges.find((fr) => fr.start <= currentStart && fr.end >= currentStart);
476
+ while (fontRange && currentStart < affectedRange.index + affectedRange.length) {
477
+ if (!haveFirstFont) {
478
+ allIsFont = fontRange === null || fontRange === void 0 ? void 0 : fontRange.font;
479
+ haveFirstFont = true;
480
+ }
481
+ else if (fontRange.font !== allIsFont) {
482
+ allIsFont = undefined;
483
+ }
484
+ const overlappingRange = {
485
+ index: Math.max(fontRange.start, currentStart),
486
+ length: Math.min(fontRange.end, affectedRange.index + affectedRange.length - 1) - currentStart + 1,
487
+ };
488
+ this.editor.formatText(overlappingRange, 'font', `"${fontRange.font}"`);
489
+ currentStart = overlappingRange.index + overlappingRange.length;
490
+ fontRange = fontRanges.find((fr) => fr.start <= currentStart && fr.end >= currentStart);
491
+ }
492
+ return allIsFont;
493
+ }
355
494
  sanitizeAndValidate() {
356
495
  let html;
357
496
  // An empty Quill editor's html might be like:
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text.component.js","sourceRoot":"","sources":["../../src/components/rich-text/rich-text.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,oDAAsB;AACtB,+CAA+C;AAE/C,8CAAwD;AAExD,+BAAmC;AACnC,4EAAiD;AAUjD,IAAqB,2BAA2B,GAAhD,MAAqB,2BAA2B;IAkC/C,YAC6B,QAA6B,EAC3B,UAAyB,EAC3B,QAA4B,EACrB,eAAgC,EAC/B,gBAAkC;QAJ1C,aAAQ,GAAR,QAAQ,CAAqB;QAC3B,eAAU,GAAV,UAAU,CAAe;QAC3B,aAAQ,GAAR,QAAQ,CAAoB;QACrB,oBAAe,GAAf,eAAe,CAAiB;QAC/B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAnB/D,iCAA4B,GAAG,gBAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE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C,IAAY;QAEpC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;IACzB,CAAC;IAED,8FAA8F;IACtF,gBAAgB,CAAC,IAAY;QAEpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QACrF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;IACtF,CAAC;CACD,CAAA;AAvaS;IAAR,kBAAK,EAAE;;wEAA8B;AAC7B;IAAR,kBAAK,EAAE;;uEAA6B;AAC5B;IAAR,kBAAK,EAAE;;+DAAqB;AAJT,2BAA2B;IAP/C,sBAAS,CAAC;QACV,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE;YACR,WAAW,EAAE,SAAS;SACtB;QACD,QAAQ,EAAE,OAAO,CAAC,4BAA4B,CAAC;KAC/C,CAAC;IAoCC,WAAA,mBAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,mBAAM,CAAC,YAAY,CAAC,CAAA;IACpB,WAAA,mBAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,mBAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,mBAAM,CAAC,kBAAkB,CAAC,CAAA;+DADyB,2BAAe;GAtChD,2BAA2B,CAya/C;kBAzaoB,2BAA2B"}
1
+ {"version":3,"file":"rich-text.component.js","sourceRoot":"","sources":["../../src/components/rich-text/rich-text.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAsC;AACtC,oDAAsB;AACtB,+CAA+C;AAE/C,8CAAwD;AAExD,+BAAmC;AAC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IAED,8FAA8F;IACtF,gBAAgB,CAAC,IAAY;QAEpC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QACrF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,mBAAmB,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;IACtF,CAAC;CACD,CAAA;AAzkBS;IAAR,kBAAK,EAAE;;wEAA8B;AAC7B;IAAR,kBAAK,EAAE;;uEAA6B;AAC5B;IAAR,kBAAK,EAAE;;+DAAqB;AAJT,2BAA2B;IAP/C,sBAAS,CAAC;QACV,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE;YACR,WAAW,EAAE,SAAS;SACtB;QACD,QAAQ,EAAE,OAAO,CAAC,4BAA4B,CAAC;KAC/C,CAAC;IAoCC,WAAA,mBAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,mBAAM,CAAC,YAAY,CAAC,CAAA;IACpB,WAAA,mBAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,mBAAM,CAAC,iBAAiB,CAAC,CAAA;IACzB,WAAA,mBAAM,CAAC,kBAAkB,CAAC,CAAA;+DADyB,2BAAe;GAtChD,2BAA2B,CA2kB/C;kBA3kBoB,2BAA2B"}
@@ -1407,8 +1407,8 @@
1407
1407
  "affectsGlobalScope": false
1408
1408
  },
1409
1409
  "../src/components/rich-text/rich-text.component.ts": {
1410
- "version": "606ecb8e59b2426aac578fd07f196ac3237cd9342b3be7d5d9c39309d1d64415",
1411
- "signature": "15a5ec8b30850c5172ce6a00433d6cb80e239cedcdcf7ca896ed2f0135753697",
1410
+ "version": "c50de5ef0815ba0380b99363278b44d2a35b49354b41fd4d4f3160ffabcfb8b5",
1411
+ "signature": "db38d6389a8ac6f79878119537c1c68baa66f2afd047a0ae5e6272a9467c594b",
1412
1412
  "affectsGlobalScope": false
1413
1413
  },
1414
1414
  "../src/components/rich-text/index.ts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediafly/js-ui",
3
- "version": "50.4.3",
3
+ "version": "50.4.4-1",
4
4
  "license": "UNLICENSED",
5
5
  "description": "UI components for Mediafly Angular applications",
6
6
  "repository": {
@@ -163,11 +163,14 @@ export default class RichTextComponentController implements ng.IComponentControl
163
163
  }
164
164
 
165
165
  /** The user entered/deleted/modified some text. Handle any formatting issues, then store the model. */
166
- protected onTextChange(delta: Delta, _oldContents: Delta, source: EmitterSource): void {
166
+ protected onTextChange(delta: Delta, oldContents: Delta, source: EmitterSource): void {
167
167
 
168
168
  if (source !== 'user') { return }
169
169
 
170
170
  this.$timeout(() => {
171
+ // In some cases, toggling Bold/Italic/Underline clears the font.
172
+ this.fixClearedFonts(oldContents, delta)
173
+
171
174
  // When we choose "Heading 1" or "Heading 2", we also need to set the font, size, and color.
172
175
  this.fixHeadingFormat(delta)
173
176
 
@@ -175,7 +178,7 @@ export default class RichTextComponentController implements ng.IComponentControl
175
178
  this.fixClearFormatting(delta)
176
179
 
177
180
  // Also, things like adding a line break can leave us with no style.
178
- this.fixMissingFormats()
181
+ this.fixMissingFormats(delta)
179
182
  })
180
183
 
181
184
  this.debouncedSanitizeAndValidate()
@@ -221,7 +224,7 @@ export default class RichTextComponentController implements ng.IComponentControl
221
224
  if (delta.ops.some((op) => op.retain && (
222
225
  op.attributes?.font === null || op.attributes?.size === null || op.attributes?.color === null
223
226
  ))) {
224
- this.editor.format('font', this.DEFAULT_FONT)
227
+ this.editor.format('font', `"${this.DEFAULT_FONT}"`)
225
228
  this.updateFontPicker(this.DEFAULT_FONT)
226
229
  this.editor.format('size', this.DEFAULT_SIZE)
227
230
  this.updateSizePicker(this.DEFAULT_SIZE)
@@ -274,7 +277,7 @@ export default class RichTextComponentController implements ng.IComponentControl
274
277
 
275
278
  for (const line of lines) {
276
279
  const range = new Range(line.offset(), line.length())
277
- this.editor.formatText(range, 'font', font)
280
+ this.editor.formatText(range, 'font', `"${font}"`)
278
281
  this.editor.formatText(range, 'size', size)
279
282
  this.editor.formatText(range, 'color', color)
280
283
  }
@@ -284,6 +287,59 @@ export default class RichTextComponentController implements ng.IComponentControl
284
287
  this.updateColorPicker(color)
285
288
  }
286
289
 
290
+ /**
291
+ * Toggling bold/italic/underline clears the font, if the font name contains spaces and ends with digits: https://github.com/slab/quill/issues/4370.
292
+ * Spot when that happens and restore the old font(s).
293
+ */
294
+ private fixClearedFonts(oldContents: Delta, delta: Delta): void {
295
+
296
+ let currentPos: number = 0
297
+ let haveFirstFont: boolean = false
298
+ let allIsFont: string | undefined
299
+ let fontRanges: FontRange[] | undefined
300
+
301
+ // The changes come as an array of ops. Most will be just { retain: ... } where nothing has changed,
302
+ // but some will have attributes indicating what has changed.
303
+ // If the change crosses a line break, there will be multiple ops with attributes. Loop through them all.
304
+ for (const op of delta.ops) {
305
+
306
+ if (typeof op.retain !== 'number') {
307
+ // I've only ever seen this be a number, but the interface says it can be something more complex.
308
+ // We can't handle that, so get out.
309
+ return
310
+ }
311
+
312
+ if (op.retain && op.attributes && !op.attributes.font
313
+ && ('bold' in op.attributes || 'italic' in op.attributes || 'underline' in op.attributes)) {
314
+
315
+ // The bad thing has happened, so get a list of how the fonts used to be (if we don't have it already).
316
+ if (!fontRanges) {
317
+ fontRanges = this.getFontRanges(oldContents)
318
+ }
319
+
320
+ const affectedRange: Range = {
321
+ index: currentPos,
322
+ length: op.retain,
323
+ }
324
+
325
+ const fontOfRange = this.reinstateMissingFonts(affectedRange, fontRanges)
326
+ if (!haveFirstFont) {
327
+ allIsFont = fontOfRange
328
+ haveFirstFont = true
329
+ } else if (fontOfRange !== allIsFont) {
330
+ allIsFont = undefined
331
+ }
332
+ }
333
+
334
+ currentPos += op.retain
335
+ }
336
+
337
+ if (allIsFont) {
338
+ // The whole selection was the same font, so so that in the font picker.
339
+ this.updateFontPicker(allIsFont)
340
+ }
341
+ }
342
+
287
343
  /**
288
344
  * Quill likes to default to no formatting: an empty paragraph has no font, size, or color, so the style is inherited
289
345
  * from the CSS.
@@ -291,7 +347,7 @@ export default class RichTextComponentController implements ng.IComponentControl
291
347
  * reproduced elsewhere.
292
348
  * We try to get the format from the previous line, or fall back to the default.
293
349
  */
294
- private fixMissingFormats(): void {
350
+ private fixMissingFormats(delta?: Delta): void {
295
351
 
296
352
  // When debugging this, it can be useful to add this to your CSS to highlight problems:
297
353
  // .ql-editor { color: #f0f; font-family: 'Wingdings', sans-serif; font-size: 9px; }
@@ -310,6 +366,8 @@ export default class RichTextComponentController implements ng.IComponentControl
310
366
  return
311
367
  }
312
368
 
369
+ const addedFontlessTextRange = this.getRangeOfAddedFontlessText(delta)
370
+
313
371
  // Copy missing format from the previous character (or the next, if we're at the start of the document)
314
372
  const nearbyCharIndex = selection.index === 0 ? 1 : selection.index - 1
315
373
  const nearbyRange: Range = {
@@ -324,7 +382,10 @@ export default class RichTextComponentController implements ng.IComponentControl
324
382
 
325
383
  if (!format.font) {
326
384
  const font = this.getFontFromFormat(nearbyFormat)
327
- this.editor.format('font', font)
385
+ this.editor.format('font', `"${font}"`)
386
+ if (addedFontlessTextRange) {
387
+ this.editor.formatText(addedFontlessTextRange, 'font', `"${font}"`)
388
+ }
328
389
  this.updateFontPicker(font)
329
390
  }
330
391
 
@@ -383,6 +444,72 @@ export default class RichTextComponentController implements ng.IComponentControl
383
444
  return this.DEFAULT_FONT
384
445
  }
385
446
 
447
+ /**
448
+ * Scans the entire text and returns an array of objects denoting which font is used for each range.
449
+ */
450
+ private getFontRanges(contents: Delta): FontRange[] {
451
+
452
+ let currentPos = 0
453
+ const fontRanges: FontRange[] = []
454
+ for (const op of contents.ops) {
455
+ if (typeof op.insert === 'string') {
456
+ const font = op.attributes ? this.getFontFromFormat(op.attributes) : this.DEFAULT_FONT
457
+ fontRanges.push({
458
+ end: currentPos + op.insert.length - 1,
459
+ font,
460
+ length: op.insert.length,
461
+ start: currentPos,
462
+ })
463
+ currentPos += op.insert.length
464
+ }
465
+ }
466
+
467
+ return fontRanges
468
+ }
469
+
470
+ /**
471
+ * If you recently toggled bold/italic/underline with no text selected whilst in a block of text whose font name
472
+ * contains spaces and ends in a number, it will have forgotten the font.
473
+ * There's no event for the bold/italic/underline toggle, so we detect this when the user types the first letter.
474
+ */
475
+ private getRangeOfAddedFontlessText(delta?: Delta): Range | undefined {
476
+
477
+ if (!delta) {
478
+ return undefined
479
+ }
480
+
481
+ let currentPos = 0
482
+ for (const op of delta.ops) {
483
+ if (!('retain' in op)
484
+ && 'insert' in op && typeof op.insert === 'string'
485
+ && op.attributes && !op.attributes.font) {
486
+ // Disclaimer: if you are typing in a block of text whose font name contains spaces and ends in a
487
+ // number, and has bold/italic/underline applied, but you have just turned bold/italic/underline off with
488
+ // no text selected, AND IF the letter you then type matches the prior letter in the existing text,
489
+ // AND that prior letter is the first letter of a word, then the `font` attribute will already be set
490
+ // correctly here, but the font will not be applied to the text you typed. I cannot see a good way to
491
+ // detect this, and quite frankly Quill can go do one at this point.
492
+ // TODO: CE-10797: Yeah right.
493
+ return {
494
+ index: currentPos,
495
+ length: op.insert.length,
496
+ }
497
+ } else if ('retain' in op) {
498
+ if (typeof op.retain !== 'number') {
499
+ // I've only ever seen this be a number, but the interface says it can be something more complex.
500
+ // We can't handle that, so get out.
501
+ return undefined
502
+ }
503
+ currentPos += op.retain
504
+ } else {
505
+ // Neither a 'retain' nor a buggy 'insert', so the type of edit is not one we're interested in here
506
+ return undefined
507
+ }
508
+ }
509
+
510
+ return undefined
511
+ }
512
+
386
513
  private getSizeFromFormat(format: QuillFormat): string {
387
514
 
388
515
  if (!format.size) {
@@ -404,6 +531,41 @@ export default class RichTextComponentController implements ng.IComponentControl
404
531
  return this.DEFAULT_FONT
405
532
  }
406
533
 
534
+ /**
535
+ * Reapply the old fonts to a given range.
536
+ * @returns If the whole range is of the same font, returns that font. Otherwise undefined.
537
+ */
538
+ private reinstateMissingFonts(affectedRange: Range, fontRanges: FontRange[]): string | undefined {
539
+
540
+ let haveFirstFont: boolean = false
541
+ let allIsFont: string | undefined
542
+
543
+ // The affected range might contain multiple fonts. Loop through each font section that overlaps our range.
544
+ let currentStart = affectedRange.index
545
+ let fontRange = fontRanges.find((fr) => fr.start <= currentStart && fr.end >= currentStart)
546
+
547
+ while (fontRange && currentStart < affectedRange.index + affectedRange.length) {
548
+
549
+ if (!haveFirstFont) {
550
+ allIsFont = fontRange?.font
551
+ haveFirstFont = true
552
+ } else if (fontRange.font !== allIsFont) {
553
+ allIsFont = undefined
554
+ }
555
+
556
+ const overlappingRange: Range = {
557
+ index: Math.max(fontRange.start, currentStart),
558
+ length: Math.min(fontRange.end, affectedRange.index + affectedRange.length - 1) - currentStart + 1,
559
+ }
560
+ this.editor.formatText(overlappingRange, 'font', `"${fontRange.font}"`)
561
+
562
+ currentStart = overlappingRange.index + overlappingRange.length
563
+ fontRange = fontRanges.find((fr) => fr.start <= currentStart && fr.end >= currentStart)
564
+ }
565
+
566
+ return allIsFont
567
+ }
568
+
407
569
  private sanitizeAndValidate(): void {
408
570
 
409
571
  let html: string | undefined
@@ -442,6 +604,13 @@ export default class RichTextComponentController implements ng.IComponentControl
442
604
  }
443
605
  }
444
606
 
607
+ interface FontRange {
608
+ end: number
609
+ font: string
610
+ length: number
611
+ start: number
612
+ }
613
+
445
614
  interface QuillFormat {
446
615
  [format: string]: unknown
447
616
  }