@ckeditor/ckeditor5-highlight 41.3.0-alpha.1 → 41.3.0-alpha.2

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 (122) hide show
  1. package/dist/translations/ar.d.ts +8 -0
  2. package/dist/translations/ar.js +5 -0
  3. package/dist/translations/az.d.ts +8 -0
  4. package/dist/translations/az.js +5 -0
  5. package/dist/translations/bg.d.ts +8 -0
  6. package/dist/translations/bg.js +5 -0
  7. package/dist/translations/bn.d.ts +8 -0
  8. package/dist/translations/bn.js +5 -0
  9. package/dist/translations/ca.d.ts +8 -0
  10. package/dist/translations/ca.js +5 -0
  11. package/dist/translations/cs.d.ts +8 -0
  12. package/dist/translations/cs.js +5 -0
  13. package/dist/translations/da.d.ts +8 -0
  14. package/dist/translations/da.js +5 -0
  15. package/dist/translations/de-ch.d.ts +8 -0
  16. package/dist/translations/de-ch.js +5 -0
  17. package/dist/translations/de.d.ts +8 -0
  18. package/dist/translations/de.js +5 -0
  19. package/dist/translations/el.d.ts +8 -0
  20. package/dist/translations/el.js +5 -0
  21. package/dist/translations/en-au.d.ts +8 -0
  22. package/dist/translations/en-au.js +5 -0
  23. package/dist/translations/en-gb.d.ts +8 -0
  24. package/dist/translations/en-gb.js +5 -0
  25. package/dist/translations/en.d.ts +8 -0
  26. package/dist/translations/en.js +5 -0
  27. package/dist/translations/es.d.ts +8 -0
  28. package/dist/translations/es.js +5 -0
  29. package/dist/translations/et.d.ts +8 -0
  30. package/dist/translations/et.js +5 -0
  31. package/dist/translations/fa.d.ts +8 -0
  32. package/dist/translations/fa.js +5 -0
  33. package/dist/translations/fi.d.ts +8 -0
  34. package/dist/translations/fi.js +5 -0
  35. package/dist/translations/fr.d.ts +8 -0
  36. package/dist/translations/fr.js +5 -0
  37. package/dist/translations/gl.d.ts +8 -0
  38. package/dist/translations/gl.js +5 -0
  39. package/dist/translations/he.d.ts +8 -0
  40. package/dist/translations/he.js +5 -0
  41. package/dist/translations/hi.d.ts +8 -0
  42. package/dist/translations/hi.js +5 -0
  43. package/dist/translations/hr.d.ts +8 -0
  44. package/dist/translations/hr.js +5 -0
  45. package/dist/translations/hu.d.ts +8 -0
  46. package/dist/translations/hu.js +5 -0
  47. package/dist/translations/id.d.ts +8 -0
  48. package/dist/translations/id.js +5 -0
  49. package/dist/translations/it.d.ts +8 -0
  50. package/dist/translations/it.js +5 -0
  51. package/dist/translations/ja.d.ts +8 -0
  52. package/dist/translations/ja.js +5 -0
  53. package/dist/translations/jv.d.ts +8 -0
  54. package/dist/translations/jv.js +5 -0
  55. package/dist/translations/ko.d.ts +8 -0
  56. package/dist/translations/ko.js +5 -0
  57. package/dist/translations/ku.d.ts +8 -0
  58. package/dist/translations/ku.js +5 -0
  59. package/dist/translations/lt.d.ts +8 -0
  60. package/dist/translations/lt.js +5 -0
  61. package/dist/translations/lv.d.ts +8 -0
  62. package/dist/translations/lv.js +5 -0
  63. package/dist/translations/ms.d.ts +8 -0
  64. package/dist/translations/ms.js +5 -0
  65. package/dist/translations/nb.d.ts +8 -0
  66. package/dist/translations/nb.js +5 -0
  67. package/dist/translations/ne.d.ts +8 -0
  68. package/dist/translations/ne.js +5 -0
  69. package/dist/translations/nl.d.ts +8 -0
  70. package/dist/translations/nl.js +5 -0
  71. package/dist/translations/no.d.ts +8 -0
  72. package/dist/translations/no.js +5 -0
  73. package/dist/translations/pl.d.ts +8 -0
  74. package/dist/translations/pl.js +5 -0
  75. package/dist/translations/pt-br.d.ts +8 -0
  76. package/dist/translations/pt-br.js +5 -0
  77. package/dist/translations/pt.d.ts +8 -0
  78. package/dist/translations/pt.js +5 -0
  79. package/dist/translations/ro.d.ts +8 -0
  80. package/dist/translations/ro.js +5 -0
  81. package/dist/translations/ru.d.ts +8 -0
  82. package/dist/translations/ru.js +5 -0
  83. package/dist/translations/sk.d.ts +8 -0
  84. package/dist/translations/sk.js +5 -0
  85. package/dist/translations/sl.d.ts +8 -0
  86. package/dist/translations/sl.js +5 -0
  87. package/dist/translations/sq.d.ts +8 -0
  88. package/dist/translations/sq.js +5 -0
  89. package/dist/translations/sr-latn.d.ts +8 -0
  90. package/dist/translations/sr-latn.js +5 -0
  91. package/dist/translations/sr.d.ts +8 -0
  92. package/dist/translations/sr.js +5 -0
  93. package/dist/translations/sv.d.ts +8 -0
  94. package/dist/translations/sv.js +5 -0
  95. package/dist/translations/th.d.ts +8 -0
  96. package/dist/translations/th.js +5 -0
  97. package/dist/translations/tk.d.ts +8 -0
  98. package/dist/translations/tk.js +5 -0
  99. package/dist/translations/tr.d.ts +8 -0
  100. package/dist/translations/tr.js +5 -0
  101. package/dist/translations/uk.d.ts +8 -0
  102. package/dist/translations/uk.js +5 -0
  103. package/dist/translations/ur.d.ts +8 -0
  104. package/dist/translations/ur.js +5 -0
  105. package/dist/translations/uz.d.ts +8 -0
  106. package/dist/translations/uz.js +5 -0
  107. package/dist/translations/vi.d.ts +8 -0
  108. package/dist/translations/vi.js +5 -0
  109. package/dist/translations/zh-cn.d.ts +8 -0
  110. package/dist/translations/zh-cn.js +5 -0
  111. package/dist/translations/zh.d.ts +8 -0
  112. package/dist/translations/zh.js +5 -0
  113. package/dist/types/augmentation.d.ts +4 -0
  114. package/dist/types/highlight.d.ts +4 -0
  115. package/dist/types/highlightcommand.d.ts +4 -0
  116. package/dist/types/highlightconfig.d.ts +4 -0
  117. package/dist/types/highlightediting.d.ts +4 -0
  118. package/dist/types/highlightui.d.ts +4 -0
  119. package/dist/types/index.d.ts +4 -0
  120. package/package.json +2 -2
  121. package/dist/index.js +0 -454
  122. package/dist/index.js.map +0 -1
