@licium/editor-plugin-color-syntax 3.2.11 → 3.2.13
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.
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* TOAST UI Editor : Color Syntax Plugin
|
|
3
|
-
* @version 3.2.
|
|
3
|
+
* @version 3.2.13 | Fri Jan 09 2026
|
|
4
4
|
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
.toastui-editor-popup-color {
|
|
9
8
|
padding: 0;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.toastui-editor-popup-color .tui-colorpicker-container,
|
|
13
12
|
.toastui-editor-popup-color .tui-colorpicker-palette-container {
|
|
14
|
-
width:
|
|
13
|
+
width: 178px;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
.toastui-editor-popup-color .tui-colorpicker-container ul {
|
|
18
|
-
width:
|
|
17
|
+
width: 178px;
|
|
19
18
|
margin-bottom: 10px;
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -62,16 +61,17 @@
|
|
|
62
61
|
|
|
63
62
|
.toastui-editor-popup-color button {
|
|
64
63
|
height: 32px;
|
|
65
|
-
width: 40px;
|
|
66
64
|
color: #555;
|
|
67
65
|
background: #f7f9fc;
|
|
68
66
|
border: 1px solid #e1e3e9;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
padding: 0 8px;
|
|
69
|
+
width: auto;
|
|
70
|
+
min-width: 40px;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
.toastui-editor-popup-color button:hover {
|
|
74
|
+
background-color: #dff4ff !important;
|
|
75
75
|
border-color: #cbcfdb;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -138,3 +138,13 @@
|
|
|
138
138
|
border-color: rgba(255, 255, 255, 0.05);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
.toastui-editor-button-container {
|
|
142
|
+
display: flex;
|
|
143
|
+
justify-content: flex-end;
|
|
144
|
+
margin-top: 10px;
|
|
145
|
+
padding-right: 2px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.toastui-editor-button-container button {
|
|
149
|
+
margin-left: 5px;
|
|
150
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* TOAST UI Editor : Color Syntax Plugin
|
|
3
|
-
* @version 3.2.
|
|
3
|
+
* @version 3.2.13 | Fri Jan 09 2026
|
|
4
4
|
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -223,9 +223,9 @@ function createToolbarItemOption(colorPickerContainer, i18n) {
|
|
|
223
223
|
return {
|
|
224
224
|
name: 'color',
|
|
225
225
|
tooltip: i18n.get('Text color'),
|
|
226
|
-
className: PREFIX
|
|
226
|
+
className: "".concat(PREFIX, "toolbar-icons color"),
|
|
227
227
|
popup: {
|
|
228
|
-
className: PREFIX
|
|
228
|
+
className: "".concat(PREFIX, "popup-color"),
|
|
229
229
|
body: colorPickerContainer,
|
|
230
230
|
style: { width: 'auto' },
|
|
231
231
|
},
|
|
@@ -241,8 +241,8 @@ function createSelection(tr, selection, SelectionClass, openTag, closeTag) {
|
|
|
241
241
|
: SelectionClass.create(doc, mappedFrom, mappedTo);
|
|
242
242
|
}
|
|
243
243
|
function getCurrentEditorEl(colorPickerEl, containerClassName) {
|
|
244
|
-
var editorDefaultEl = findParentByClassName(colorPickerEl, PREFIX
|
|
245
|
-
return editorDefaultEl.querySelector("."
|
|
244
|
+
var editorDefaultEl = findParentByClassName(colorPickerEl, "".concat(PREFIX, "defaultUI"));
|
|
245
|
+
return editorDefaultEl.querySelector(".".concat(containerClassName, " .ProseMirror"));
|
|
246
246
|
}
|
|
247
247
|
var containerClassName;
|
|
248
248
|
var currentEditorEl;
|
|
@@ -268,7 +268,7 @@ function colorSyntaxPlugin(context, options) {
|
|
|
268
268
|
var button = createApplyButton(i18n.get('OK'));
|
|
269
269
|
var clearButton = createApplyButton(i18n.get('Clear')); // @TODO: Add translation key if needed
|
|
270
270
|
eventEmitter.listen('focus', function (editType) {
|
|
271
|
-
containerClassName = ""
|
|
271
|
+
containerClassName = "".concat(PREFIX).concat(editType === 'markdown' ? 'md' : 'ww', "-container");
|
|
272
272
|
});
|
|
273
273
|
container.addEventListener('click', function (ev) {
|
|
274
274
|
if (ev.target.getAttribute('type') === 'button') {
|
|
@@ -281,12 +281,15 @@ function colorSyntaxPlugin(context, options) {
|
|
|
281
281
|
eventEmitter.emit('command', 'color', { selectedColor: selectedColor });
|
|
282
282
|
eventEmitter.emit('closePopup');
|
|
283
283
|
// force the current editor to focus for preventing to lose focus
|
|
284
|
-
currentEditorEl.focus();
|
|
284
|
+
currentEditorEl.focus({ preventScroll: true });
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
colorPicker.slider.toggle(true);
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
var buttonContainer = document.createElement('div');
|
|
289
|
+
buttonContainer.className = "".concat(PREFIX, "button-container");
|
|
290
|
+
buttonContainer.appendChild(button);
|
|
291
|
+
buttonContainer.appendChild(clearButton);
|
|
292
|
+
container.appendChild(buttonContainer);
|
|
290
293
|
var toolbarItem = createToolbarItemOption(container, i18n);
|
|
291
294
|
return {
|
|
292
295
|
markdownCommands: {
|
|
@@ -296,9 +299,9 @@ function colorSyntaxPlugin(context, options) {
|
|
|
296
299
|
if (selectedColor) {
|
|
297
300
|
var slice = selection.content();
|
|
298
301
|
var textContent = slice.content.textBetween(0, slice.content.size, '\n');
|
|
299
|
-
var openTag = "<span style=\"color: "
|
|
302
|
+
var openTag = "<span style=\"color: ".concat(selectedColor, "\">");
|
|
300
303
|
var closeTag = "</span>";
|
|
301
|
-
var colored = ""
|
|
304
|
+
var colored = "".concat(openTag).concat(textContent).concat(closeTag);
|
|
302
305
|
tr.replaceSelectionWith(schema.text(colored)).setSelection(createSelection(tr, selection, pmState.TextSelection, openTag, closeTag));
|
|
303
306
|
dispatch(tr);
|
|
304
307
|
return true;
|
|
@@ -323,7 +326,7 @@ function colorSyntaxPlugin(context, options) {
|
|
|
323
326
|
var tr = _b.tr, selection = _b.selection, schema = _b.schema;
|
|
324
327
|
if (selectedColor) {
|
|
325
328
|
var from = selection.from, to = selection.to;
|
|
326
|
-
var attrs = { htmlAttrs: { style: "color: "
|
|
329
|
+
var attrs = { htmlAttrs: { style: "color: ".concat(selectedColor) } };
|
|
327
330
|
var mark = schema.marks.span.create(attrs);
|
|
328
331
|
tr.addMark(from, to, mark);
|
|
329
332
|
dispatch(tr);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licium/editor-plugin-color-syntax",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.13",
|
|
4
4
|
"description": "TOAST UI Editor : Color Syntax Plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nhn",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "019ce2e0c8210746f0072903ebec7efe79a8374a"
|
|
55
55
|
}
|