package/dist/index.js DELETED
@@ -1,454 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Command, Plugin, icons } from '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { ButtonView, createDropdown, SplitButtonView, addToolbarToDropdown, ToolbarSeparatorView } from '@ckeditor/ckeditor5-ui/dist/index.js';
7
-
8
- /**
9
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
10
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
11
- */
12
- /**
13
- * @module highlight/highlightcommand
14
- */
15
- /**
16
- * The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}
17
- * to apply the text highlighting.
18
- *
19
- * ```ts
20
- * editor.execute( 'highlight', { value: 'greenMarker' } );
21
- * ```
22
- *
23
- * **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed
24
- * inside a text with the highlight attribute, the command will remove the attribute from the entire range
25
- * of that text.
26
- */
27
- class HighlightCommand extends Command {
28
- /**
29
- * @inheritDoc
30
- */
31
- refresh() {
32
- const model = this.editor.model;
33
- const doc = model.document;
34
- this.value = doc.selection.getAttribute('highlight');
35
- this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'highlight');
36
- }
37
- /**
38
- * Executes the command.
39
- *
40
- * @param options Options for the executed command.
41
- * @param options.value The value to apply.
42
- *
43
- * @fires execute
44
- */
45
- execute(options = {}) {
46
- const model = this.editor.model;
47
- const document = model.document;
48
- const selection = document.selection;
49
- const highlighter = options.value;
50
- model.change(writer => {
51
- if (selection.isCollapsed) {
52
- const position = selection.getFirstPosition();
53
- // When selection is inside text with `highlight` attribute.
54
- if (selection.hasAttribute('highlight')) {
55
- // Find the full highlighted range.
56
- const isSameHighlight = (value) => {
57
- return value.item.hasAttribute('highlight') && value.item.getAttribute('highlight') === this.value;
58
- };
59
- const highlightStart = position.getLastMatchingPosition(isSameHighlight, { direction: 'backward' });
60
- const highlightEnd = position.getLastMatchingPosition(isSameHighlight);
61
- const highlightRange = writer.createRange(highlightStart, highlightEnd);
62
- // Then depending on current value...
63
- if (!highlighter || this.value === highlighter) {
64
- // ...remove attribute when passing highlighter different then current or executing "eraser".
65
- // If we're at the end of the highlighted range, we don't want to remove highlight of the range.
66
- if (!position.isEqual(highlightEnd)) {
67
- writer.removeAttribute('highlight', highlightRange);
68
- }
69
- writer.removeSelectionAttribute('highlight');
70
- }
71
- else {
72
- // ...update `highlight` value.
73
- // If we're at the end of the highlighted range, we don't want to change the highlight of the range.
74
- if (!position.isEqual(highlightEnd)) {
75
- writer.setAttribute('highlight', highlighter, highlightRange);
76
- }
77
- writer.setSelectionAttribute('highlight', highlighter);
78
- }
79
- }
80
- else if (highlighter) {
81
- writer.setSelectionAttribute('highlight', highlighter);
82
- }
83
- }
84
- else {
85
- const ranges = model.schema.getValidRanges(selection.getRanges(), 'highlight');
86
- for (const range of ranges) {
87
- if (highlighter) {
88
- writer.setAttribute('highlight', highlighter, range);
89
- }
90
- else {
91
- writer.removeAttribute('highlight', range);
92
- }
93
- }
94
- }
95
- });
96
- }
97
- }
98
-
99
- /**
100
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
101
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
102
- */
103
- /**
104
- * @module highlight/highlightediting
105
- */
106
- /**
107
- * The highlight editing feature. It introduces the {@link module:highlight/highlightcommand~HighlightCommand command} and the `highlight`
108
- * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}
109
- * as a `<mark>` element with a `class` attribute (`<mark class="marker-green">...</mark>`) depending
110
- * on the {@link module:highlight/highlightconfig~HighlightConfig configuration}.
111
- */
112
- class HighlightEditing extends Plugin {
113
- /**
114
- * @inheritDoc
115
- */
116
- static get pluginName() {
117
- return 'HighlightEditing';
118
- }
119
- /**
120
- * @inheritDoc
121
- */
122
- constructor(editor) {
123
- super(editor);
124
- editor.config.define('highlight', {
125
- options: [
126
- {
127
- model: 'yellowMarker',
128
- class: 'marker-yellow',
129
- title: 'Yellow marker',
130
- color: 'var(--ck-highlight-marker-yellow)',
131
- type: 'marker'
132
- },
133
- {
134
- model: 'greenMarker',
135
- class: 'marker-green',
136
- title: 'Green marker',
137
- color: 'var(--ck-highlight-marker-green)',
138
- type: 'marker'
139
- },
140
- {
141
- model: 'pinkMarker',
142
- class: 'marker-pink',
143
- title: 'Pink marker',
144
- color: 'var(--ck-highlight-marker-pink)',
145
- type: 'marker'
146
- },
147
- {
148
- model: 'blueMarker',
149
- class: 'marker-blue',
150
- title: 'Blue marker',
151
- color: 'var(--ck-highlight-marker-blue)',
152
- type: 'marker'
153
- },
154
- {
155
- model: 'redPen',
156
- class: 'pen-red',
157
- title: 'Red pen',
158
- color: 'var(--ck-highlight-pen-red)',
159
- type: 'pen'
160
- },
161
- {
162
- model: 'greenPen',
163
- class: 'pen-green',
164
- title: 'Green pen',
165
- color: 'var(--ck-highlight-pen-green)',
166
- type: 'pen'
167
- }
168
- ]
169
- });
170
- }
171
- /**
172
- * @inheritDoc
173
- */
174
- init() {
175
- const editor = this.editor;
176
- // Allow highlight attribute on text nodes.
177
- editor.model.schema.extend('$text', { allowAttributes: 'highlight' });
178
- const options = editor.config.get('highlight.options');
179
- // Set-up the two-way conversion.
180
- editor.conversion.attributeToElement(_buildDefinition(options));
181
- editor.commands.add('highlight', new HighlightCommand(editor));
182
- }
183
- }
184
- /**
185
- * Converts the options array to a converter definition.
186
- *
187
- * @param options An array with configured options.
188
- */
189
- function _buildDefinition(options) {
190
- const definition = {
191
- model: {
192
- key: 'highlight',
193
- values: []
194
- },
195
- view: {}
196
- };
197
- for (const option of options) {
198
- definition.model.values.push(option.model);
199
- definition.view[option.model] = {
200
- name: 'mark',
201
- classes: option.class
202
- };
203
- }
204
- return definition;
205
- }
206
-
207
- var markerIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ck-icon__fill\" d=\"M10.798 1.59 3.002 12.875l1.895 1.852 2.521 1.402 6.997-12.194z\"/><path d=\"m2.556 16.727.234-.348c-.297-.151-.462-.293-.498-.426-.036-.137.002-.416.115-.837.094-.25.15-.449.169-.595a4.495 4.495 0 0 0 0-.725c-.209-.621-.303-1.041-.284-1.26.02-.218.178-.506.475-.862l6.77-9.414c.539-.91 1.605-.85 3.199.18 1.594 1.032 2.188 1.928 1.784 2.686l-5.877 10.36c-.158.412-.333.673-.526.782-.193.108-.604.179-1.232.21-.362.131-.608.237-.738.318-.13.081-.305.238-.526.47-.293.265-.504.397-.632.397-.096 0-.27-.075-.524-.226l-.31.41-1.6-1.12zm-.279.415 1.575 1.103-.392.515H1.19l1.087-1.618zm8.1-13.656-4.953 6.9L8.75 12.57l4.247-7.574c.175-.25-.188-.647-1.092-1.192-.903-.546-1.412-.652-1.528-.32zM8.244 18.5 9.59 17h9.406v1.5H8.245z\"/></svg>";
208
-
209
- var penIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ck-icon__fill\" d=\"M10.126 2.268 2.002 13.874l1.895 1.852 2.521 1.402L14.47 5.481l-1.543-2.568-2.801-.645z\"/><path d=\"m4.5 18.088-2.645-1.852-.04-2.95-.006-.005.006-.008v-.025l.011.008L8.73 2.97c.165-.233.356-.417.567-.557l-1.212.308L4.604 7.9l-.83-.558 3.694-5.495 2.708-.69 1.65 1.145.046.018.85-1.216 2.16 1.512-.856 1.222c.828.967 1.144 2.141.432 3.158L7.55 17.286l.006.005-3.055.797H4.5zm-.634.166-1.976.516-.026-1.918 2.002 1.402zM9.968 3.817l-.006-.004-6.123 9.184 3.277 2.294 6.108-9.162.005.003c.317-.452-.16-1.332-1.064-1.966-.891-.624-1.865-.776-2.197-.349zM8.245 18.5 9.59 17h9.406v1.5H8.245z\"/></svg>";
210
-
211
- /**
212
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
213
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
214
- */
215
- /**
216
- * @module highlight/highlightui
217
- */
218
- /**
219
- * The default highlight UI plugin. It introduces:
220
- *
221
- * * The `'highlight'` dropdown,
222
- * * The `'removeHighlight'` and `'highlight:*'` buttons.
223
- *
224
- * The default configuration includes the following buttons:
225
- *
226
- * * `'highlight:yellowMarker'`
227
- * * `'highlight:greenMarker'`
228
- * * `'highlight:pinkMarker'`
229
- * * `'highlight:blueMarker'`
230
- * * `'highlight:redPen'`
231
- * * `'highlight:greenPen'`
232
- *
233
- * See the {@link module:highlight/highlightconfig~HighlightConfig#options configuration} to learn more
234
- * about the defaults.
235
- */
236
- class HighlightUI extends Plugin {
237
- /**
238
- * Returns the localized option titles provided by the plugin.
239
- *
240
- * The following localized titles corresponding with default
241
- * {@link module:highlight/highlightconfig~HighlightConfig#options} are available:
242
- *
243
- * * `'Yellow marker'`,
244
- * * `'Green marker'`,
245
- * * `'Pink marker'`,
246
- * * `'Blue marker'`,
247
- * * `'Red pen'`,
248
- * * `'Green pen'`.
249
- */
250
- get localizedOptionTitles() {
251
- const t = this.editor.t;
252
- return {
253
- 'Yellow marker': t('Yellow marker'),
254
- 'Green marker': t('Green marker'),
255
- 'Pink marker': t('Pink marker'),
256
- 'Blue marker': t('Blue marker'),
257
- 'Red pen': t('Red pen'),
258
- 'Green pen': t('Green pen')
259
- };
260
- }
261
- /**
262
- * @inheritDoc
263
- */
264
- static get pluginName() {
265
- return 'HighlightUI';
266
- }
267
- /**
268
- * @inheritDoc
269
- */
270
- init() {
271
- const options = this.editor.config.get('highlight.options');
272
- for (const option of options) {
273
- this._addHighlighterButton(option);
274
- }
275
- this._addRemoveHighlightButton();
276
- this._addDropdown(options);
277
- }
278
- /**
279
- * Creates the "Remove highlight" button.
280
- */
281
- _addRemoveHighlightButton() {
282
- const t = this.editor.t;
283
- const command = this.editor.commands.get('highlight');
284
- this._addButton('removeHighlight', t('Remove highlight'), icons.eraser, null, button => {
285
- button.bind('isEnabled').to(command, 'isEnabled');
286
- });
287
- }
288
- /**
289
- * Creates a toolbar button from the provided highlight option.
290
- */
291
- _addHighlighterButton(option) {
292
- const command = this.editor.commands.get('highlight');
293
- // TODO: change naming
294
- this._addButton('highlight:' + option.model, option.title, getIconForType(option.type), option.model, decorateHighlightButton);
295
- function decorateHighlightButton(button) {
296
- button.bind('isEnabled').to(command, 'isEnabled');
297
- button.bind('isOn').to(command, 'value', value => value === option.model);
298
- button.iconView.fillColor = option.color;
299
- button.isToggleable = true;
300
- }
301
- }
302
- /**
303
- * Internal method for creating highlight buttons.
304
- *
305
- * @param name The name of the button.
306
- * @param label The label for the button.
307
- * @param icon The button icon.
308
- * @param value The `value` property passed to the executed command.
309
- * @param decorateButton A callback getting ButtonView instance so that it can be further customized.
310
- */
311
- _addButton(name, label, icon, value, decorateButton) {
312
- const editor = this.editor;
313
- editor.ui.componentFactory.add(name, locale => {
314
- const buttonView = new ButtonView(locale);
315
- const localized = this.localizedOptionTitles[label] ? this.localizedOptionTitles[label] : label;
316
- buttonView.set({
317
- label: localized,
318
- icon,
319
- tooltip: true
320
- });
321
- buttonView.on('execute', () => {
322
- editor.execute('highlight', { value });
323
- editor.editing.view.focus();
324
- });
325
- // Add additional behavior for buttonView.
326
- decorateButton(buttonView);
327
- return buttonView;
328
- });
329
- }
330
- /**
331
- * Creates the split button dropdown UI from the provided highlight options.
332
- */
333
- _addDropdown(options) {
334
- const editor = this.editor;
335
- const t = editor.t;
336
- const componentFactory = editor.ui.componentFactory;
337
- const startingHighlighter = options[0];
338
- const optionsMap = options.reduce((retVal, option) => {
339
- retVal[option.model] = option;
340
- return retVal;
341
- }, {});
342
- componentFactory.add('highlight', locale => {
343
- const command = editor.commands.get('highlight');
344
- const dropdownView = createDropdown(locale, SplitButtonView);
345
- const splitButtonView = dropdownView.buttonView;
346
- splitButtonView.set({
347
- label: t('Highlight'),
348
- tooltip: true,
349
- // Holds last executed highlighter.
350
- lastExecuted: startingHighlighter.model,
351
- // Holds current highlighter to execute (might be different then last used).
352
- commandValue: startingHighlighter.model,
353
- isToggleable: true
354
- });
355
- // Dropdown button changes to selection (command.value):
356
- // - If selection is in highlight it get active highlight appearance (icon, color) and is activated.
357
- // - Otherwise it gets appearance (icon, color) of last executed highlight.
358
- splitButtonView.bind('icon').to(command, 'value', value => getIconForType(getActiveOption(value, 'type')));
359
- splitButtonView.bind('color').to(command, 'value', value => getActiveOption(value, 'color'));
360
- splitButtonView.bind('commandValue').to(command, 'value', value => getActiveOption(value, 'model'));
361
- splitButtonView.bind('isOn').to(command, 'value', value => !!value);
362
- splitButtonView.delegate('execute').to(dropdownView);
363
- // Create buttons array.
364
- const buttonsCreator = () => {
365
- const buttons = options.map(option => {
366
- // Get existing highlighter button.
367
- const buttonView = componentFactory.create('highlight:' + option.model);
368
- // Update lastExecutedHighlight on execute.
369
- this.listenTo(buttonView, 'execute', () => {
370
- dropdownView.buttonView.set({ lastExecuted: option.model });
371
- });
372
- return buttonView;
373
- });
374
- // Add separator and eraser buttons to dropdown.
375
- buttons.push(new ToolbarSeparatorView());
376
- buttons.push(componentFactory.create('removeHighlight'));
377
- return buttons;
378
- };
379
- // Make toolbar button enabled when any button in dropdown is enabled before adding separator and eraser.
380
- dropdownView.bind('isEnabled').to(command, 'isEnabled');
381
- addToolbarToDropdown(dropdownView, buttonsCreator, {
382
- enableActiveItemFocusOnDropdownOpen: true,
383
- ariaLabel: t('Text highlight toolbar')
384
- });
385
- bindToolbarIconStyleToActiveColor(dropdownView);
386
- // Execute current action from dropdown's split button action button.
387
- splitButtonView.on('execute', () => {
388
- editor.execute('highlight', { value: splitButtonView.commandValue });
389
- });
390
- // Focus the editable after executing the command.
391
- // It overrides a default behaviour where the focus is moved to the dropdown button (#12125).
392
- this.listenTo(dropdownView, 'execute', () => {
393
- editor.editing.view.focus();
394
- });
395
- /**
396
- * Returns active highlighter option depending on current command value.
397
- * If current is not set or it is the same as last execute this method will return the option key (like icon or color)
398
- * of last executed highlighter. Otherwise it will return option key for current one.
399
- */
400
- function getActiveOption(current, key) {
401
- const whichHighlighter = !current ||
402
- current === splitButtonView.lastExecuted ? splitButtonView.lastExecuted : current;
403
- return optionsMap[whichHighlighter][key];
404
- }
405
- return dropdownView;
406
- });
407
- }
408
- }
409
- /**
410
- * Extends split button icon style to reflect last used button style.
411
- */
412
- function bindToolbarIconStyleToActiveColor(dropdownView) {
413
- const actionView = dropdownView.buttonView.actionView;
414
- actionView.iconView.bind('fillColor').to(dropdownView.buttonView, 'color');
415
- }
416
- /**
417
- * Returns icon for given highlighter type.
418
- */
419
- function getIconForType(type) {
420
- return type === 'marker' ? markerIcon : penIcon;
421
- }
422
-
423
- /**
424
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
425
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
426
- */
427
- /**
428
- * @module highlight/highlight
429
- */
430
- /**
431
- * The highlight plugin.
432
- *
433
- * For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.
434
- *
435
- * This is a "glue" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and
436
- * {@link module:highlight/highlightui~HighlightUI} plugins.
437
- */
438
- class Highlight extends Plugin {
439
- /**
440
- * @inheritDoc
441
- */
442
- static get requires() {
443
- return [HighlightEditing, HighlightUI];
444
- }
445
- /**
446
- * @inheritDoc
447
- */
448
- static get pluginName() {
449
- return 'Highlight';
450
- }
451
- }
452
-
453
- export { Highlight, HighlightEditing, HighlightUI };
454
- //# sourceMappingURL=index.js.map