ninegrid2 6.1301.0 → 6.1303.0
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/bundle.cjs.js +150 -3141
- package/dist/bundle.esm.js +150 -3141
- package/dist/nx/nxEditor.js +1 -1
- package/package.json +1 -1
- package/src/nx/nxEditor.js +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -2,21 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _mergeNamespaces(n, m) {
|
|
6
|
-
m.forEach(function (e) {
|
|
7
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
8
|
-
if (k !== 'default' && !(k in n)) {
|
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () { return e[k]; }
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
return Object.freeze(n);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
21
6
|
|
|
22
7
|
function getDefaultExportFromCjs (x) {
|
|
@@ -29133,10 +29118,7 @@ const env = {
|
|
|
29133
29118
|
isSafari: /* #__PURE__ */ isSafari(userAgent),
|
|
29134
29119
|
isiOS: /* #__PURE__ */ isiOS(userAgent),
|
|
29135
29120
|
isAndroid: /* #__PURE__ */ isAndroid(userAgent),
|
|
29136
|
-
isBlink: /* #__PURE__ */ isBlink(userAgent)
|
|
29137
|
-
get isMediaForcedColors() {
|
|
29138
|
-
return isMediaForcedColors();
|
|
29139
|
-
}};
|
|
29121
|
+
isBlink: /* #__PURE__ */ isBlink(userAgent)};
|
|
29140
29122
|
/**
|
|
29141
29123
|
* Checks if User Agent represented by the string is running on Macintosh.
|
|
29142
29124
|
*
|
|
@@ -29203,14 +29185,6 @@ function isBlink(userAgent) {
|
|
|
29203
29185
|
// but after switching to the Blink it replaced "Edge/" with "Edg/".
|
|
29204
29186
|
return userAgent.indexOf('chrome/') > -1 && userAgent.indexOf('edge/') < 0;
|
|
29205
29187
|
}
|
|
29206
|
-
/**
|
|
29207
|
-
* Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).
|
|
29208
|
-
*
|
|
29209
|
-
* Returns `false` in environments where `window` global object is not available.
|
|
29210
|
-
*/
|
|
29211
|
-
function isMediaForcedColors() {
|
|
29212
|
-
return global$1.window.matchMedia ? global$1.window.matchMedia('(forced-colors: active)').matches : false;
|
|
29213
|
-
}
|
|
29214
29188
|
|
|
29215
29189
|
/**
|
|
29216
29190
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -41562,8 +41536,8 @@ function styleInject(css, ref) {
|
|
|
41562
41536
|
}
|
|
41563
41537
|
}
|
|
41564
41538
|
|
|
41565
|
-
var css_248z$
|
|
41566
|
-
styleInject(css_248z$
|
|
41539
|
+
var css_248z$1d = "@import \"./_hidden.css\";@import \"./_zindex.css\";@import \"./_transition.css\";@import \"./_poweredby.css\";@import \"./_evaluationbadge.css\";";
|
|
41540
|
+
styleInject(css_248z$1d);
|
|
41567
41541
|
|
|
41568
41542
|
/**
|
|
41569
41543
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -42116,7 +42090,7 @@ function submitHandler({ view }) {
|
|
|
42116
42090
|
* @param options.uiLanguageDirection String of ui language direction.
|
|
42117
42091
|
*/
|
|
42118
42092
|
function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns, uiLanguageDirection }) {
|
|
42119
|
-
const getNumberOfColumns =
|
|
42093
|
+
const getNumberOfColumns = () => numberOfColumns ;
|
|
42120
42094
|
keystrokeHandler.set('arrowright', getGridItemFocuser((focusedElementIndex, gridItems) => {
|
|
42121
42095
|
return uiLanguageDirection === 'rtl' ?
|
|
42122
42096
|
getLeftElementIndex(focusedElementIndex, gridItems.length) :
|
|
@@ -43214,8 +43188,8 @@ let Context$1 = class Context {
|
|
|
43214
43188
|
}
|
|
43215
43189
|
};
|
|
43216
43190
|
|
|
43217
|
-
var css_248z$
|
|
43218
|
-
styleInject(css_248z$
|
|
43191
|
+
var css_248z$1c = ".ck .ck-placeholder,.ck.ck-placeholder{position:relative;&:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}}.ck.ck-read-only .ck-placeholder{&:before{display:none}}.ck.ck-reset_all .ck-placeholder{position:relative}";
|
|
43192
|
+
styleInject(css_248z$1c);
|
|
43219
43193
|
|
|
43220
43194
|
/**
|
|
43221
43195
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -50951,8 +50925,8 @@ function jumpOverInlineFiller(evt, data) {
|
|
|
50951
50925
|
}
|
|
50952
50926
|
}
|
|
50953
50927
|
|
|
50954
|
-
var css_248z$
|
|
50955
|
-
styleInject(css_248z$
|
|
50928
|
+
var css_248z$1b = ".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}";
|
|
50929
|
+
styleInject(css_248z$1b);
|
|
50956
50930
|
|
|
50957
50931
|
/**
|
|
50958
50932
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -79620,193 +79594,6 @@ class MouseObserver extends DomEventObserver {
|
|
|
79620
79594
|
}
|
|
79621
79595
|
}
|
|
79622
79596
|
|
|
79623
|
-
/**
|
|
79624
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
79625
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
79626
|
-
*/
|
|
79627
|
-
const HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
79628
|
-
const RGB_COLOR_REGEXP = /^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;
|
|
79629
|
-
const RGBA_COLOR_REGEXP = /^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
|
|
79630
|
-
const HSL_COLOR_REGEXP = /^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;
|
|
79631
|
-
const HSLA_COLOR_REGEXP = /^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
|
|
79632
|
-
// Note: This regexp hardcodes a single level of nested () for values such as `calc( var( ...) + ...)`.
|
|
79633
|
-
// If this gets more complex, a proper parser should be used instead.
|
|
79634
|
-
const CSS_SHORTHAND_VALUE_REGEXP = /\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi;
|
|
79635
|
-
const COLOR_NAMES = new Set([
|
|
79636
|
-
// CSS Level 1
|
|
79637
|
-
'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',
|
|
79638
|
-
'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',
|
|
79639
|
-
// CSS Level 2 (Revision 1)
|
|
79640
|
-
'orange',
|
|
79641
|
-
// CSS Color Module Level 3
|
|
79642
|
-
'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown',
|
|
79643
|
-
'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',
|
|
79644
|
-
'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta',
|
|
79645
|
-
'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue',
|
|
79646
|
-
'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',
|
|
79647
|
-
'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',
|
|
79648
|
-
'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',
|
|
79649
|
-
'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray',
|
|
79650
|
-
'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray',
|
|
79651
|
-
'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',
|
|
79652
|
-
'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',
|
|
79653
|
-
'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',
|
|
79654
|
-
'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',
|
|
79655
|
-
'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',
|
|
79656
|
-
'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
|
|
79657
|
-
'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',
|
|
79658
|
-
// CSS Color Module Level 3 (System Colors)
|
|
79659
|
-
'activeborder', 'activecaption', 'appworkspace', 'background', 'buttonface', 'buttonhighlight', 'buttonshadow',
|
|
79660
|
-
'buttontext', 'captiontext', 'graytext', 'highlight', 'highlighttext', 'inactiveborder', 'inactivecaption',
|
|
79661
|
-
'inactivecaptiontext', 'infobackground', 'infotext', 'menu', 'menutext', 'scrollbar', 'threeddarkshadow',
|
|
79662
|
-
'threedface', 'threedhighlight', 'threedlightshadow', 'threedshadow', 'window', 'windowframe', 'windowtext',
|
|
79663
|
-
// CSS Color Module Level 4
|
|
79664
|
-
'rebeccapurple',
|
|
79665
|
-
// Keywords
|
|
79666
|
-
'currentcolor', 'transparent'
|
|
79667
|
-
]);
|
|
79668
|
-
/**
|
|
79669
|
-
* Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
|
|
79670
|
-
*
|
|
79671
|
-
* ```ts
|
|
79672
|
-
* isColor( '#f00' ); // true
|
|
79673
|
-
* isColor( '#AA00BB33' ); // true
|
|
79674
|
-
* isColor( 'rgb(0, 0, 250)' ); // true
|
|
79675
|
-
* isColor( 'hsla(240, 100%, 50%, .7)' ); // true
|
|
79676
|
-
* isColor( 'deepskyblue' ); // true
|
|
79677
|
-
* ```
|
|
79678
|
-
*
|
|
79679
|
-
* **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
|
|
79680
|
-
*/
|
|
79681
|
-
function isColor(string) {
|
|
79682
|
-
// As far as I was able to test checking some pre-conditions is faster than joining each test with ||.
|
|
79683
|
-
if (string.startsWith('#')) {
|
|
79684
|
-
return HEX_COLOR_REGEXP.test(string);
|
|
79685
|
-
}
|
|
79686
|
-
if (string.startsWith('rgb')) {
|
|
79687
|
-
return RGB_COLOR_REGEXP.test(string) || RGBA_COLOR_REGEXP.test(string);
|
|
79688
|
-
}
|
|
79689
|
-
if (string.startsWith('hsl')) {
|
|
79690
|
-
return HSL_COLOR_REGEXP.test(string) || HSLA_COLOR_REGEXP.test(string);
|
|
79691
|
-
}
|
|
79692
|
-
// Array check > RegExp test.
|
|
79693
|
-
return COLOR_NAMES.has(string.toLowerCase());
|
|
79694
|
-
}
|
|
79695
|
-
const repeatValues = ['repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat'];
|
|
79696
|
-
/**
|
|
79697
|
-
* Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
|
|
79698
|
-
*/
|
|
79699
|
-
function isRepeat(string) {
|
|
79700
|
-
return repeatValues.includes(string);
|
|
79701
|
-
}
|
|
79702
|
-
const positionValues = ['center', 'top', 'bottom', 'left', 'right'];
|
|
79703
|
-
/**
|
|
79704
|
-
* Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
|
|
79705
|
-
*/
|
|
79706
|
-
function isPosition(string) {
|
|
79707
|
-
return positionValues.includes(string);
|
|
79708
|
-
}
|
|
79709
|
-
const attachmentValues = ['fixed', 'scroll', 'local'];
|
|
79710
|
-
/**
|
|
79711
|
-
* Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
|
|
79712
|
-
*/
|
|
79713
|
-
function isAttachment(string) {
|
|
79714
|
-
return attachmentValues.includes(string);
|
|
79715
|
-
}
|
|
79716
|
-
const urlRegExp = /^url\(/;
|
|
79717
|
-
/**
|
|
79718
|
-
* Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
|
|
79719
|
-
*/
|
|
79720
|
-
function isURL(string) {
|
|
79721
|
-
return urlRegExp.test(string);
|
|
79722
|
-
}
|
|
79723
|
-
/**
|
|
79724
|
-
* Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
|
|
79725
|
-
*
|
|
79726
|
-
* ```ts
|
|
79727
|
-
* getShorthandValues( 'red blue RGB(0, 0, 0)');
|
|
79728
|
-
* // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
|
|
79729
|
-
* ```
|
|
79730
|
-
*/
|
|
79731
|
-
function getShorthandValues(string) {
|
|
79732
|
-
const matches = string.trim().slice(0, 1500).matchAll(CSS_SHORTHAND_VALUE_REGEXP);
|
|
79733
|
-
return Array.from(matches).map(i => i[0]);
|
|
79734
|
-
}
|
|
79735
|
-
|
|
79736
|
-
/**
|
|
79737
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
79738
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
79739
|
-
*/
|
|
79740
|
-
/**
|
|
79741
|
-
* Adds a background CSS styles processing rules.
|
|
79742
|
-
*
|
|
79743
|
-
* ```ts
|
|
79744
|
-
* editor.data.addStyleProcessorRules( addBackgroundRules );
|
|
79745
|
-
* ```
|
|
79746
|
-
*
|
|
79747
|
-
* The normalized value is stored as:
|
|
79748
|
-
*
|
|
79749
|
-
* ```ts
|
|
79750
|
-
* const styles = {
|
|
79751
|
-
* background: {
|
|
79752
|
-
* color,
|
|
79753
|
-
* repeat,
|
|
79754
|
-
* position,
|
|
79755
|
-
* attachment,
|
|
79756
|
-
* image
|
|
79757
|
-
* }
|
|
79758
|
-
* };
|
|
79759
|
-
* ````
|
|
79760
|
-
*
|
|
79761
|
-
* **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only
|
|
79762
|
-
* `'background-color'` value.
|
|
79763
|
-
*/
|
|
79764
|
-
function addBackgroundRules(stylesProcessor) {
|
|
79765
|
-
stylesProcessor.setNormalizer('background', getBackgroundNormalizer());
|
|
79766
|
-
stylesProcessor.setNormalizer('background-color', getBackgroundColorNormalizer());
|
|
79767
|
-
stylesProcessor.setReducer('background', getBackgroundReducer());
|
|
79768
|
-
stylesProcessor.setStyleRelation('background', ['background-color']);
|
|
79769
|
-
}
|
|
79770
|
-
function getBackgroundNormalizer() {
|
|
79771
|
-
return value => {
|
|
79772
|
-
const background = {};
|
|
79773
|
-
const parts = getShorthandValues(value);
|
|
79774
|
-
for (const part of parts) {
|
|
79775
|
-
if (isRepeat(part)) {
|
|
79776
|
-
background.repeat = background.repeat || [];
|
|
79777
|
-
background.repeat.push(part);
|
|
79778
|
-
}
|
|
79779
|
-
else if (isPosition(part)) {
|
|
79780
|
-
background.position = background.position || [];
|
|
79781
|
-
background.position.push(part);
|
|
79782
|
-
}
|
|
79783
|
-
else if (isAttachment(part)) {
|
|
79784
|
-
background.attachment = part;
|
|
79785
|
-
}
|
|
79786
|
-
else if (isColor(part)) {
|
|
79787
|
-
background.color = part;
|
|
79788
|
-
}
|
|
79789
|
-
else if (isURL(part)) {
|
|
79790
|
-
background.image = part;
|
|
79791
|
-
}
|
|
79792
|
-
}
|
|
79793
|
-
return {
|
|
79794
|
-
path: 'background',
|
|
79795
|
-
value: background
|
|
79796
|
-
};
|
|
79797
|
-
};
|
|
79798
|
-
}
|
|
79799
|
-
function getBackgroundColorNormalizer() {
|
|
79800
|
-
return value => ({ path: 'background.color', value });
|
|
79801
|
-
}
|
|
79802
|
-
function getBackgroundReducer() {
|
|
79803
|
-
return value => {
|
|
79804
|
-
const ret = [];
|
|
79805
|
-
ret.push(['background-color', value.color]);
|
|
79806
|
-
return ret;
|
|
79807
|
-
};
|
|
79808
|
-
}
|
|
79809
|
-
|
|
79810
79597
|
/**
|
|
79811
79598
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
79812
79599
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -82367,10 +82154,6 @@ var cancel = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><p
|
|
|
82367
82154
|
|
|
82368
82155
|
var check = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z\"/></svg>";
|
|
82369
82156
|
|
|
82370
|
-
var colorPalette = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.209 18.717A8.5 8.5 0 1 1 18.686 9.6h-.008l.002.12a3 3 0 0 1-2.866 2.997h-.268l-.046-.002v.002h-4.791a2 2 0 1 0 0 4 1 1 0 1 1-.128 1.992 8.665 8.665 0 0 1-.372.008Zm-3.918-7.01a1.25 1.25 0 1 0-2.415-.648 1.25 1.25 0 0 0 2.415.647ZM5.723 8.18a1.25 1.25 0 1 0 .647-2.414 1.25 1.25 0 0 0-.647 2.414ZM9.76 6.155a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Zm4.028 1.759a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Z\"/></svg>";
|
|
82371
|
-
|
|
82372
|
-
var eraser = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z\"/><path d=\"M4 18h5.523v-1H4zm-2 0h1v-1H2z\"/></svg>";
|
|
82373
|
-
|
|
82374
82157
|
var loupe = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.68 13.74h-.001l4.209 4.208a1 1 0 1 0 1.414-1.414l-4.267-4.268a6 6 0 1 0-1.355 1.474ZM13 9a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z\"/></svg>";
|
|
82375
82158
|
|
|
82376
82159
|
var previousArrow = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z\"/></svg>";
|
|
@@ -82420,8 +82203,6 @@ const icons = {
|
|
|
82420
82203
|
bold,
|
|
82421
82204
|
cancel,
|
|
82422
82205
|
check,
|
|
82423
|
-
colorPalette,
|
|
82424
|
-
eraser,
|
|
82425
82206
|
loupe,
|
|
82426
82207
|
previousArrow,
|
|
82427
82208
|
nextArrow,
|
|
@@ -82441,8 +82222,8 @@ const icons = {
|
|
|
82441
82222
|
numberedList,
|
|
82442
82223
|
table};
|
|
82443
82224
|
|
|
82444
|
-
var css_248z$
|
|
82445
|
-
styleInject(css_248z$
|
|
82225
|
+
var css_248z$1a = ".ck.ck-icon{vertical-align:middle}";
|
|
82226
|
+
styleInject(css_248z$1a);
|
|
82446
82227
|
|
|
82447
82228
|
/**
|
|
82448
82229
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -82600,8 +82381,8 @@ class ButtonLabelView extends View$1 {
|
|
|
82600
82381
|
}
|
|
82601
82382
|
}
|
|
82602
82383
|
|
|
82603
|
-
var css_248z$
|
|
82604
|
-
styleInject(css_248z$
|
|
82384
|
+
var css_248z$19 = "@import \"../../mixins/_unselectable.css\";@import \"../../mixins/_dir.css\";.ck.ck-button,a.ck.ck-button{@mixin ck-unselectable;align-items:center;display:inline-flex;position:relative;@mixin ck-dir ltr{justify-content:left}@mixin ck-dir rtl{justify-content:right}& .ck-button__label{display:none}&.ck-button_with-text{& .ck-button__label{display:inline-block}}&:not(.ck-button_with-text){justify-content:center}}";
|
|
82385
|
+
styleInject(css_248z$19);
|
|
82605
82386
|
|
|
82606
82387
|
/**
|
|
82607
82388
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -82847,8 +82628,8 @@ function isCheckableRole(role) {
|
|
|
82847
82628
|
}
|
|
82848
82629
|
}
|
|
82849
82630
|
|
|
82850
|
-
var css_248z$
|
|
82851
|
-
styleInject(css_248z$
|
|
82631
|
+
var css_248z$18 = ".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;& h2.ck-form__header__label{flex-grow:1}}";
|
|
82632
|
+
styleInject(css_248z$18);
|
|
82852
82633
|
|
|
82853
82634
|
/**
|
|
82854
82635
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -83413,8 +83194,8 @@ function DraggableViewMixin(view) {
|
|
|
83413
83194
|
return DraggableMixin;
|
|
83414
83195
|
}
|
|
83415
83196
|
|
|
83416
|
-
var css_248z$
|
|
83417
|
-
styleInject(css_248z$
|
|
83197
|
+
var css_248z$17 = ".ck.ck-dialog{& .ck.ck-dialog__actions{display:flex;justify-content:flex-end}}";
|
|
83198
|
+
styleInject(css_248z$17);
|
|
83418
83199
|
|
|
83419
83200
|
/**
|
|
83420
83201
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -83544,8 +83325,8 @@ class DialogContentView extends View$1 {
|
|
|
83544
83325
|
}
|
|
83545
83326
|
}
|
|
83546
83327
|
|
|
83547
|
-
var css_248z$
|
|
83548
|
-
styleInject(css_248z$
|
|
83328
|
+
var css_248z$16 = ".ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none;&.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content;& .ck.ck-form__header{flex-shrink:0}&:not(.ck-dialog_modal){& .ck.ck-form__header .ck-form__header__label{cursor:grab}}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent &{pointer-events:all}}";
|
|
83329
|
+
styleInject(css_248z$16);
|
|
83549
83330
|
|
|
83550
83331
|
/**
|
|
83551
83332
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -84305,8 +84086,8 @@ class Dialog extends Plugin {
|
|
|
84305
84086
|
}
|
|
84306
84087
|
}
|
|
84307
84088
|
|
|
84308
|
-
var css_248z$
|
|
84309
|
-
styleInject(css_248z$
|
|
84089
|
+
var css_248z$15 = "@import \"../../mixins/_dir.css\";.ck.ck-list-item-button{border-radius:0;min-height:unset;width:100%;@mixin ck-dir ltr{text-align:left}@mixin ck-dir rtl{text-align:right}&.ck-list-item-button_toggleable{@mixin ck-dir ltr{padding-left:var(--ck-spacing-small)}@mixin ck-dir rtl{padding-right:var(--ck-spacing-small)}}& .ck-list-item-button__check-holder{display:inline-flex;height:.9em;width:.9em;@mixin ck-dir ltr{margin-right:var(--ck-spacing-small)}@mixin ck-dir rtl{margin-left:var(--ck-spacing-small)}}& .ck-list-item-button__check-icon{height:100%}}";
|
|
84090
|
+
styleInject(css_248z$15);
|
|
84310
84091
|
|
|
84311
84092
|
/**
|
|
84312
84093
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -84432,8 +84213,8 @@ class CheckIconHolderView extends View$1 {
|
|
|
84432
84213
|
}
|
|
84433
84214
|
}
|
|
84434
84215
|
|
|
84435
|
-
var css_248z$
|
|
84436
|
-
styleInject(css_248z$
|
|
84216
|
+
var css_248z$14 = "";
|
|
84217
|
+
styleInject(css_248z$14);
|
|
84437
84218
|
|
|
84438
84219
|
/**
|
|
84439
84220
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -84464,8 +84245,8 @@ class MenuBarMenuListItemButtonView extends ListItemButtonView {
|
|
|
84464
84245
|
}
|
|
84465
84246
|
}
|
|
84466
84247
|
|
|
84467
|
-
var css_248z$
|
|
84468
|
-
styleInject(css_248z$
|
|
84248
|
+
var css_248z$13 = ".ck.ck-label{display:block}.ck.ck-voice-label{display:none}";
|
|
84249
|
+
styleInject(css_248z$13);
|
|
84469
84250
|
|
|
84470
84251
|
/**
|
|
84471
84252
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -84618,8 +84399,8 @@ function normalizeKeystrokeDefinition(definition) {
|
|
|
84618
84399
|
|
|
84619
84400
|
var accessibilityIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 6.628a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\"/><path d=\"M8.5 9.125a.3.3 0 0 0-.253-.296L5.11 8.327a.75.75 0 1 1 .388-1.449l4.04.716c.267.072.624.08.893.009l4.066-.724a.75.75 0 1 1 .388 1.45l-3.132.5a.3.3 0 0 0-.253.296v1.357a.3.3 0 0 0 .018.102l1.615 4.438a.75.75 0 0 1-1.41.513l-1.35-3.71a.3.3 0 0 0-.281-.197h-.209a.3.3 0 0 0-.282.198l-1.35 3.711a.75.75 0 0 1-1.41-.513l1.64-4.509a.3.3 0 0 0 .019-.103V9.125Z\"/><path clip-rule=\"evenodd\" d=\"M10 18.5a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17Zm0 1.5c5.523 0 10-4.477 10-10S15.523 0 10 0 0 4.477 0 10s4.477 10 10 10Z\"/></svg>";
|
|
84620
84401
|
|
|
84621
|
-
var css_248z$
|
|
84622
|
-
styleInject(css_248z$
|
|
84402
|
+
var css_248z$12 = "";
|
|
84403
|
+
styleInject(css_248z$12);
|
|
84623
84404
|
|
|
84624
84405
|
/**
|
|
84625
84406
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -84873,8 +84654,8 @@ class BodyCollection extends ViewCollection {
|
|
|
84873
84654
|
}
|
|
84874
84655
|
}
|
|
84875
84656
|
|
|
84876
|
-
var css_248z$
|
|
84877
|
-
styleInject(css_248z$
|
|
84657
|
+
var css_248z$11 = ".ck.ck-button.ck-switchbutton{& .ck-button__toggle{display:block;& .ck-button__toggle__inner{display:block}}}";
|
|
84658
|
+
styleInject(css_248z$11);
|
|
84878
84659
|
|
|
84879
84660
|
/**
|
|
84880
84661
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -85068,258 +84849,11 @@ class FileInputView extends View$1 {
|
|
|
85068
84849
|
|
|
85069
84850
|
var dropdownArrowIcon = "<svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z\"/></svg>";
|
|
85070
84851
|
|
|
85071
|
-
var css_248z$
|
|
85072
|
-
styleInject(css_248z$11);
|
|
85073
|
-
|
|
85074
|
-
/**
|
|
85075
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
85076
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
85077
|
-
*/
|
|
85078
|
-
/**
|
|
85079
|
-
* Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or
|
|
85080
|
-
* `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors
|
|
85081
|
-
* but processed to account for editor localization in the correct language.
|
|
85082
|
-
*
|
|
85083
|
-
* Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
|
|
85084
|
-
* when the user configuration is defined because the editor does not exist yet.
|
|
85085
|
-
*
|
|
85086
|
-
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
85087
|
-
*/
|
|
85088
|
-
function getLocalizedColorOptions(locale, options) {
|
|
85089
|
-
const t = locale.t;
|
|
85090
|
-
const localizedColorNames = {
|
|
85091
|
-
Black: t('Black'),
|
|
85092
|
-
'Dim grey': t('Dim grey'),
|
|
85093
|
-
Grey: t('Grey'),
|
|
85094
|
-
'Light grey': t('Light grey'),
|
|
85095
|
-
White: t('White'),
|
|
85096
|
-
Red: t('Red'),
|
|
85097
|
-
Orange: t('Orange'),
|
|
85098
|
-
Yellow: t('Yellow'),
|
|
85099
|
-
'Light green': t('Light green'),
|
|
85100
|
-
Green: t('Green'),
|
|
85101
|
-
Aquamarine: t('Aquamarine'),
|
|
85102
|
-
Turquoise: t('Turquoise'),
|
|
85103
|
-
'Light blue': t('Light blue'),
|
|
85104
|
-
Blue: t('Blue'),
|
|
85105
|
-
Purple: t('Purple')
|
|
85106
|
-
};
|
|
85107
|
-
return options.map(colorOption => {
|
|
85108
|
-
const label = localizedColorNames[colorOption.label];
|
|
85109
|
-
if (label && label != colorOption.label) {
|
|
85110
|
-
colorOption.label = label;
|
|
85111
|
-
}
|
|
85112
|
-
return colorOption;
|
|
85113
|
-
});
|
|
85114
|
-
}
|
|
85115
|
-
/**
|
|
85116
|
-
* Creates a unified color definition object from color configuration options.
|
|
85117
|
-
* The object contains the information necessary to both render the UI and initialize the conversion.
|
|
85118
|
-
*/
|
|
85119
|
-
function normalizeColorOptions(options) {
|
|
85120
|
-
return options
|
|
85121
|
-
.map(normalizeSingleColorDefinition)
|
|
85122
|
-
.filter(option => !!option);
|
|
85123
|
-
}
|
|
85124
|
-
/**
|
|
85125
|
-
* Creates a normalized color definition from the user-defined configuration.
|
|
85126
|
-
* The "normalization" means it will create full
|
|
85127
|
-
* {@link module:ui/colorgrid/colorgridview~ColorDefinition `ColorDefinition-like`}
|
|
85128
|
-
* object for string values, and add a `view` property, for each definition.
|
|
85129
|
-
*/
|
|
85130
|
-
function normalizeSingleColorDefinition(color) {
|
|
85131
|
-
if (typeof color === 'string') {
|
|
85132
|
-
return {
|
|
85133
|
-
model: color,
|
|
85134
|
-
label: color,
|
|
85135
|
-
hasBorder: false,
|
|
85136
|
-
view: {
|
|
85137
|
-
name: 'span',
|
|
85138
|
-
styles: {
|
|
85139
|
-
color
|
|
85140
|
-
}
|
|
85141
|
-
}
|
|
85142
|
-
};
|
|
85143
|
-
}
|
|
85144
|
-
else {
|
|
85145
|
-
return {
|
|
85146
|
-
model: color.color,
|
|
85147
|
-
label: color.label || color.color,
|
|
85148
|
-
hasBorder: color.hasBorder === undefined ? false : color.hasBorder,
|
|
85149
|
-
view: {
|
|
85150
|
-
name: 'span',
|
|
85151
|
-
styles: {
|
|
85152
|
-
color: `${color.color}`
|
|
85153
|
-
}
|
|
85154
|
-
}
|
|
85155
|
-
};
|
|
85156
|
-
}
|
|
85157
|
-
}
|
|
85158
|
-
|
|
85159
|
-
var checkIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ck-icon__fill\" d=\"M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z\"/><path d=\"M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z\"/></svg>";
|
|
85160
|
-
|
|
85161
|
-
/**
|
|
85162
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
85163
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
85164
|
-
*/
|
|
85165
|
-
/**
|
|
85166
|
-
* @module ui/colorgrid/colortileview
|
|
85167
|
-
*/
|
|
85168
|
-
/**
|
|
85169
|
-
* This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.
|
|
85170
|
-
*/
|
|
85171
|
-
class ColorTileView extends ButtonView {
|
|
85172
|
-
constructor(locale) {
|
|
85173
|
-
super(locale);
|
|
85174
|
-
const bind = this.bindTemplate;
|
|
85175
|
-
this.set('color', undefined);
|
|
85176
|
-
this.set('hasBorder', false);
|
|
85177
|
-
this.icon = checkIcon;
|
|
85178
|
-
this.extendTemplate({
|
|
85179
|
-
attributes: {
|
|
85180
|
-
style: {
|
|
85181
|
-
// https://github.com/ckeditor/ckeditor5/issues/14907
|
|
85182
|
-
backgroundColor: bind.to('color', color => env.isMediaForcedColors ? null : color)
|
|
85183
|
-
},
|
|
85184
|
-
class: [
|
|
85185
|
-
'ck',
|
|
85186
|
-
'ck-color-grid__tile',
|
|
85187
|
-
bind.if('hasBorder', 'ck-color-selector__color-tile_bordered')
|
|
85188
|
-
]
|
|
85189
|
-
}
|
|
85190
|
-
});
|
|
85191
|
-
}
|
|
85192
|
-
/**
|
|
85193
|
-
* @inheritDoc
|
|
85194
|
-
*/
|
|
85195
|
-
render() {
|
|
85196
|
-
super.render();
|
|
85197
|
-
this.iconView.fillColor = 'hsl(0, 0%, 100%)';
|
|
85198
|
-
}
|
|
85199
|
-
}
|
|
85200
|
-
|
|
85201
|
-
var css_248z$10 = ".ck.ck-color-grid{display:grid}";
|
|
84852
|
+
var css_248z$10 = ".ck.ck-collapsible.ck-collapsible_collapsed{&>.ck-collapsible__children{display:none}}";
|
|
85202
84853
|
styleInject(css_248z$10);
|
|
85203
84854
|
|
|
85204
|
-
|
|
85205
|
-
|
|
85206
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
85207
|
-
*/
|
|
85208
|
-
/**
|
|
85209
|
-
* @module ui/colorgrid/colorgridview
|
|
85210
|
-
*/
|
|
85211
|
-
/**
|
|
85212
|
-
* A grid of {@link module:ui/colorgrid/colortileview~ColorTileView color tiles}.
|
|
85213
|
-
*/
|
|
85214
|
-
class ColorGridView extends View$1 {
|
|
85215
|
-
/**
|
|
85216
|
-
* Creates an instance of a color grid containing {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
|
|
85217
|
-
*
|
|
85218
|
-
* @fires execute
|
|
85219
|
-
* @param locale The localization services instance.
|
|
85220
|
-
* @param options Component configuration
|
|
85221
|
-
* @param options.colorDefinitions Array with definitions
|
|
85222
|
-
* required to create the {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
|
|
85223
|
-
* @param options.columns A number of columns to display the tiles.
|
|
85224
|
-
*/
|
|
85225
|
-
constructor(locale, options) {
|
|
85226
|
-
super(locale);
|
|
85227
|
-
const colorDefinitions = options && options.colorDefinitions ? options.colorDefinitions : [];
|
|
85228
|
-
this.columns = options && options.columns ? options.columns : 5;
|
|
85229
|
-
const viewStyleAttribute = {
|
|
85230
|
-
gridTemplateColumns: `repeat( ${this.columns}, 1fr)`
|
|
85231
|
-
};
|
|
85232
|
-
this.set('selectedColor', undefined);
|
|
85233
|
-
this.items = this.createCollection();
|
|
85234
|
-
this.focusTracker = new FocusTracker();
|
|
85235
|
-
this.keystrokes = new KeystrokeHandler();
|
|
85236
|
-
this.items.on('add', (evt, colorTile) => {
|
|
85237
|
-
colorTile.isOn = colorTile.color === this.selectedColor;
|
|
85238
|
-
});
|
|
85239
|
-
colorDefinitions.forEach(color => {
|
|
85240
|
-
const colorTile = new ColorTileView();
|
|
85241
|
-
colorTile.set({
|
|
85242
|
-
color: color.color,
|
|
85243
|
-
label: color.label,
|
|
85244
|
-
tooltip: true,
|
|
85245
|
-
hasBorder: color.options.hasBorder
|
|
85246
|
-
});
|
|
85247
|
-
colorTile.on('execute', () => {
|
|
85248
|
-
this.fire('execute', {
|
|
85249
|
-
value: color.color,
|
|
85250
|
-
hasBorder: color.options.hasBorder,
|
|
85251
|
-
label: color.label
|
|
85252
|
-
});
|
|
85253
|
-
});
|
|
85254
|
-
this.items.add(colorTile);
|
|
85255
|
-
});
|
|
85256
|
-
this.setTemplate({
|
|
85257
|
-
tag: 'div',
|
|
85258
|
-
children: this.items,
|
|
85259
|
-
attributes: {
|
|
85260
|
-
class: [
|
|
85261
|
-
'ck',
|
|
85262
|
-
'ck-color-grid'
|
|
85263
|
-
],
|
|
85264
|
-
style: viewStyleAttribute
|
|
85265
|
-
}
|
|
85266
|
-
});
|
|
85267
|
-
this.on('change:selectedColor', (evt, name, selectedColor) => {
|
|
85268
|
-
for (const item of this.items) {
|
|
85269
|
-
item.isOn = item.color === selectedColor;
|
|
85270
|
-
}
|
|
85271
|
-
});
|
|
85272
|
-
}
|
|
85273
|
-
/**
|
|
85274
|
-
* Focuses the first focusable in {@link #items}.
|
|
85275
|
-
*/
|
|
85276
|
-
focus() {
|
|
85277
|
-
if (this.items.length) {
|
|
85278
|
-
this.items.first.focus();
|
|
85279
|
-
}
|
|
85280
|
-
}
|
|
85281
|
-
/**
|
|
85282
|
-
* Focuses the last focusable in {@link #items}.
|
|
85283
|
-
*/
|
|
85284
|
-
focusLast() {
|
|
85285
|
-
if (this.items.length) {
|
|
85286
|
-
this.items.last.focus();
|
|
85287
|
-
}
|
|
85288
|
-
}
|
|
85289
|
-
/**
|
|
85290
|
-
* @inheritDoc
|
|
85291
|
-
*/
|
|
85292
|
-
render() {
|
|
85293
|
-
super.render();
|
|
85294
|
-
// Items added before rendering should be known to the #focusTracker.
|
|
85295
|
-
for (const item of this.items) {
|
|
85296
|
-
this.focusTracker.add(item.element);
|
|
85297
|
-
}
|
|
85298
|
-
this.items.on('add', (evt, item) => {
|
|
85299
|
-
this.focusTracker.add(item.element);
|
|
85300
|
-
});
|
|
85301
|
-
this.items.on('remove', (evt, item) => {
|
|
85302
|
-
this.focusTracker.remove(item.element);
|
|
85303
|
-
});
|
|
85304
|
-
// Start listening for the keystrokes coming from #element.
|
|
85305
|
-
this.keystrokes.listenTo(this.element);
|
|
85306
|
-
addKeyboardHandlingForGrid({
|
|
85307
|
-
keystrokeHandler: this.keystrokes,
|
|
85308
|
-
focusTracker: this.focusTracker,
|
|
85309
|
-
gridItems: this.items,
|
|
85310
|
-
numberOfColumns: this.columns,
|
|
85311
|
-
uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
|
|
85312
|
-
});
|
|
85313
|
-
}
|
|
85314
|
-
/**
|
|
85315
|
-
* @inheritDoc
|
|
85316
|
-
*/
|
|
85317
|
-
destroy() {
|
|
85318
|
-
super.destroy();
|
|
85319
|
-
this.focusTracker.destroy();
|
|
85320
|
-
this.keystrokes.destroy();
|
|
85321
|
-
}
|
|
85322
|
-
}
|
|
84855
|
+
var css_248z$$ = ".ck.ck-color-grid{display:grid}";
|
|
84856
|
+
styleInject(css_248z$$);
|
|
85323
84857
|
|
|
85324
84858
|
var colorName;
|
|
85325
84859
|
var hasRequiredColorName;
|
|
@@ -85481,174 +85015,7 @@ function requireColorName () {
|
|
|
85481
85015
|
return colorName;
|
|
85482
85016
|
}
|
|
85483
85017
|
|
|
85484
|
-
|
|
85485
|
-
var names = /*@__PURE__*/getDefaultExportFromCjs(colorNameExports);
|
|
85486
|
-
|
|
85487
|
-
/**
|
|
85488
|
-
* @module color-parse
|
|
85489
|
-
*/
|
|
85490
|
-
|
|
85491
|
-
/**
|
|
85492
|
-
* Base hues
|
|
85493
|
-
* http://dev.w3.org/csswg/css-color/#typedef-named-hue
|
|
85494
|
-
*/
|
|
85495
|
-
//FIXME: use external hue detector
|
|
85496
|
-
var baseHues = {
|
|
85497
|
-
red: 0,
|
|
85498
|
-
orange: 60,
|
|
85499
|
-
yellow: 120,
|
|
85500
|
-
green: 180,
|
|
85501
|
-
blue: 240,
|
|
85502
|
-
purple: 300
|
|
85503
|
-
};
|
|
85504
|
-
|
|
85505
|
-
/**
|
|
85506
|
-
* Parse color from the string passed
|
|
85507
|
-
*
|
|
85508
|
-
* @return {Object} A space indicator `space`, an array `values` and `alpha`
|
|
85509
|
-
*/
|
|
85510
|
-
function parse$2 (cstr) {
|
|
85511
|
-
var m, parts = [], alpha = 1, space;
|
|
85512
|
-
|
|
85513
|
-
if (typeof cstr === 'string') {
|
|
85514
|
-
//keyword
|
|
85515
|
-
if (names[cstr]) {
|
|
85516
|
-
parts = names[cstr].slice();
|
|
85517
|
-
space = 'rgb';
|
|
85518
|
-
}
|
|
85519
|
-
|
|
85520
|
-
//reserved words
|
|
85521
|
-
else if (cstr === 'transparent') {
|
|
85522
|
-
alpha = 0;
|
|
85523
|
-
space = 'rgb';
|
|
85524
|
-
parts = [0,0,0];
|
|
85525
|
-
}
|
|
85526
|
-
|
|
85527
|
-
//hex
|
|
85528
|
-
else if (/^#[A-Fa-f0-9]+$/.test(cstr)) {
|
|
85529
|
-
var base = cstr.slice(1);
|
|
85530
|
-
var size = base.length;
|
|
85531
|
-
var isShort = size <= 4;
|
|
85532
|
-
alpha = 1;
|
|
85533
|
-
|
|
85534
|
-
if (isShort) {
|
|
85535
|
-
parts = [
|
|
85536
|
-
parseInt(base[0] + base[0], 16),
|
|
85537
|
-
parseInt(base[1] + base[1], 16),
|
|
85538
|
-
parseInt(base[2] + base[2], 16)
|
|
85539
|
-
];
|
|
85540
|
-
if (size === 4) {
|
|
85541
|
-
alpha = parseInt(base[3] + base[3], 16) / 255;
|
|
85542
|
-
}
|
|
85543
|
-
}
|
|
85544
|
-
else {
|
|
85545
|
-
parts = [
|
|
85546
|
-
parseInt(base[0] + base[1], 16),
|
|
85547
|
-
parseInt(base[2] + base[3], 16),
|
|
85548
|
-
parseInt(base[4] + base[5], 16)
|
|
85549
|
-
];
|
|
85550
|
-
if (size === 8) {
|
|
85551
|
-
alpha = parseInt(base[6] + base[7], 16) / 255;
|
|
85552
|
-
}
|
|
85553
|
-
}
|
|
85554
|
-
|
|
85555
|
-
if (!parts[0]) parts[0] = 0;
|
|
85556
|
-
if (!parts[1]) parts[1] = 0;
|
|
85557
|
-
if (!parts[2]) parts[2] = 0;
|
|
85558
|
-
|
|
85559
|
-
space = 'rgb';
|
|
85560
|
-
}
|
|
85561
|
-
|
|
85562
|
-
//color space
|
|
85563
|
-
else if (m = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(cstr)) {
|
|
85564
|
-
var name = m[1];
|
|
85565
|
-
var isRGB = name === 'rgb';
|
|
85566
|
-
var base = name.replace(/a$/, '');
|
|
85567
|
-
space = base;
|
|
85568
|
-
var size = base === 'cmyk' ? 4 : base === 'gray' ? 1 : 3;
|
|
85569
|
-
parts = m[2].trim()
|
|
85570
|
-
.split(/\s*[,\/]\s*|\s+/)
|
|
85571
|
-
.map(function (x, i) {
|
|
85572
|
-
//<percentage>
|
|
85573
|
-
if (/%$/.test(x)) {
|
|
85574
|
-
//alpha
|
|
85575
|
-
if (i === size) return parseFloat(x) / 100
|
|
85576
|
-
//rgb
|
|
85577
|
-
if (base === 'rgb') return parseFloat(x) * 255 / 100
|
|
85578
|
-
return parseFloat(x)
|
|
85579
|
-
}
|
|
85580
|
-
//hue
|
|
85581
|
-
else if (base[i] === 'h') {
|
|
85582
|
-
//<deg>
|
|
85583
|
-
if (/deg$/.test(x)) {
|
|
85584
|
-
return parseFloat(x)
|
|
85585
|
-
}
|
|
85586
|
-
//<base-hue>
|
|
85587
|
-
else if (baseHues[x] !== undefined) {
|
|
85588
|
-
return baseHues[x]
|
|
85589
|
-
}
|
|
85590
|
-
}
|
|
85591
|
-
return parseFloat(x)
|
|
85592
|
-
});
|
|
85593
|
-
|
|
85594
|
-
if (name === base) parts.push(1);
|
|
85595
|
-
alpha = (isRGB) ? 1 : (parts[size] === undefined) ? 1 : parts[size];
|
|
85596
|
-
parts = parts.slice(0, size);
|
|
85597
|
-
}
|
|
85598
|
-
|
|
85599
|
-
//named channels case
|
|
85600
|
-
else if (cstr.length > 10 && /[0-9](?:\s|\/)/.test(cstr)) {
|
|
85601
|
-
parts = cstr.match(/([0-9]+)/g).map(function (value) {
|
|
85602
|
-
return parseFloat(value)
|
|
85603
|
-
});
|
|
85604
|
-
|
|
85605
|
-
space = cstr.match(/([a-z])/ig).join('').toLowerCase();
|
|
85606
|
-
}
|
|
85607
|
-
}
|
|
85608
|
-
|
|
85609
|
-
//numeric case
|
|
85610
|
-
else if (!isNaN(cstr)) {
|
|
85611
|
-
space = 'rgb';
|
|
85612
|
-
parts = [cstr >>> 16, (cstr & 0x00ff00) >>> 8, cstr & 0x0000ff];
|
|
85613
|
-
}
|
|
85614
|
-
|
|
85615
|
-
//array-like
|
|
85616
|
-
else if (Array.isArray(cstr) || cstr.length) {
|
|
85617
|
-
parts = [cstr[0], cstr[1], cstr[2]];
|
|
85618
|
-
space = 'rgb';
|
|
85619
|
-
alpha = cstr.length === 4 ? cstr[3] : 1;
|
|
85620
|
-
}
|
|
85621
|
-
|
|
85622
|
-
//object case - detects css cases of rgb and hsl
|
|
85623
|
-
else if (cstr instanceof Object) {
|
|
85624
|
-
if (cstr.r != null || cstr.red != null || cstr.R != null) {
|
|
85625
|
-
space = 'rgb';
|
|
85626
|
-
parts = [
|
|
85627
|
-
cstr.r || cstr.red || cstr.R || 0,
|
|
85628
|
-
cstr.g || cstr.green || cstr.G || 0,
|
|
85629
|
-
cstr.b || cstr.blue || cstr.B || 0
|
|
85630
|
-
];
|
|
85631
|
-
}
|
|
85632
|
-
else {
|
|
85633
|
-
space = 'hsl';
|
|
85634
|
-
parts = [
|
|
85635
|
-
cstr.h || cstr.hue || cstr.H || 0,
|
|
85636
|
-
cstr.s || cstr.saturation || cstr.S || 0,
|
|
85637
|
-
cstr.l || cstr.lightness || cstr.L || cstr.b || cstr.brightness
|
|
85638
|
-
];
|
|
85639
|
-
}
|
|
85640
|
-
|
|
85641
|
-
alpha = cstr.a || cstr.alpha || cstr.opacity || 1;
|
|
85642
|
-
|
|
85643
|
-
if (cstr.opacity != null) alpha /= 100;
|
|
85644
|
-
}
|
|
85645
|
-
|
|
85646
|
-
return {
|
|
85647
|
-
space: space,
|
|
85648
|
-
values: parts,
|
|
85649
|
-
alpha: alpha
|
|
85650
|
-
}
|
|
85651
|
-
}
|
|
85018
|
+
requireColorName();
|
|
85652
85019
|
|
|
85653
85020
|
/* MIT license */
|
|
85654
85021
|
|
|
@@ -86694,123 +86061,10 @@ function requireColorConvert () {
|
|
|
86694
86061
|
return colorConvert;
|
|
86695
86062
|
}
|
|
86696
86063
|
|
|
86697
|
-
|
|
86698
|
-
var index = /*@__PURE__*/getDefaultExportFromCjs(colorConvertExports);
|
|
86064
|
+
requireColorConvert();
|
|
86699
86065
|
|
|
86700
|
-
var
|
|
86701
|
-
|
|
86702
|
-
default: index
|
|
86703
|
-
}, [colorConvertExports]);
|
|
86704
|
-
|
|
86705
|
-
/**
|
|
86706
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
86707
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
86708
|
-
*/
|
|
86709
|
-
/**
|
|
86710
|
-
* @module ui/colorpicker/utils
|
|
86711
|
-
*/
|
|
86712
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
86713
|
-
// There are no available types for 'color-parse' module.
|
|
86714
|
-
// @ts-ignore
|
|
86715
|
-
/**
|
|
86716
|
-
* Parses and converts the color string to requested format. Handles variety of color spaces
|
|
86717
|
-
* like `hsl`, `hex` or `rgb`.
|
|
86718
|
-
*
|
|
86719
|
-
* @param color
|
|
86720
|
-
* @returns A color string.
|
|
86721
|
-
*/
|
|
86722
|
-
function convertColor(color, outputFormat) {
|
|
86723
|
-
if (!color) {
|
|
86724
|
-
return '';
|
|
86725
|
-
}
|
|
86726
|
-
const colorObject = parseColorString(color);
|
|
86727
|
-
if (!colorObject) {
|
|
86728
|
-
return '';
|
|
86729
|
-
}
|
|
86730
|
-
if (colorObject.space === outputFormat) {
|
|
86731
|
-
return color;
|
|
86732
|
-
}
|
|
86733
|
-
if (!canConvertParsedColor(colorObject)) {
|
|
86734
|
-
return '';
|
|
86735
|
-
}
|
|
86736
|
-
const fromColorSpace = convert[colorObject.space];
|
|
86737
|
-
const toColorSpace = fromColorSpace[outputFormat];
|
|
86738
|
-
if (!toColorSpace) {
|
|
86739
|
-
return '';
|
|
86740
|
-
}
|
|
86741
|
-
const convertedColorChannels = toColorSpace(colorObject.space === 'hex' ? colorObject.hexValue : colorObject.values);
|
|
86742
|
-
return formatColorOutput(convertedColorChannels, outputFormat);
|
|
86743
|
-
}
|
|
86744
|
-
/**
|
|
86745
|
-
* Converts a color string to hex format.
|
|
86746
|
-
*
|
|
86747
|
-
* @param color
|
|
86748
|
-
* @returns A color string.
|
|
86749
|
-
*/
|
|
86750
|
-
function convertToHex(color) {
|
|
86751
|
-
if (!color) {
|
|
86752
|
-
return '';
|
|
86753
|
-
}
|
|
86754
|
-
const colorObject = parseColorString(color);
|
|
86755
|
-
if (!colorObject) {
|
|
86756
|
-
return '#000';
|
|
86757
|
-
}
|
|
86758
|
-
if (colorObject.space === 'hex') {
|
|
86759
|
-
return colorObject.hexValue;
|
|
86760
|
-
}
|
|
86761
|
-
return convertColor(color, 'hex');
|
|
86762
|
-
}
|
|
86763
|
-
/**
|
|
86764
|
-
* Registers the custom element in the
|
|
86765
|
-
* [CustomElementsRegistry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry).
|
|
86766
|
-
*/
|
|
86767
|
-
function registerCustomElement(elementName, constructor) {
|
|
86768
|
-
if (customElements.get(elementName) === undefined) {
|
|
86769
|
-
customElements.define(elementName, constructor);
|
|
86770
|
-
}
|
|
86771
|
-
}
|
|
86772
|
-
/**
|
|
86773
|
-
* Formats the passed color channels according to the requested format.
|
|
86774
|
-
*
|
|
86775
|
-
* @param values
|
|
86776
|
-
* @param format
|
|
86777
|
-
* @returns A color string.
|
|
86778
|
-
*/
|
|
86779
|
-
function formatColorOutput(values, format) {
|
|
86780
|
-
switch (format) {
|
|
86781
|
-
case 'hex': return `#${values}`;
|
|
86782
|
-
case 'rgb': return `rgb(${values[0]}, ${values[1]}, ${values[2]})`;
|
|
86783
|
-
case 'hsl': return `hsl(${values[0]}, ${values[1]}%, ${values[2]}%)`;
|
|
86784
|
-
case 'hwb': return `hwb(${values[0]}, ${values[1]}, ${values[2]})`;
|
|
86785
|
-
case 'lab': return `lab(${values[0]}% ${values[1]} ${values[2]})`;
|
|
86786
|
-
case 'lch': return `lch(${values[0]}% ${values[1]} ${values[2]})`;
|
|
86787
|
-
default: return '';
|
|
86788
|
-
}
|
|
86789
|
-
}
|
|
86790
|
-
function parseColorString(colorString) {
|
|
86791
|
-
// Parser library treats `hex` format as belonging to `rgb` space | which messes up further conversion.
|
|
86792
|
-
// Let's parse such strings on our own.
|
|
86793
|
-
if (colorString.startsWith('#')) {
|
|
86794
|
-
const parsedHex = parse$2(colorString);
|
|
86795
|
-
return {
|
|
86796
|
-
space: 'hex',
|
|
86797
|
-
values: parsedHex.values,
|
|
86798
|
-
hexValue: colorString,
|
|
86799
|
-
alpha: parsedHex.alpha
|
|
86800
|
-
};
|
|
86801
|
-
}
|
|
86802
|
-
const parsed = parse$2(colorString);
|
|
86803
|
-
if (!parsed.space) {
|
|
86804
|
-
return null;
|
|
86805
|
-
}
|
|
86806
|
-
return parsed;
|
|
86807
|
-
}
|
|
86808
|
-
function canConvertParsedColor(parsedColor) {
|
|
86809
|
-
return Object.keys(convert).includes(parsedColor.space);
|
|
86810
|
-
}
|
|
86811
|
-
|
|
86812
|
-
var css_248z$$ = ".ck.ck-labeled-field-view{&>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}& .ck.ck-label{display:block;position:absolute}}";
|
|
86813
|
-
styleInject(css_248z$$);
|
|
86066
|
+
var css_248z$_ = ".ck.ck-labeled-field-view{&>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}& .ck.ck-label{display:block;position:absolute}}";
|
|
86067
|
+
styleInject(css_248z$_);
|
|
86814
86068
|
|
|
86815
86069
|
/**
|
|
86816
86070
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -87079,8 +86333,8 @@ function isInputElementEmpty(domElement) {
|
|
|
87079
86333
|
return !domElement.value;
|
|
87080
86334
|
}
|
|
87081
86335
|
|
|
87082
|
-
var css_248z$
|
|
87083
|
-
styleInject(css_248z$
|
|
86336
|
+
var css_248z$Z = "";
|
|
86337
|
+
styleInject(css_248z$Z);
|
|
87084
86338
|
|
|
87085
86339
|
/**
|
|
87086
86340
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -87132,8 +86386,8 @@ class InputTextView extends InputView {
|
|
|
87132
86386
|
}
|
|
87133
86387
|
}
|
|
87134
86388
|
|
|
87135
|
-
var css_248z$
|
|
87136
|
-
styleInject(css_248z$
|
|
86389
|
+
var css_248z$Y = "";
|
|
86390
|
+
styleInject(css_248z$Y);
|
|
87137
86391
|
|
|
87138
86392
|
/**
|
|
87139
86393
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -87231,8 +86485,8 @@ class DropdownPanelView extends View$1 {
|
|
|
87231
86485
|
}
|
|
87232
86486
|
}
|
|
87233
86487
|
|
|
87234
|
-
var css_248z$
|
|
87235
|
-
styleInject(css_248z$
|
|
86488
|
+
var css_248z$X = ":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative;& .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}& .ck-button.ck-dropdown__button{width:100%}& .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-panel);&.ck-dropdown__panel-visible{display:inline-block}&.ck-dropdown__panel_n,&.ck-dropdown__panel_ne,&.ck-dropdown__panel_nme,&.ck-dropdown__panel_nmw,&.ck-dropdown__panel_nw{bottom:100%}&.ck-dropdown__panel_s,&.ck-dropdown__panel_se,&.ck-dropdown__panel_sme,&.ck-dropdown__panel_smw,&.ck-dropdown__panel_sw{bottom:auto;top:100%}&.ck-dropdown__panel_ne,&.ck-dropdown__panel_se{left:0}&.ck-dropdown__panel_nw,&.ck-dropdown__panel_sw{right:0}&.ck-dropdown__panel_n,&.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}&.ck-dropdown__panel_nmw,&.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}&.ck-dropdown__panel_nme,&.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}}}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-panel) + 1)}";
|
|
86489
|
+
styleInject(css_248z$X);
|
|
87236
86490
|
|
|
87237
86491
|
/**
|
|
87238
86492
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -87683,12 +86937,12 @@ class DropdownButtonView extends ButtonView {
|
|
|
87683
86937
|
}
|
|
87684
86938
|
}
|
|
87685
86939
|
|
|
87686
|
-
var css_248z$
|
|
87687
|
-
styleInject(css_248z$X);
|
|
87688
|
-
|
|
87689
|
-
var css_248z$W = ".ck.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}";
|
|
86940
|
+
var css_248z$W = "";
|
|
87690
86941
|
styleInject(css_248z$W);
|
|
87691
86942
|
|
|
86943
|
+
var css_248z$V = ".ck.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}";
|
|
86944
|
+
styleInject(css_248z$V);
|
|
86945
|
+
|
|
87692
86946
|
/**
|
|
87693
86947
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
87694
86948
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -87885,8 +87139,8 @@ class ListItemGroupView extends View$1 {
|
|
|
87885
87139
|
}
|
|
87886
87140
|
}
|
|
87887
87141
|
|
|
87888
|
-
var css_248z$
|
|
87889
|
-
styleInject(css_248z$
|
|
87142
|
+
var css_248z$U = "@import \"../../mixins/_unselectable.css\";.ck.ck-list{@mixin ck-unselectable;display:flex;flex-direction:column;& .ck-list__item,& .ck-list__separator{display:block}& .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}}";
|
|
87143
|
+
styleInject(css_248z$U);
|
|
87890
87144
|
|
|
87891
87145
|
/**
|
|
87892
87146
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -88161,8 +87415,8 @@ const DropdownMenuPanelPositioningFunctions = {
|
|
|
88161
87415
|
})
|
|
88162
87416
|
};
|
|
88163
87417
|
|
|
88164
|
-
var css_248z$
|
|
88165
|
-
styleInject(css_248z$
|
|
87418
|
+
var css_248z$T = "";
|
|
87419
|
+
styleInject(css_248z$T);
|
|
88166
87420
|
|
|
88167
87421
|
/**
|
|
88168
87422
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -88247,8 +87501,8 @@ const DropdownMenuBehaviors = {
|
|
|
88247
87501
|
}
|
|
88248
87502
|
};
|
|
88249
87503
|
|
|
88250
|
-
var css_248z$
|
|
88251
|
-
styleInject(css_248z$
|
|
87504
|
+
var css_248z$S = ":root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-panel);&.ck-balloon-panel_with-arrow{&:after,&:before{content:\"\";position:absolute}&:before{z-index:var(--ck-balloon-panel-arrow-z-index)}&:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}}&[class*=arrow_n]{&:before{z-index:var(--ck-balloon-panel-arrow-z-index)}&:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}}&[class*=arrow_s]{&:before{z-index:var(--ck-balloon-panel-arrow-z-index)}&:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}}&.ck-balloon-panel_visible{display:block}}";
|
|
87505
|
+
styleInject(css_248z$S);
|
|
88252
87506
|
|
|
88253
87507
|
/**
|
|
88254
87508
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -89301,8 +88555,8 @@ function getDomElement(object) {
|
|
|
89301
88555
|
return null;
|
|
89302
88556
|
}
|
|
89303
88557
|
|
|
89304
|
-
var css_248z$
|
|
89305
|
-
styleInject(css_248z$
|
|
88558
|
+
var css_248z$R = ".ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel{max-height:314px;overflow-y:auto;position:absolute;z-index:calc(var(--ck-z-panel) + 1)}";
|
|
88559
|
+
styleInject(css_248z$R);
|
|
89306
88560
|
|
|
89307
88561
|
/**
|
|
89308
88562
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -89366,8 +88620,8 @@ class DropdownMenuNestedMenuPanelView extends BalloonPanelView {
|
|
|
89366
88620
|
}
|
|
89367
88621
|
}
|
|
89368
88622
|
|
|
89369
|
-
var css_248z$
|
|
89370
|
-
styleInject(css_248z$
|
|
88623
|
+
var css_248z$Q = ".ck.ck-dropdown-menu-list__nested-menu{display:block}";
|
|
88624
|
+
styleInject(css_248z$Q);
|
|
89371
88625
|
|
|
89372
88626
|
/**
|
|
89373
88627
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -89697,8 +88951,8 @@ function normalizeToolbarConfig(config) {
|
|
|
89697
88951
|
};
|
|
89698
88952
|
}
|
|
89699
88953
|
|
|
89700
|
-
var css_248z$
|
|
89701
|
-
styleInject(css_248z$
|
|
88954
|
+
var css_248z$P = "@import \"../../mixins/_unselectable.css\";.ck.ck-toolbar{@mixin ck-unselectable;align-items:center;display:flex;flex-flow:row nowrap;&>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}& .ck.ck-toolbar__separator{display:inline-block;&:first-child,&:last-child{display:none}}& .ck-toolbar__line-break{flex-basis:100%}&.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}&.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}&.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}&>.ck.ck-toolbar__grouped-dropdown{&>.ck-dropdown__button .ck-dropdown__arrow{display:none}}}";
|
|
88955
|
+
styleInject(css_248z$P);
|
|
89702
88956
|
|
|
89703
88957
|
/**
|
|
89704
88958
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -90411,8 +89665,8 @@ class DynamicGrouping {
|
|
|
90411
89665
|
}
|
|
90412
89666
|
}
|
|
90413
89667
|
|
|
90414
|
-
var css_248z$
|
|
90415
|
-
styleInject(css_248z$
|
|
89668
|
+
var css_248z$O = ".ck.ck-splitbutton{font-size:inherit;& .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}}";
|
|
89669
|
+
styleInject(css_248z$O);
|
|
90416
89670
|
|
|
90417
89671
|
/**
|
|
90418
89672
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -90564,12 +89818,12 @@ class SplitButtonView extends View$1 {
|
|
|
90564
89818
|
}
|
|
90565
89819
|
}
|
|
90566
89820
|
|
|
90567
|
-
var css_248z$
|
|
90568
|
-
styleInject(css_248z$O);
|
|
90569
|
-
|
|
90570
|
-
var css_248z$N = "";
|
|
89821
|
+
var css_248z$N = ":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content;& .ck-button{&:focus{z-index:calc(var(--ck-z-default) + 1)}}}";
|
|
90571
89822
|
styleInject(css_248z$N);
|
|
90572
89823
|
|
|
89824
|
+
var css_248z$M = "";
|
|
89825
|
+
styleInject(css_248z$M);
|
|
89826
|
+
|
|
90573
89827
|
/**
|
|
90574
89828
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
90575
89829
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -91100,1480 +90354,11 @@ const createLabeledInputText = (labeledFieldView, viewUid, statusUid) => {
|
|
|
91100
90354
|
return inputView;
|
|
91101
90355
|
};
|
|
91102
90356
|
|
|
91103
|
-
|
|
91104
|
-
// We use ternary operators because it makes the minified code
|
|
91105
|
-
// 2 times shorter then `Math.min(Math.max(a,b),c)`
|
|
91106
|
-
const clamp = (number, min = 0, max = 1) => {
|
|
91107
|
-
return number > max ? max : number < min ? min : number;
|
|
91108
|
-
};
|
|
91109
|
-
const round = (number, digits = 0, base = Math.pow(10, digits)) => {
|
|
91110
|
-
return Math.round(base * number) / base;
|
|
91111
|
-
};
|
|
91112
|
-
|
|
91113
|
-
const hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex));
|
|
91114
|
-
const hexToRgba = (hex) => {
|
|
91115
|
-
if (hex[0] === '#')
|
|
91116
|
-
hex = hex.substring(1);
|
|
91117
|
-
if (hex.length < 6) {
|
|
91118
|
-
return {
|
|
91119
|
-
r: parseInt(hex[0] + hex[0], 16),
|
|
91120
|
-
g: parseInt(hex[1] + hex[1], 16),
|
|
91121
|
-
b: parseInt(hex[2] + hex[2], 16),
|
|
91122
|
-
a: hex.length === 4 ? round(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1
|
|
91123
|
-
};
|
|
91124
|
-
}
|
|
91125
|
-
return {
|
|
91126
|
-
r: parseInt(hex.substring(0, 2), 16),
|
|
91127
|
-
g: parseInt(hex.substring(2, 4), 16),
|
|
91128
|
-
b: parseInt(hex.substring(4, 6), 16),
|
|
91129
|
-
a: hex.length === 8 ? round(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1
|
|
91130
|
-
};
|
|
91131
|
-
};
|
|
91132
|
-
const hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva));
|
|
91133
|
-
const hsvaToHsla = ({ h, s, v, a }) => {
|
|
91134
|
-
const hh = ((200 - s) * v) / 100;
|
|
91135
|
-
return {
|
|
91136
|
-
h: round(h),
|
|
91137
|
-
s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),
|
|
91138
|
-
l: round(hh / 2),
|
|
91139
|
-
a: round(a, 2)
|
|
91140
|
-
};
|
|
91141
|
-
};
|
|
91142
|
-
const hsvaToHslString = (hsva) => {
|
|
91143
|
-
const { h, s, l } = hsvaToHsla(hsva);
|
|
91144
|
-
return `hsl(${h}, ${s}%, ${l}%)`;
|
|
91145
|
-
};
|
|
91146
|
-
const hsvaToRgba = ({ h, s, v, a }) => {
|
|
91147
|
-
h = (h / 360) * 6;
|
|
91148
|
-
s = s / 100;
|
|
91149
|
-
v = v / 100;
|
|
91150
|
-
const hh = Math.floor(h), b = v * (1 - s), c = v * (1 - (h - hh) * s), d = v * (1 - (1 - h + hh) * s), module = hh % 6;
|
|
91151
|
-
return {
|
|
91152
|
-
r: round([v, c, b, b, d, v][module] * 255),
|
|
91153
|
-
g: round([d, v, v, c, b, b][module] * 255),
|
|
91154
|
-
b: round([b, b, d, v, v, c][module] * 255),
|
|
91155
|
-
a: round(a, 2)
|
|
91156
|
-
};
|
|
91157
|
-
};
|
|
91158
|
-
const format = (number) => {
|
|
91159
|
-
const hex = number.toString(16);
|
|
91160
|
-
return hex.length < 2 ? '0' + hex : hex;
|
|
91161
|
-
};
|
|
91162
|
-
const rgbaToHex = ({ r, g, b, a }) => {
|
|
91163
|
-
const alphaHex = a < 1 ? format(round(a * 255)) : '';
|
|
91164
|
-
return '#' + format(r) + format(g) + format(b) + alphaHex;
|
|
91165
|
-
};
|
|
91166
|
-
const rgbaToHsva = ({ r, g, b, a }) => {
|
|
91167
|
-
const max = Math.max(r, g, b);
|
|
91168
|
-
const delta = max - Math.min(r, g, b);
|
|
91169
|
-
// prettier-ignore
|
|
91170
|
-
const hh = delta
|
|
91171
|
-
? max === r
|
|
91172
|
-
? (g - b) / delta
|
|
91173
|
-
: max === g
|
|
91174
|
-
? 2 + (b - r) / delta
|
|
91175
|
-
: 4 + (r - g) / delta
|
|
91176
|
-
: 0;
|
|
91177
|
-
return {
|
|
91178
|
-
h: round(60 * (hh < 0 ? hh + 6 : hh)),
|
|
91179
|
-
s: round(max ? (delta / max) * 100 : 0),
|
|
91180
|
-
v: round((max / 255) * 100),
|
|
91181
|
-
a
|
|
91182
|
-
};
|
|
91183
|
-
};
|
|
91184
|
-
|
|
91185
|
-
const equalColorObjects = (first, second) => {
|
|
91186
|
-
if (first === second)
|
|
91187
|
-
return true;
|
|
91188
|
-
for (const prop in first) {
|
|
91189
|
-
// The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)
|
|
91190
|
-
// with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)
|
|
91191
|
-
// on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,
|
|
91192
|
-
// we must cast our object to unknown (as RGB demands `r` be a key, while `Record<string, x>` does not care if
|
|
91193
|
-
// there is or not), and then as a type TS can iterate over.
|
|
91194
|
-
if (first[prop] !==
|
|
91195
|
-
second[prop])
|
|
91196
|
-
return false;
|
|
91197
|
-
}
|
|
91198
|
-
return true;
|
|
91199
|
-
};
|
|
91200
|
-
const equalHex = (first, second) => {
|
|
91201
|
-
if (first.toLowerCase() === second.toLowerCase())
|
|
91202
|
-
return true;
|
|
91203
|
-
// To compare colors like `#FFF` and `ffffff` we convert them into RGB objects
|
|
91204
|
-
return equalColorObjects(hexToRgba(first), hexToRgba(second));
|
|
91205
|
-
};
|
|
91206
|
-
|
|
91207
|
-
const cache$1 = {};
|
|
91208
|
-
const tpl = (html) => {
|
|
91209
|
-
let template = cache$1[html];
|
|
91210
|
-
if (!template) {
|
|
91211
|
-
template = document.createElement('template');
|
|
91212
|
-
template.innerHTML = html;
|
|
91213
|
-
cache$1[html] = template;
|
|
91214
|
-
}
|
|
91215
|
-
return template;
|
|
91216
|
-
};
|
|
91217
|
-
const fire = (target, type, detail) => {
|
|
91218
|
-
target.dispatchEvent(new CustomEvent(type, {
|
|
91219
|
-
bubbles: true,
|
|
91220
|
-
detail
|
|
91221
|
-
}));
|
|
91222
|
-
};
|
|
91223
|
-
|
|
91224
|
-
let hasTouched = false;
|
|
91225
|
-
// Check if an event was triggered by touch
|
|
91226
|
-
const isTouch = (e) => 'touches' in e;
|
|
91227
|
-
// Prevent mobile browsers from handling mouse events (conflicting with touch ones).
|
|
91228
|
-
// If we detected a touch interaction before, we prefer reacting to touch events only.
|
|
91229
|
-
const isValid$1 = (event) => {
|
|
91230
|
-
if (hasTouched && !isTouch(event))
|
|
91231
|
-
return false;
|
|
91232
|
-
if (!hasTouched)
|
|
91233
|
-
hasTouched = isTouch(event);
|
|
91234
|
-
return true;
|
|
91235
|
-
};
|
|
91236
|
-
const pointerMove = (target, event) => {
|
|
91237
|
-
const pointer = isTouch(event) ? event.touches[0] : event;
|
|
91238
|
-
const rect = target.el.getBoundingClientRect();
|
|
91239
|
-
fire(target.el, 'move', target.getMove({
|
|
91240
|
-
x: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),
|
|
91241
|
-
y: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height)
|
|
91242
|
-
}));
|
|
91243
|
-
};
|
|
91244
|
-
const keyMove = (target, event) => {
|
|
91245
|
-
// We use `keyCode` instead of `key` to reduce the size of the library.
|
|
91246
|
-
const keyCode = event.keyCode;
|
|
91247
|
-
// Ignore all keys except arrow ones, Page Up, Page Down, Home and End.
|
|
91248
|
-
if (keyCode > 40 || (target.xy && keyCode < 37) || keyCode < 33)
|
|
91249
|
-
return;
|
|
91250
|
-
// Do not scroll page by keys when color picker element has focus.
|
|
91251
|
-
event.preventDefault();
|
|
91252
|
-
// Send relative offset to the parent component.
|
|
91253
|
-
fire(target.el, 'move', target.getMove({
|
|
91254
|
-
x: keyCode === 39 // Arrow Right
|
|
91255
|
-
? 0.01
|
|
91256
|
-
: keyCode === 37 // Arrow Left
|
|
91257
|
-
? -0.01
|
|
91258
|
-
: keyCode === 34 // Page Down
|
|
91259
|
-
? 0.05
|
|
91260
|
-
: keyCode === 33 // Page Up
|
|
91261
|
-
? -0.05
|
|
91262
|
-
: keyCode === 35 // End
|
|
91263
|
-
? 1
|
|
91264
|
-
: keyCode === 36 // Home
|
|
91265
|
-
? -1
|
|
91266
|
-
: 0,
|
|
91267
|
-
y: keyCode === 40 // Arrow down
|
|
91268
|
-
? 0.01
|
|
91269
|
-
: keyCode === 38 // Arrow Up
|
|
91270
|
-
? -0.01
|
|
91271
|
-
: 0
|
|
91272
|
-
}, true));
|
|
91273
|
-
};
|
|
91274
|
-
class Slider {
|
|
91275
|
-
constructor(root, part, aria, xy) {
|
|
91276
|
-
const template = tpl(`<div role="slider" tabindex="0" part="${part}" ${aria}><div part="${part}-pointer"></div></div>`);
|
|
91277
|
-
root.appendChild(template.content.cloneNode(true));
|
|
91278
|
-
const el = root.querySelector(`[part=${part}]`);
|
|
91279
|
-
el.addEventListener('mousedown', this);
|
|
91280
|
-
el.addEventListener('touchstart', this);
|
|
91281
|
-
el.addEventListener('keydown', this);
|
|
91282
|
-
this.el = el;
|
|
91283
|
-
this.xy = xy;
|
|
91284
|
-
this.nodes = [el.firstChild, el];
|
|
91285
|
-
}
|
|
91286
|
-
set dragging(state) {
|
|
91287
|
-
const toggleEvent = state ? document.addEventListener : document.removeEventListener;
|
|
91288
|
-
toggleEvent(hasTouched ? 'touchmove' : 'mousemove', this);
|
|
91289
|
-
toggleEvent(hasTouched ? 'touchend' : 'mouseup', this);
|
|
91290
|
-
}
|
|
91291
|
-
handleEvent(event) {
|
|
91292
|
-
switch (event.type) {
|
|
91293
|
-
case 'mousedown':
|
|
91294
|
-
case 'touchstart':
|
|
91295
|
-
event.preventDefault();
|
|
91296
|
-
// event.button is 0 in mousedown for left button activation
|
|
91297
|
-
if (!isValid$1(event) || (!hasTouched && event.button != 0))
|
|
91298
|
-
return;
|
|
91299
|
-
this.el.focus();
|
|
91300
|
-
pointerMove(this, event);
|
|
91301
|
-
this.dragging = true;
|
|
91302
|
-
break;
|
|
91303
|
-
case 'mousemove':
|
|
91304
|
-
case 'touchmove':
|
|
91305
|
-
event.preventDefault();
|
|
91306
|
-
pointerMove(this, event);
|
|
91307
|
-
break;
|
|
91308
|
-
case 'mouseup':
|
|
91309
|
-
case 'touchend':
|
|
91310
|
-
this.dragging = false;
|
|
91311
|
-
break;
|
|
91312
|
-
case 'keydown':
|
|
91313
|
-
keyMove(this, event);
|
|
91314
|
-
break;
|
|
91315
|
-
}
|
|
91316
|
-
}
|
|
91317
|
-
style(styles) {
|
|
91318
|
-
styles.forEach((style, i) => {
|
|
91319
|
-
for (const p in style) {
|
|
91320
|
-
this.nodes[i].style.setProperty(p, style[p]);
|
|
91321
|
-
}
|
|
91322
|
-
});
|
|
91323
|
-
}
|
|
91324
|
-
}
|
|
91325
|
-
|
|
91326
|
-
class Hue extends Slider {
|
|
91327
|
-
constructor(root) {
|
|
91328
|
-
super(root, 'hue', 'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"', false);
|
|
91329
|
-
}
|
|
91330
|
-
update({ h }) {
|
|
91331
|
-
this.h = h;
|
|
91332
|
-
this.style([
|
|
91333
|
-
{
|
|
91334
|
-
left: `${(h / 360) * 100}%`,
|
|
91335
|
-
color: hsvaToHslString({ h, s: 100, v: 100, a: 1 })
|
|
91336
|
-
}
|
|
91337
|
-
]);
|
|
91338
|
-
this.el.setAttribute('aria-valuenow', `${round(h)}`);
|
|
91339
|
-
}
|
|
91340
|
-
getMove(offset, key) {
|
|
91341
|
-
// Hue measured in degrees of the color circle ranging from 0 to 360
|
|
91342
|
-
return { h: key ? clamp(this.h + offset.x * 360, 0, 360) : 360 * offset.x };
|
|
91343
|
-
}
|
|
91344
|
-
}
|
|
91345
|
-
|
|
91346
|
-
class Saturation extends Slider {
|
|
91347
|
-
constructor(root) {
|
|
91348
|
-
super(root, 'saturation', 'aria-label="Color"', true);
|
|
91349
|
-
}
|
|
91350
|
-
update(hsva) {
|
|
91351
|
-
this.hsva = hsva;
|
|
91352
|
-
this.style([
|
|
91353
|
-
{
|
|
91354
|
-
top: `${100 - hsva.v}%`,
|
|
91355
|
-
left: `${hsva.s}%`,
|
|
91356
|
-
color: hsvaToHslString(hsva)
|
|
91357
|
-
},
|
|
91358
|
-
{
|
|
91359
|
-
'background-color': hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 })
|
|
91360
|
-
}
|
|
91361
|
-
]);
|
|
91362
|
-
this.el.setAttribute('aria-valuetext', `Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`);
|
|
91363
|
-
}
|
|
91364
|
-
getMove(offset, key) {
|
|
91365
|
-
// Saturation and brightness always fit into [0, 100] range
|
|
91366
|
-
return {
|
|
91367
|
-
s: key ? clamp(this.hsva.s + offset.x * 100, 0, 100) : offset.x * 100,
|
|
91368
|
-
v: key ? clamp(this.hsva.v - offset.y * 100, 0, 100) : Math.round(100 - offset.y * 100)
|
|
91369
|
-
};
|
|
91370
|
-
}
|
|
91371
|
-
}
|
|
91372
|
-
|
|
91373
|
-
var css = `:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`;
|
|
91374
|
-
|
|
91375
|
-
var hueCss = `[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`;
|
|
91376
|
-
|
|
91377
|
-
var saturationCss = `[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`;
|
|
91378
|
-
|
|
91379
|
-
const $isSame = Symbol('same');
|
|
91380
|
-
const $color = Symbol('color');
|
|
91381
|
-
const $hsva = Symbol('hsva');
|
|
91382
|
-
const $update = Symbol('update');
|
|
91383
|
-
const $parts = Symbol('parts');
|
|
91384
|
-
const $css = Symbol('css');
|
|
91385
|
-
const $sliders = Symbol('sliders');
|
|
91386
|
-
class ColorPicker extends HTMLElement {
|
|
91387
|
-
static get observedAttributes() {
|
|
91388
|
-
return ['color'];
|
|
91389
|
-
}
|
|
91390
|
-
get [$css]() {
|
|
91391
|
-
return [css, hueCss, saturationCss];
|
|
91392
|
-
}
|
|
91393
|
-
get [$sliders]() {
|
|
91394
|
-
return [Saturation, Hue];
|
|
91395
|
-
}
|
|
91396
|
-
get color() {
|
|
91397
|
-
return this[$color];
|
|
91398
|
-
}
|
|
91399
|
-
set color(newColor) {
|
|
91400
|
-
if (!this[$isSame](newColor)) {
|
|
91401
|
-
const newHsva = this.colorModel.toHsva(newColor);
|
|
91402
|
-
this[$update](newHsva);
|
|
91403
|
-
this[$color] = newColor;
|
|
91404
|
-
}
|
|
91405
|
-
}
|
|
91406
|
-
constructor() {
|
|
91407
|
-
super();
|
|
91408
|
-
const template = tpl(`<style>${this[$css].join('')}</style>`);
|
|
91409
|
-
const root = this.attachShadow({ mode: 'open' });
|
|
91410
|
-
root.appendChild(template.content.cloneNode(true));
|
|
91411
|
-
root.addEventListener('move', this);
|
|
91412
|
-
this[$parts] = this[$sliders].map((slider) => new slider(root));
|
|
91413
|
-
}
|
|
91414
|
-
connectedCallback() {
|
|
91415
|
-
// A user may set a property on an _instance_ of an element,
|
|
91416
|
-
// before its prototype has been connected to this class.
|
|
91417
|
-
// If so, we need to run it through the proper class setter.
|
|
91418
|
-
if (this.hasOwnProperty('color')) {
|
|
91419
|
-
const value = this.color;
|
|
91420
|
-
delete this['color'];
|
|
91421
|
-
this.color = value;
|
|
91422
|
-
}
|
|
91423
|
-
else if (!this.color) {
|
|
91424
|
-
this.color = this.colorModel.defaultColor;
|
|
91425
|
-
}
|
|
91426
|
-
}
|
|
91427
|
-
attributeChangedCallback(_attr, _oldVal, newVal) {
|
|
91428
|
-
const color = this.colorModel.fromAttr(newVal);
|
|
91429
|
-
if (!this[$isSame](color)) {
|
|
91430
|
-
this.color = color;
|
|
91431
|
-
}
|
|
91432
|
-
}
|
|
91433
|
-
handleEvent(event) {
|
|
91434
|
-
// Merge the current HSV color object with updated params.
|
|
91435
|
-
const oldHsva = this[$hsva];
|
|
91436
|
-
const newHsva = { ...oldHsva, ...event.detail };
|
|
91437
|
-
this[$update](newHsva);
|
|
91438
|
-
let newColor;
|
|
91439
|
-
if (!equalColorObjects(newHsva, oldHsva) &&
|
|
91440
|
-
!this[$isSame]((newColor = this.colorModel.fromHsva(newHsva)))) {
|
|
91441
|
-
this[$color] = newColor;
|
|
91442
|
-
fire(this, 'color-changed', { value: newColor });
|
|
91443
|
-
}
|
|
91444
|
-
}
|
|
91445
|
-
[$isSame](color) {
|
|
91446
|
-
return this.color && this.colorModel.equal(color, this.color);
|
|
91447
|
-
}
|
|
91448
|
-
[$update](hsva) {
|
|
91449
|
-
this[$hsva] = hsva;
|
|
91450
|
-
this[$parts].forEach((part) => part.update(hsva));
|
|
91451
|
-
}
|
|
91452
|
-
}
|
|
91453
|
-
|
|
91454
|
-
const colorModel = {
|
|
91455
|
-
defaultColor: '#000',
|
|
91456
|
-
toHsva: hexToHsva,
|
|
91457
|
-
fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),
|
|
91458
|
-
equal: equalHex,
|
|
91459
|
-
fromAttr: (color) => color
|
|
91460
|
-
};
|
|
91461
|
-
class HexBase extends ColorPicker {
|
|
91462
|
-
get colorModel() {
|
|
91463
|
-
return colorModel;
|
|
91464
|
-
}
|
|
91465
|
-
}
|
|
91466
|
-
|
|
91467
|
-
var css_248z$M = ".color-picker-hex-input{width:max-content;& .ck.ck-input{min-width:unset}}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset;& .ck.ck-labeled-field-view{padding-top:unset}& .ck.ck-input-text{width:unset}& .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}}";
|
|
91468
|
-
styleInject(css_248z$M);
|
|
91469
|
-
|
|
91470
|
-
/**
|
|
91471
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
91472
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
91473
|
-
*/
|
|
91474
|
-
/**
|
|
91475
|
-
* @module ui/colorpicker/colorpickerview
|
|
91476
|
-
*/
|
|
91477
|
-
const waitingTime = 150;
|
|
91478
|
-
/**
|
|
91479
|
-
* A class which represents a color picker with an input field for defining custom colors.
|
|
91480
|
-
*/
|
|
91481
|
-
class ColorPickerView extends View$1 {
|
|
91482
|
-
/**
|
|
91483
|
-
* Creates a view of color picker.
|
|
91484
|
-
*
|
|
91485
|
-
* @param locale
|
|
91486
|
-
* @param config
|
|
91487
|
-
*/
|
|
91488
|
-
constructor(locale, config = {}) {
|
|
91489
|
-
super(locale);
|
|
91490
|
-
this.set({
|
|
91491
|
-
color: '',
|
|
91492
|
-
_hexColor: ''
|
|
91493
|
-
});
|
|
91494
|
-
this.hexInputRow = this._createInputRow();
|
|
91495
|
-
const children = this.createCollection();
|
|
91496
|
-
if (!config.hideInput) {
|
|
91497
|
-
children.add(this.hexInputRow);
|
|
91498
|
-
}
|
|
91499
|
-
this.setTemplate({
|
|
91500
|
-
tag: 'div',
|
|
91501
|
-
attributes: {
|
|
91502
|
-
class: ['ck', 'ck-color-picker'],
|
|
91503
|
-
tabindex: -1
|
|
91504
|
-
},
|
|
91505
|
-
children
|
|
91506
|
-
});
|
|
91507
|
-
this._config = config;
|
|
91508
|
-
this._debounceColorPickerEvent = debounce((color) => {
|
|
91509
|
-
// At first, set the color internally in the component. It's converted to the configured output format.
|
|
91510
|
-
this.set('color', color);
|
|
91511
|
-
// Then let the outside world know that the user changed the color.
|
|
91512
|
-
this.fire('colorSelected', { color: this.color });
|
|
91513
|
-
}, waitingTime, {
|
|
91514
|
-
leading: true
|
|
91515
|
-
});
|
|
91516
|
-
// The `color` property holds the color in the configured output format.
|
|
91517
|
-
// Ensure it before actually setting the value.
|
|
91518
|
-
this.on('set:color', (evt, propertyName, newValue) => {
|
|
91519
|
-
evt.return = convertColor(newValue, this._config.format || 'hsl');
|
|
91520
|
-
});
|
|
91521
|
-
// The `_hexColor` property is bound to the `color` one, but requires conversion.
|
|
91522
|
-
this.on('change:color', () => {
|
|
91523
|
-
this._hexColor = convertColorToCommonHexFormat(this.color);
|
|
91524
|
-
});
|
|
91525
|
-
this.on('change:_hexColor', () => {
|
|
91526
|
-
// Update the selected color in the color picker palette when it's not focused.
|
|
91527
|
-
// It means the user typed the color in the input.
|
|
91528
|
-
if (document.activeElement !== this.picker) {
|
|
91529
|
-
this.picker.setAttribute('color', this._hexColor);
|
|
91530
|
-
}
|
|
91531
|
-
// There has to be two way binding between properties.
|
|
91532
|
-
// Extra precaution has to be taken to trigger change back only when the color really changes.
|
|
91533
|
-
if (convertColorToCommonHexFormat(this.color) != convertColorToCommonHexFormat(this._hexColor)) {
|
|
91534
|
-
this.color = this._hexColor;
|
|
91535
|
-
}
|
|
91536
|
-
});
|
|
91537
|
-
}
|
|
91538
|
-
/**
|
|
91539
|
-
* Renders color picker in the view.
|
|
91540
|
-
*/
|
|
91541
|
-
render() {
|
|
91542
|
-
super.render();
|
|
91543
|
-
// Extracted to the helper to make it testable.
|
|
91544
|
-
registerCustomElement('hex-color-picker', HexBase);
|
|
91545
|
-
this.picker = global$1.document.createElement('hex-color-picker');
|
|
91546
|
-
this.picker.setAttribute('class', 'hex-color-picker');
|
|
91547
|
-
this.picker.setAttribute('tabindex', '-1');
|
|
91548
|
-
this._createSlidersView();
|
|
91549
|
-
if (this.element) {
|
|
91550
|
-
if (this.hexInputRow.element) {
|
|
91551
|
-
this.element.insertBefore(this.picker, this.hexInputRow.element);
|
|
91552
|
-
}
|
|
91553
|
-
else {
|
|
91554
|
-
this.element.appendChild(this.picker);
|
|
91555
|
-
}
|
|
91556
|
-
// Create custom stylesheet with a look of focused pointer in color picker and append it into the color picker shadowDom
|
|
91557
|
-
const styleSheetForFocusedColorPicker = document.createElement('style');
|
|
91558
|
-
styleSheetForFocusedColorPicker.textContent = '[role="slider"]:focus [part$="pointer"] {' +
|
|
91559
|
-
'border: 1px solid #fff;' +
|
|
91560
|
-
'outline: 1px solid var(--ck-color-focus-border);' +
|
|
91561
|
-
'box-shadow: 0 0 0 2px #fff;' +
|
|
91562
|
-
'}';
|
|
91563
|
-
this.picker.shadowRoot.appendChild(styleSheetForFocusedColorPicker);
|
|
91564
|
-
}
|
|
91565
|
-
this.picker.addEventListener('color-changed', event => {
|
|
91566
|
-
const color = event.detail.value;
|
|
91567
|
-
this._debounceColorPickerEvent(color);
|
|
91568
|
-
});
|
|
91569
|
-
}
|
|
91570
|
-
/**
|
|
91571
|
-
* Focuses the first pointer in color picker.
|
|
91572
|
-
*
|
|
91573
|
-
*/
|
|
91574
|
-
focus() {
|
|
91575
|
-
// In some browsers we need to move the focus to the input first.
|
|
91576
|
-
// Otherwise, the color picker doesn't behave as expected.
|
|
91577
|
-
// In FF, after selecting the color via slider, it instantly moves back to the previous color.
|
|
91578
|
-
// In all iOS browsers and desktop Safari, once the saturation slider is moved for the first time,
|
|
91579
|
-
// editor collapses the selection and doesn't apply the color change.
|
|
91580
|
-
// See: https://github.com/cksource/ckeditor5-internal/issues/3245, https://github.com/ckeditor/ckeditor5/issues/14119,
|
|
91581
|
-
// https://github.com/cksource/ckeditor5-internal/issues/3268.
|
|
91582
|
-
/* istanbul ignore next -- @preserve */
|
|
91583
|
-
if (!this._config.hideInput && (env.isGecko || env.isiOS || env.isSafari)) {
|
|
91584
|
-
const input = this.hexInputRow.children.get(1);
|
|
91585
|
-
input.focus();
|
|
91586
|
-
}
|
|
91587
|
-
const firstSlider = this.slidersView.first;
|
|
91588
|
-
firstSlider.focus();
|
|
91589
|
-
}
|
|
91590
|
-
/**
|
|
91591
|
-
* Creates collection of sliders in color picker.
|
|
91592
|
-
*
|
|
91593
|
-
* @private
|
|
91594
|
-
*/
|
|
91595
|
-
_createSlidersView() {
|
|
91596
|
-
const colorPickersChildren = [...this.picker.shadowRoot.children];
|
|
91597
|
-
const sliders = colorPickersChildren.filter(item => item.getAttribute('role') === 'slider');
|
|
91598
|
-
const slidersView = sliders.map(slider => {
|
|
91599
|
-
const view = new SliderView(slider);
|
|
91600
|
-
return view;
|
|
91601
|
-
});
|
|
91602
|
-
this.slidersView = this.createCollection();
|
|
91603
|
-
slidersView.forEach(item => {
|
|
91604
|
-
this.slidersView.add(item);
|
|
91605
|
-
});
|
|
91606
|
-
}
|
|
91607
|
-
/**
|
|
91608
|
-
* Creates input row for defining custom colors in color picker.
|
|
91609
|
-
*
|
|
91610
|
-
* @private
|
|
91611
|
-
*/
|
|
91612
|
-
_createInputRow() {
|
|
91613
|
-
const colorInput = this._createColorInput();
|
|
91614
|
-
return new ColorPickerInputRowView(this.locale, colorInput);
|
|
91615
|
-
}
|
|
91616
|
-
/**
|
|
91617
|
-
* Creates the input where user can type or paste the color in hex format.
|
|
91618
|
-
*
|
|
91619
|
-
* @private
|
|
91620
|
-
*/
|
|
91621
|
-
_createColorInput() {
|
|
91622
|
-
const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);
|
|
91623
|
-
const { t } = this.locale;
|
|
91624
|
-
labeledInput.set({
|
|
91625
|
-
label: t('HEX'),
|
|
91626
|
-
class: 'color-picker-hex-input'
|
|
91627
|
-
});
|
|
91628
|
-
labeledInput.fieldView.bind('value').to(this, '_hexColor', pickerColor => {
|
|
91629
|
-
if (labeledInput.isFocused) {
|
|
91630
|
-
// Text field shouldn't be updated with color change if the text field is focused.
|
|
91631
|
-
// Imagine user typing hex code and getting the value of field changed.
|
|
91632
|
-
return labeledInput.fieldView.value;
|
|
91633
|
-
}
|
|
91634
|
-
else {
|
|
91635
|
-
return pickerColor.startsWith('#') ? pickerColor.substring(1) : pickerColor;
|
|
91636
|
-
}
|
|
91637
|
-
});
|
|
91638
|
-
// Only accept valid hex colors as input.
|
|
91639
|
-
labeledInput.fieldView.on('input', () => {
|
|
91640
|
-
const inputValue = labeledInput.fieldView.element.value;
|
|
91641
|
-
if (inputValue) {
|
|
91642
|
-
const maybeHexColor = tryParseHexColor(inputValue);
|
|
91643
|
-
if (maybeHexColor) {
|
|
91644
|
-
// If so, set the color.
|
|
91645
|
-
// Otherwise, do nothing.
|
|
91646
|
-
this._debounceColorPickerEvent(maybeHexColor);
|
|
91647
|
-
}
|
|
91648
|
-
}
|
|
91649
|
-
});
|
|
91650
|
-
return labeledInput;
|
|
91651
|
-
}
|
|
91652
|
-
/**
|
|
91653
|
-
* Validates the view and returns `false` when some fields are invalid.
|
|
91654
|
-
*/
|
|
91655
|
-
isValid() {
|
|
91656
|
-
const { t } = this.locale;
|
|
91657
|
-
// If the input is hidden, it's always valid, because there is no way to select
|
|
91658
|
-
// invalid color value using diagram color picker.
|
|
91659
|
-
if (this._config.hideInput) {
|
|
91660
|
-
return true;
|
|
91661
|
-
}
|
|
91662
|
-
this.resetValidationStatus();
|
|
91663
|
-
// One error per field is enough.
|
|
91664
|
-
if (!this.hexInputRow.getParsedColor()) {
|
|
91665
|
-
// Apply updated error.
|
|
91666
|
-
this.hexInputRow.inputView.errorText = t('Please enter a valid color (e.g. "ff0000").');
|
|
91667
|
-
return false;
|
|
91668
|
-
}
|
|
91669
|
-
return true;
|
|
91670
|
-
}
|
|
91671
|
-
/**
|
|
91672
|
-
* Cleans up the supplementary error and information text of input inside the {@link #hexInputRow}
|
|
91673
|
-
* bringing them back to the state when the form has been displayed for the first time.
|
|
91674
|
-
*
|
|
91675
|
-
* See {@link #isValid}.
|
|
91676
|
-
*/
|
|
91677
|
-
resetValidationStatus() {
|
|
91678
|
-
this.hexInputRow.inputView.errorText = null;
|
|
91679
|
-
}
|
|
91680
|
-
}
|
|
91681
|
-
// Converts any color format to a unified hex format.
|
|
91682
|
-
//
|
|
91683
|
-
// @param inputColor
|
|
91684
|
-
// @returns An unified hex string.
|
|
91685
|
-
function convertColorToCommonHexFormat(inputColor) {
|
|
91686
|
-
let ret = convertToHex(inputColor);
|
|
91687
|
-
if (!ret) {
|
|
91688
|
-
ret = '#000';
|
|
91689
|
-
}
|
|
91690
|
-
if (ret.length === 4) {
|
|
91691
|
-
// Unfold shortcut format.
|
|
91692
|
-
ret = '#' + [ret[1], ret[1], ret[2], ret[2], ret[3], ret[3]].join('');
|
|
91693
|
-
}
|
|
91694
|
-
return ret.toLowerCase();
|
|
91695
|
-
}
|
|
91696
|
-
// View abstraction over pointer in color picker.
|
|
91697
|
-
class SliderView extends View$1 {
|
|
91698
|
-
/**
|
|
91699
|
-
* @param element HTML element of slider in color picker.
|
|
91700
|
-
*/
|
|
91701
|
-
constructor(element) {
|
|
91702
|
-
super();
|
|
91703
|
-
this.element = element;
|
|
91704
|
-
}
|
|
91705
|
-
/**
|
|
91706
|
-
* Focuses element.
|
|
91707
|
-
*/
|
|
91708
|
-
focus() {
|
|
91709
|
-
this.element.focus();
|
|
91710
|
-
}
|
|
91711
|
-
}
|
|
91712
|
-
// View abstraction over the `#` character before color input.
|
|
91713
|
-
class HashView extends View$1 {
|
|
91714
|
-
constructor(locale) {
|
|
91715
|
-
super(locale);
|
|
91716
|
-
this.setTemplate({
|
|
91717
|
-
tag: 'div',
|
|
91718
|
-
attributes: {
|
|
91719
|
-
class: [
|
|
91720
|
-
'ck',
|
|
91721
|
-
'ck-color-picker__hash-view'
|
|
91722
|
-
]
|
|
91723
|
-
},
|
|
91724
|
-
children: '#'
|
|
91725
|
-
});
|
|
91726
|
-
}
|
|
91727
|
-
}
|
|
91728
|
-
// The class representing a row containing hex color input field.
|
|
91729
|
-
// **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),
|
|
91730
|
-
// it will become a component in `ckeditor5-ui`.
|
|
91731
|
-
//
|
|
91732
|
-
// @private
|
|
91733
|
-
class ColorPickerInputRowView extends View$1 {
|
|
91734
|
-
/**
|
|
91735
|
-
* Creates an instance of the form row class.
|
|
91736
|
-
*
|
|
91737
|
-
* @param locale The locale instance.
|
|
91738
|
-
* @param inputView Hex color input element.
|
|
91739
|
-
*/
|
|
91740
|
-
constructor(locale, inputView) {
|
|
91741
|
-
super(locale);
|
|
91742
|
-
this.inputView = inputView;
|
|
91743
|
-
this.children = this.createCollection([
|
|
91744
|
-
new HashView(),
|
|
91745
|
-
this.inputView
|
|
91746
|
-
]);
|
|
91747
|
-
this.setTemplate({
|
|
91748
|
-
tag: 'div',
|
|
91749
|
-
attributes: {
|
|
91750
|
-
class: [
|
|
91751
|
-
'ck',
|
|
91752
|
-
'ck-color-picker__row'
|
|
91753
|
-
]
|
|
91754
|
-
},
|
|
91755
|
-
children: this.children
|
|
91756
|
-
});
|
|
91757
|
-
}
|
|
91758
|
-
/**
|
|
91759
|
-
* Returns false if color input value is not in hex format.
|
|
91760
|
-
*/
|
|
91761
|
-
getParsedColor() {
|
|
91762
|
-
return tryParseHexColor(this.inputView.fieldView.element.value);
|
|
91763
|
-
}
|
|
91764
|
-
}
|
|
91765
|
-
/**
|
|
91766
|
-
* Trim spaces from provided color and check if hex is valid.
|
|
91767
|
-
*
|
|
91768
|
-
* @param color Unsafe color string.
|
|
91769
|
-
* @returns Null if provided color is not hex value.
|
|
91770
|
-
* @export
|
|
91771
|
-
*/
|
|
91772
|
-
function tryParseHexColor(color) {
|
|
91773
|
-
if (!color) {
|
|
91774
|
-
return null;
|
|
91775
|
-
}
|
|
91776
|
-
const hashLessColor = color.trim().replace(/^#/, '');
|
|
91777
|
-
// Incorrect length.
|
|
91778
|
-
if (![3, 4, 6, 8].includes(hashLessColor.length)) {
|
|
91779
|
-
return null;
|
|
91780
|
-
}
|
|
91781
|
-
// Incorrect characters.
|
|
91782
|
-
if (!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(hashLessColor)) {
|
|
91783
|
-
return null;
|
|
91784
|
-
}
|
|
91785
|
-
return `#${hashLessColor}`;
|
|
91786
|
-
}
|
|
91787
|
-
|
|
91788
|
-
/**
|
|
91789
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
91790
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
91791
|
-
*/
|
|
91792
|
-
/**
|
|
91793
|
-
* A collection to store document colors. It enforces colors to be unique.
|
|
91794
|
-
*/
|
|
91795
|
-
class DocumentColorCollection extends /* #__PURE__ */ ObservableMixin((Collection)) {
|
|
91796
|
-
constructor(options) {
|
|
91797
|
-
super(options);
|
|
91798
|
-
this.set('isEmpty', true);
|
|
91799
|
-
this.on('change', () => {
|
|
91800
|
-
this.set('isEmpty', this.length === 0);
|
|
91801
|
-
});
|
|
91802
|
-
}
|
|
91803
|
-
/**
|
|
91804
|
-
* Adds a color to the document color collection.
|
|
91805
|
-
*
|
|
91806
|
-
* This method ensures that no color duplicates are inserted (compared using
|
|
91807
|
-
* the color value of the {@link module:ui/colorgrid/colorgridview~ColorDefinition}).
|
|
91808
|
-
*
|
|
91809
|
-
* If the item does not have an ID, it will be automatically generated and set on the item.
|
|
91810
|
-
*
|
|
91811
|
-
* @param index The position of the item in the collection. The item is pushed to the collection when `index` is not specified.
|
|
91812
|
-
* @fires add
|
|
91813
|
-
* @fires change
|
|
91814
|
-
*/
|
|
91815
|
-
add(item, index) {
|
|
91816
|
-
if (this.find(element => element.color === item.color)) {
|
|
91817
|
-
// No duplicates are allowed.
|
|
91818
|
-
return this;
|
|
91819
|
-
}
|
|
91820
|
-
return super.add(item, index);
|
|
91821
|
-
}
|
|
91822
|
-
/**
|
|
91823
|
-
* Checks if an object with given colors is present in the document color collection.
|
|
91824
|
-
*/
|
|
91825
|
-
hasColor(color) {
|
|
91826
|
-
return !!this.find(item => item.color === color);
|
|
91827
|
-
}
|
|
91828
|
-
}
|
|
91829
|
-
|
|
91830
|
-
/**
|
|
91831
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
91832
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
91833
|
-
*/
|
|
91834
|
-
/**
|
|
91835
|
-
* @module ui/colorselector/colorgridsfragmentview
|
|
91836
|
-
*/
|
|
91837
|
-
/**
|
|
91838
|
-
* One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
|
|
91839
|
-
*
|
|
91840
|
-
* It provides a UI that allows users to select colors from the a predefined set and from existing document colors.
|
|
91841
|
-
*
|
|
91842
|
-
* It consists of the following sub–components:
|
|
91843
|
-
*
|
|
91844
|
-
* * A "Remove color" button,
|
|
91845
|
-
* * A static {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors defined in the configuration,
|
|
91846
|
-
* * A dynamic {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors used in the document.
|
|
91847
|
-
* * If color picker is configured, the "Color Picker" button is visible too.
|
|
91848
|
-
*/
|
|
91849
|
-
class ColorGridsFragmentView extends View$1 {
|
|
91850
|
-
/**
|
|
91851
|
-
* Creates an instance of the view.
|
|
91852
|
-
*
|
|
91853
|
-
* @param locale The localization services instance.
|
|
91854
|
-
* @param colors An array with definitions of colors to be displayed in the table.
|
|
91855
|
-
* @param columns The number of columns in the color grid.
|
|
91856
|
-
* @param removeButtonLabel The label of the button responsible for removing the color.
|
|
91857
|
-
* @param colorPickerLabel The label of the button responsible for color picker appearing.
|
|
91858
|
-
* @param documentColorsLabel The label for the section with the document colors.
|
|
91859
|
-
* @param documentColorsCount The number of colors in the document colors section inside the color dropdown.
|
|
91860
|
-
* @param focusTracker Tracks information about the DOM focus in the list.
|
|
91861
|
-
* @param focusables A collection of views that can be focused in the view.
|
|
91862
|
-
*/
|
|
91863
|
-
constructor(locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, focusTracker, focusables }) {
|
|
91864
|
-
super(locale);
|
|
91865
|
-
const bind = this.bindTemplate;
|
|
91866
|
-
this.set('isVisible', true);
|
|
91867
|
-
this.focusTracker = focusTracker;
|
|
91868
|
-
this.items = this.createCollection();
|
|
91869
|
-
this.colorDefinitions = colors;
|
|
91870
|
-
this.columns = columns;
|
|
91871
|
-
this.documentColors = new DocumentColorCollection();
|
|
91872
|
-
this.documentColorsCount = documentColorsCount;
|
|
91873
|
-
this._focusables = focusables;
|
|
91874
|
-
this._removeButtonLabel = removeButtonLabel;
|
|
91875
|
-
this._colorPickerLabel = colorPickerLabel;
|
|
91876
|
-
this._documentColorsLabel = documentColorsLabel;
|
|
91877
|
-
this.setTemplate({
|
|
91878
|
-
tag: 'div',
|
|
91879
|
-
attributes: {
|
|
91880
|
-
class: [
|
|
91881
|
-
'ck-color-grids-fragment',
|
|
91882
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
91883
|
-
]
|
|
91884
|
-
},
|
|
91885
|
-
children: this.items
|
|
91886
|
-
});
|
|
91887
|
-
this.removeColorButtonView = this._createRemoveColorButton();
|
|
91888
|
-
this.items.add(this.removeColorButtonView);
|
|
91889
|
-
}
|
|
91890
|
-
/**
|
|
91891
|
-
* Scans through the editor model and searches for text node attributes with the given attribute name.
|
|
91892
|
-
* Found entries are set as document colors.
|
|
91893
|
-
*
|
|
91894
|
-
* All the previously stored document colors will be lost in the process.
|
|
91895
|
-
*
|
|
91896
|
-
* @param model The model used as a source to obtain the document colors.
|
|
91897
|
-
* @param attributeName Determines the name of the related model's attribute for a given dropdown.
|
|
91898
|
-
*/
|
|
91899
|
-
updateDocumentColors(model, attributeName) {
|
|
91900
|
-
const document = model.document;
|
|
91901
|
-
const maxCount = this.documentColorsCount;
|
|
91902
|
-
this.documentColors.clear();
|
|
91903
|
-
for (const root of document.getRoots()) {
|
|
91904
|
-
const range = model.createRangeIn(root);
|
|
91905
|
-
for (const node of range.getItems()) {
|
|
91906
|
-
if (node.is('$textProxy') && node.hasAttribute(attributeName)) {
|
|
91907
|
-
this._addColorToDocumentColors(node.getAttribute(attributeName));
|
|
91908
|
-
if (this.documentColors.length >= maxCount) {
|
|
91909
|
-
return;
|
|
91910
|
-
}
|
|
91911
|
-
}
|
|
91912
|
-
}
|
|
91913
|
-
}
|
|
91914
|
-
}
|
|
91915
|
-
/**
|
|
91916
|
-
* Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s
|
|
91917
|
-
* available in the {@link module:ui/colorselector/colorselectorview~ColorSelectorView}. It guarantees that the selection will
|
|
91918
|
-
* occur only in one of them.
|
|
91919
|
-
*/
|
|
91920
|
-
updateSelectedColors() {
|
|
91921
|
-
const documentColorsGrid = this.documentColorsGrid;
|
|
91922
|
-
const staticColorsGrid = this.staticColorsGrid;
|
|
91923
|
-
const selectedColor = this.selectedColor;
|
|
91924
|
-
staticColorsGrid.selectedColor = selectedColor;
|
|
91925
|
-
if (documentColorsGrid) {
|
|
91926
|
-
documentColorsGrid.selectedColor = selectedColor;
|
|
91927
|
-
}
|
|
91928
|
-
}
|
|
91929
|
-
/**
|
|
91930
|
-
* @inheritDoc
|
|
91931
|
-
*/
|
|
91932
|
-
render() {
|
|
91933
|
-
super.render();
|
|
91934
|
-
this.staticColorsGrid = this._createStaticColorsGrid();
|
|
91935
|
-
this.items.add(this.staticColorsGrid);
|
|
91936
|
-
if (this.documentColorsCount) {
|
|
91937
|
-
// Create a label for document colors.
|
|
91938
|
-
const bind = Template.bind(this.documentColors, this.documentColors);
|
|
91939
|
-
const label = new View$1(this.locale);
|
|
91940
|
-
label.setTemplate({
|
|
91941
|
-
tag: 'span',
|
|
91942
|
-
attributes: {
|
|
91943
|
-
class: [
|
|
91944
|
-
'ck',
|
|
91945
|
-
'ck-color-grid__label',
|
|
91946
|
-
bind.if('isEmpty', 'ck-hidden')
|
|
91947
|
-
]
|
|
91948
|
-
},
|
|
91949
|
-
children: [
|
|
91950
|
-
{
|
|
91951
|
-
text: this._documentColorsLabel
|
|
91952
|
-
}
|
|
91953
|
-
]
|
|
91954
|
-
});
|
|
91955
|
-
this.items.add(label);
|
|
91956
|
-
this.documentColorsGrid = this._createDocumentColorsGrid();
|
|
91957
|
-
this.items.add(this.documentColorsGrid);
|
|
91958
|
-
}
|
|
91959
|
-
this._createColorPickerButton();
|
|
91960
|
-
this._addColorSelectorElementsToFocusTracker();
|
|
91961
|
-
}
|
|
91962
|
-
/**
|
|
91963
|
-
* Focuses the component.
|
|
91964
|
-
*/
|
|
91965
|
-
focus() {
|
|
91966
|
-
this.removeColorButtonView.focus();
|
|
91967
|
-
}
|
|
91968
|
-
/**
|
|
91969
|
-
* @inheritDoc
|
|
91970
|
-
*/
|
|
91971
|
-
destroy() {
|
|
91972
|
-
super.destroy();
|
|
91973
|
-
}
|
|
91974
|
-
/**
|
|
91975
|
-
* Handles displaying the color picker button (if it was previously created) and making it focusable.
|
|
91976
|
-
*/
|
|
91977
|
-
addColorPickerButton() {
|
|
91978
|
-
if (this.colorPickerButtonView) {
|
|
91979
|
-
this.items.add(this.colorPickerButtonView);
|
|
91980
|
-
this.focusTracker.add(this.colorPickerButtonView.element);
|
|
91981
|
-
this._focusables.add(this.colorPickerButtonView);
|
|
91982
|
-
}
|
|
91983
|
-
}
|
|
91984
|
-
/**
|
|
91985
|
-
* Adds color selector elements to focus tracker.
|
|
91986
|
-
*/
|
|
91987
|
-
_addColorSelectorElementsToFocusTracker() {
|
|
91988
|
-
this.focusTracker.add(this.removeColorButtonView.element);
|
|
91989
|
-
this._focusables.add(this.removeColorButtonView);
|
|
91990
|
-
if (this.staticColorsGrid) {
|
|
91991
|
-
this.focusTracker.add(this.staticColorsGrid.element);
|
|
91992
|
-
this._focusables.add(this.staticColorsGrid);
|
|
91993
|
-
}
|
|
91994
|
-
if (this.documentColorsGrid) {
|
|
91995
|
-
this.focusTracker.add(this.documentColorsGrid.element);
|
|
91996
|
-
this._focusables.add(this.documentColorsGrid);
|
|
91997
|
-
}
|
|
91998
|
-
}
|
|
91999
|
-
/**
|
|
92000
|
-
* Creates the button responsible for displaying the color picker component.
|
|
92001
|
-
*/
|
|
92002
|
-
_createColorPickerButton() {
|
|
92003
|
-
this.colorPickerButtonView = new ButtonView();
|
|
92004
|
-
this.colorPickerButtonView.set({
|
|
92005
|
-
label: this._colorPickerLabel,
|
|
92006
|
-
withText: true,
|
|
92007
|
-
icon: icons.colorPalette,
|
|
92008
|
-
class: 'ck-color-selector__color-picker'
|
|
92009
|
-
});
|
|
92010
|
-
this.colorPickerButtonView.on('execute', () => {
|
|
92011
|
-
this.fire('colorPicker:show');
|
|
92012
|
-
});
|
|
92013
|
-
}
|
|
92014
|
-
/**
|
|
92015
|
-
* Adds the remove color button as a child of the current view.
|
|
92016
|
-
*/
|
|
92017
|
-
_createRemoveColorButton() {
|
|
92018
|
-
const buttonView = new ButtonView();
|
|
92019
|
-
buttonView.set({
|
|
92020
|
-
withText: true,
|
|
92021
|
-
icon: icons.eraser,
|
|
92022
|
-
label: this._removeButtonLabel
|
|
92023
|
-
});
|
|
92024
|
-
buttonView.class = 'ck-color-selector__remove-color';
|
|
92025
|
-
buttonView.on('execute', () => {
|
|
92026
|
-
this.fire('execute', {
|
|
92027
|
-
value: null,
|
|
92028
|
-
source: 'removeColorButton'
|
|
92029
|
-
});
|
|
92030
|
-
});
|
|
92031
|
-
buttonView.render();
|
|
92032
|
-
return buttonView;
|
|
92033
|
-
}
|
|
92034
|
-
/**
|
|
92035
|
-
* Creates a static color grid based on the editor configuration.
|
|
92036
|
-
*/
|
|
92037
|
-
_createStaticColorsGrid() {
|
|
92038
|
-
const colorGrid = new ColorGridView(this.locale, {
|
|
92039
|
-
colorDefinitions: this.colorDefinitions,
|
|
92040
|
-
columns: this.columns
|
|
92041
|
-
});
|
|
92042
|
-
colorGrid.on('execute', (evt, data) => {
|
|
92043
|
-
this.fire('execute', {
|
|
92044
|
-
value: data.value,
|
|
92045
|
-
source: 'staticColorsGrid'
|
|
92046
|
-
});
|
|
92047
|
-
});
|
|
92048
|
-
return colorGrid;
|
|
92049
|
-
}
|
|
92050
|
-
/**
|
|
92051
|
-
* Creates the document colors section view and binds it to {@link #documentColors}.
|
|
92052
|
-
*/
|
|
92053
|
-
_createDocumentColorsGrid() {
|
|
92054
|
-
const bind = Template.bind(this.documentColors, this.documentColors);
|
|
92055
|
-
const documentColorsGrid = new ColorGridView(this.locale, {
|
|
92056
|
-
columns: this.columns
|
|
92057
|
-
});
|
|
92058
|
-
documentColorsGrid.extendTemplate({
|
|
92059
|
-
attributes: {
|
|
92060
|
-
class: bind.if('isEmpty', 'ck-hidden')
|
|
92061
|
-
}
|
|
92062
|
-
});
|
|
92063
|
-
documentColorsGrid.items.bindTo(this.documentColors).using(colorObj => {
|
|
92064
|
-
const colorTile = new ColorTileView();
|
|
92065
|
-
colorTile.set({
|
|
92066
|
-
color: colorObj.color,
|
|
92067
|
-
hasBorder: colorObj.options && colorObj.options.hasBorder
|
|
92068
|
-
});
|
|
92069
|
-
if (colorObj.label) {
|
|
92070
|
-
colorTile.set({
|
|
92071
|
-
label: colorObj.label,
|
|
92072
|
-
tooltip: true
|
|
92073
|
-
});
|
|
92074
|
-
}
|
|
92075
|
-
colorTile.on('execute', () => {
|
|
92076
|
-
this.fire('execute', {
|
|
92077
|
-
value: colorObj.color,
|
|
92078
|
-
source: 'documentColorsGrid'
|
|
92079
|
-
});
|
|
92080
|
-
});
|
|
92081
|
-
return colorTile;
|
|
92082
|
-
});
|
|
92083
|
-
// Selected color should be cleared when document colors became empty.
|
|
92084
|
-
this.documentColors.on('change:isEmpty', (evt, name, val) => {
|
|
92085
|
-
if (val) {
|
|
92086
|
-
documentColorsGrid.selectedColor = null;
|
|
92087
|
-
}
|
|
92088
|
-
});
|
|
92089
|
-
return documentColorsGrid;
|
|
92090
|
-
}
|
|
92091
|
-
/**
|
|
92092
|
-
* Adds a given color to the document colors list. If possible, the method will attempt to use
|
|
92093
|
-
* data from the {@link #colorDefinitions} (label, color options).
|
|
92094
|
-
*
|
|
92095
|
-
* @param color A string that stores the value of the recently applied color.
|
|
92096
|
-
*/
|
|
92097
|
-
_addColorToDocumentColors(color) {
|
|
92098
|
-
const predefinedColor = this.colorDefinitions
|
|
92099
|
-
.find(definition => definition.color === color);
|
|
92100
|
-
if (!predefinedColor) {
|
|
92101
|
-
this.documentColors.add({
|
|
92102
|
-
color,
|
|
92103
|
-
label: color,
|
|
92104
|
-
options: {
|
|
92105
|
-
hasBorder: false
|
|
92106
|
-
}
|
|
92107
|
-
});
|
|
92108
|
-
}
|
|
92109
|
-
else {
|
|
92110
|
-
this.documentColors.add(Object.assign({}, predefinedColor));
|
|
92111
|
-
}
|
|
92112
|
-
}
|
|
92113
|
-
}
|
|
92114
|
-
|
|
92115
|
-
/**
|
|
92116
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
92117
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
92118
|
-
*/
|
|
92119
|
-
/**
|
|
92120
|
-
* @module ui/colorselector/colorpickerfragmentview
|
|
92121
|
-
*/
|
|
92122
|
-
/**
|
|
92123
|
-
* One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
|
|
92124
|
-
*
|
|
92125
|
-
* It allows users to select a color from a color picker.
|
|
92126
|
-
*
|
|
92127
|
-
* It consists of the following sub–components:
|
|
92128
|
-
*
|
|
92129
|
-
* * A color picker saturation and hue sliders,
|
|
92130
|
-
* * A text input accepting colors in HEX format,
|
|
92131
|
-
* * "Save" and "Cancel" action buttons.
|
|
92132
|
-
*/
|
|
92133
|
-
class ColorPickerFragmentView extends View$1 {
|
|
92134
|
-
/**
|
|
92135
|
-
* Creates an instance of the view.
|
|
92136
|
-
*
|
|
92137
|
-
* @param locale The localization services instance.
|
|
92138
|
-
* @param focusTracker Tracks information about the DOM focus in the list.
|
|
92139
|
-
* @param focusables A collection of views that can be focused in the view..
|
|
92140
|
-
* @param keystrokes An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
92141
|
-
* @param colorPickerViewConfig The configuration of color picker feature. If set to `false`, the color picker
|
|
92142
|
-
* will not be rendered.
|
|
92143
|
-
*/
|
|
92144
|
-
constructor(locale, { focusTracker, focusables, keystrokes, colorPickerViewConfig }) {
|
|
92145
|
-
super(locale);
|
|
92146
|
-
this.items = this.createCollection();
|
|
92147
|
-
this.focusTracker = focusTracker;
|
|
92148
|
-
this.keystrokes = keystrokes;
|
|
92149
|
-
this.set('isVisible', false);
|
|
92150
|
-
this.set('selectedColor', undefined);
|
|
92151
|
-
this._focusables = focusables;
|
|
92152
|
-
this._colorPickerViewConfig = colorPickerViewConfig;
|
|
92153
|
-
const bind = this.bindTemplate;
|
|
92154
|
-
const { saveButtonView, cancelButtonView } = this._createActionButtons();
|
|
92155
|
-
this.saveButtonView = saveButtonView;
|
|
92156
|
-
this.cancelButtonView = cancelButtonView;
|
|
92157
|
-
this.actionBarView = this._createActionBarView({ saveButtonView, cancelButtonView });
|
|
92158
|
-
this.setTemplate({
|
|
92159
|
-
tag: 'div',
|
|
92160
|
-
attributes: {
|
|
92161
|
-
class: [
|
|
92162
|
-
'ck-color-picker-fragment',
|
|
92163
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
92164
|
-
]
|
|
92165
|
-
},
|
|
92166
|
-
children: this.items
|
|
92167
|
-
});
|
|
92168
|
-
}
|
|
92169
|
-
/**
|
|
92170
|
-
* @inheritDoc
|
|
92171
|
-
*/
|
|
92172
|
-
render() {
|
|
92173
|
-
super.render();
|
|
92174
|
-
const colorPickerView = new ColorPickerView(this.locale, {
|
|
92175
|
-
...this._colorPickerViewConfig
|
|
92176
|
-
});
|
|
92177
|
-
this.colorPickerView = colorPickerView;
|
|
92178
|
-
this.colorPickerView.render();
|
|
92179
|
-
if (this.selectedColor) {
|
|
92180
|
-
colorPickerView.color = this.selectedColor;
|
|
92181
|
-
}
|
|
92182
|
-
this.listenTo(this, 'change:selectedColor', (evt, name, value) => {
|
|
92183
|
-
colorPickerView.color = value;
|
|
92184
|
-
});
|
|
92185
|
-
this.items.add(this.colorPickerView);
|
|
92186
|
-
this.items.add(this.actionBarView);
|
|
92187
|
-
this._addColorPickersElementsToFocusTracker();
|
|
92188
|
-
this._stopPropagationOnArrowsKeys();
|
|
92189
|
-
this._executeOnEnterPress();
|
|
92190
|
-
this._executeUponColorChange();
|
|
92191
|
-
}
|
|
92192
|
-
/**
|
|
92193
|
-
* @inheritDoc
|
|
92194
|
-
*/
|
|
92195
|
-
destroy() {
|
|
92196
|
-
super.destroy();
|
|
92197
|
-
}
|
|
92198
|
-
/**
|
|
92199
|
-
* Focuses the color picker.
|
|
92200
|
-
*/
|
|
92201
|
-
focus() {
|
|
92202
|
-
this.colorPickerView.focus();
|
|
92203
|
-
}
|
|
92204
|
-
/**
|
|
92205
|
-
* Reset validation messages.
|
|
92206
|
-
*/
|
|
92207
|
-
resetValidationStatus() {
|
|
92208
|
-
this.colorPickerView.resetValidationStatus();
|
|
92209
|
-
}
|
|
92210
|
-
/**
|
|
92211
|
-
* When color picker is focused and "enter" is pressed it executes command.
|
|
92212
|
-
*/
|
|
92213
|
-
_executeOnEnterPress() {
|
|
92214
|
-
this.keystrokes.set('enter', evt => {
|
|
92215
|
-
if (this.isVisible && this.focusTracker.focusedElement !== this.cancelButtonView.element && this.colorPickerView.isValid()) {
|
|
92216
|
-
this.fire('execute', {
|
|
92217
|
-
value: this.selectedColor
|
|
92218
|
-
});
|
|
92219
|
-
evt.stopPropagation();
|
|
92220
|
-
evt.preventDefault();
|
|
92221
|
-
}
|
|
92222
|
-
});
|
|
92223
|
-
}
|
|
92224
|
-
/**
|
|
92225
|
-
* Removes default behavior of arrow keys in dropdown.
|
|
92226
|
-
*/
|
|
92227
|
-
_stopPropagationOnArrowsKeys() {
|
|
92228
|
-
const stopPropagation = (data) => data.stopPropagation();
|
|
92229
|
-
this.keystrokes.set('arrowright', stopPropagation);
|
|
92230
|
-
this.keystrokes.set('arrowleft', stopPropagation);
|
|
92231
|
-
this.keystrokes.set('arrowup', stopPropagation);
|
|
92232
|
-
this.keystrokes.set('arrowdown', stopPropagation);
|
|
92233
|
-
}
|
|
92234
|
-
/**
|
|
92235
|
-
* Adds color picker elements to focus tracker.
|
|
92236
|
-
*/
|
|
92237
|
-
_addColorPickersElementsToFocusTracker() {
|
|
92238
|
-
for (const slider of this.colorPickerView.slidersView) {
|
|
92239
|
-
this.focusTracker.add(slider.element);
|
|
92240
|
-
this._focusables.add(slider);
|
|
92241
|
-
}
|
|
92242
|
-
const input = this.colorPickerView.hexInputRow.children.get(1);
|
|
92243
|
-
if (input.element) {
|
|
92244
|
-
this.focusTracker.add(input.element);
|
|
92245
|
-
this._focusables.add(input);
|
|
92246
|
-
}
|
|
92247
|
-
this.focusTracker.add(this.saveButtonView.element);
|
|
92248
|
-
this._focusables.add(this.saveButtonView);
|
|
92249
|
-
this.focusTracker.add(this.cancelButtonView.element);
|
|
92250
|
-
this._focusables.add(this.cancelButtonView);
|
|
92251
|
-
}
|
|
92252
|
-
/**
|
|
92253
|
-
* Creates bar containing "Save" and "Cancel" buttons.
|
|
92254
|
-
*/
|
|
92255
|
-
_createActionBarView({ saveButtonView, cancelButtonView }) {
|
|
92256
|
-
const actionBarRow = new View$1();
|
|
92257
|
-
const children = this.createCollection();
|
|
92258
|
-
children.add(saveButtonView);
|
|
92259
|
-
children.add(cancelButtonView);
|
|
92260
|
-
actionBarRow.setTemplate({
|
|
92261
|
-
tag: 'div',
|
|
92262
|
-
attributes: {
|
|
92263
|
-
class: [
|
|
92264
|
-
'ck',
|
|
92265
|
-
'ck-color-selector_action-bar'
|
|
92266
|
-
]
|
|
92267
|
-
},
|
|
92268
|
-
children
|
|
92269
|
-
});
|
|
92270
|
-
return actionBarRow;
|
|
92271
|
-
}
|
|
92272
|
-
/**
|
|
92273
|
-
* Creates "Save" and "Cancel" buttons.
|
|
92274
|
-
*/
|
|
92275
|
-
_createActionButtons() {
|
|
92276
|
-
const locale = this.locale;
|
|
92277
|
-
const t = locale.t;
|
|
92278
|
-
const saveButtonView = new ButtonView(locale);
|
|
92279
|
-
const cancelButtonView = new ButtonView(locale);
|
|
92280
|
-
saveButtonView.set({
|
|
92281
|
-
icon: icons.check,
|
|
92282
|
-
class: 'ck-button-save',
|
|
92283
|
-
type: 'button',
|
|
92284
|
-
withText: false,
|
|
92285
|
-
label: t('Accept')
|
|
92286
|
-
});
|
|
92287
|
-
cancelButtonView.set({
|
|
92288
|
-
icon: icons.cancel,
|
|
92289
|
-
class: 'ck-button-cancel',
|
|
92290
|
-
type: 'button',
|
|
92291
|
-
withText: false,
|
|
92292
|
-
label: t('Cancel')
|
|
92293
|
-
});
|
|
92294
|
-
saveButtonView.on('execute', () => {
|
|
92295
|
-
if (this.colorPickerView.isValid()) {
|
|
92296
|
-
this.fire('execute', {
|
|
92297
|
-
source: 'colorPickerSaveButton',
|
|
92298
|
-
value: this.selectedColor
|
|
92299
|
-
});
|
|
92300
|
-
}
|
|
92301
|
-
});
|
|
92302
|
-
cancelButtonView.on('execute', () => {
|
|
92303
|
-
this.fire('colorPicker:cancel');
|
|
92304
|
-
});
|
|
92305
|
-
return {
|
|
92306
|
-
saveButtonView, cancelButtonView
|
|
92307
|
-
};
|
|
92308
|
-
}
|
|
92309
|
-
/**
|
|
92310
|
-
* Fires the `execute` event if color in color picker has been changed
|
|
92311
|
-
* by the user.
|
|
92312
|
-
*/
|
|
92313
|
-
_executeUponColorChange() {
|
|
92314
|
-
this.colorPickerView.on('colorSelected', (evt, data) => {
|
|
92315
|
-
this.fire('execute', {
|
|
92316
|
-
value: data.color,
|
|
92317
|
-
source: 'colorPicker'
|
|
92318
|
-
});
|
|
92319
|
-
this.set('selectedColor', data.color);
|
|
92320
|
-
});
|
|
92321
|
-
}
|
|
92322
|
-
}
|
|
92323
|
-
|
|
92324
|
-
var css_248z$L = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";.ck.ck-color-selector{& .ck-color-grids-fragment{& .ck-button.ck-color-selector__color-picker,& .ck-button.ck-color-selector__remove-color{align-items:center;display:flex;@mixin ck-dir rtl{justify-content:flex-start}}}& .ck-color-picker-fragment{& .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around;& .ck-button-cancel,& .ck-button-save{flex:1}}}}";
|
|
90357
|
+
var css_248z$L = ".color-picker-hex-input{width:max-content;& .ck.ck-input{min-width:unset}}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset;& .ck.ck-labeled-field-view{padding-top:unset}& .ck.ck-input-text{width:unset}& .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}}";
|
|
92325
90358
|
styleInject(css_248z$L);
|
|
92326
90359
|
|
|
92327
|
-
|
|
92328
|
-
|
|
92329
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
92330
|
-
*/
|
|
92331
|
-
/**
|
|
92332
|
-
* @module ui/colorselector/colorselectorview
|
|
92333
|
-
*/
|
|
92334
|
-
/**
|
|
92335
|
-
* The configurable color selector view class. It allows users to select colors from a predefined set of colors as well as from
|
|
92336
|
-
* a color picker.
|
|
92337
|
-
*
|
|
92338
|
-
* This meta-view is is made of two components (fragments):
|
|
92339
|
-
*
|
|
92340
|
-
* * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorGridsFragmentView},
|
|
92341
|
-
* * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorPickerFragmentView}.
|
|
92342
|
-
*
|
|
92343
|
-
* ```ts
|
|
92344
|
-
* const colorDefinitions = [
|
|
92345
|
-
* { color: '#000', label: 'Black', options: { hasBorder: false } },
|
|
92346
|
-
* { color: 'rgb(255, 255, 255)', label: 'White', options: { hasBorder: true } },
|
|
92347
|
-
* { color: 'red', label: 'Red', options: { hasBorder: false } }
|
|
92348
|
-
* ];
|
|
92349
|
-
*
|
|
92350
|
-
* const selectorView = new ColorSelectorView( locale, {
|
|
92351
|
-
* colors: colorDefinitions,
|
|
92352
|
-
* columns: 5,
|
|
92353
|
-
* removeButtonLabel: 'Remove color',
|
|
92354
|
-
* documentColorsLabel: 'Document colors',
|
|
92355
|
-
* documentColorsCount: 4,
|
|
92356
|
-
* colorPickerViewConfig: {
|
|
92357
|
-
* format: 'hsl'
|
|
92358
|
-
* }
|
|
92359
|
-
* } );
|
|
92360
|
-
*
|
|
92361
|
-
* selectorView.appendUI();
|
|
92362
|
-
* selectorView.selectedColor = 'red';
|
|
92363
|
-
* selectorView.updateSelectedColors();
|
|
92364
|
-
*
|
|
92365
|
-
* selectorView.on<ColorSelectorExecuteEvent>( 'execute', ( evt, data ) => {
|
|
92366
|
-
* console.log( 'Color changed', data.value, data.source );
|
|
92367
|
-
* } );
|
|
92368
|
-
*
|
|
92369
|
-
* selectorView.on<ColorSelectorColorPickerShowEvent>( 'colorPicker:show', ( evt ) => {
|
|
92370
|
-
* console.log( 'Color picker showed up', evt );
|
|
92371
|
-
* } );
|
|
92372
|
-
*
|
|
92373
|
-
* selectorView.on<ColorSelectorColorPickerCancelEvent>( 'colorPicker:cancel', ( evt ) => {
|
|
92374
|
-
* console.log( 'Color picker cancel', evt );
|
|
92375
|
-
* } );
|
|
92376
|
-
*
|
|
92377
|
-
* selectorView.render();
|
|
92378
|
-
*
|
|
92379
|
-
* document.body.appendChild( selectorView.element );
|
|
92380
|
-
* ```
|
|
92381
|
-
*/
|
|
92382
|
-
class ColorSelectorView extends View$1 {
|
|
92383
|
-
/**
|
|
92384
|
-
* Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
|
|
92385
|
-
*
|
|
92386
|
-
* @param locale The localization services instance.
|
|
92387
|
-
* @param colors An array with definitions of colors to be displayed in the table.
|
|
92388
|
-
* @param columns The number of columns in the color grid.
|
|
92389
|
-
* @param removeButtonLabel The label of the button responsible for removing the color.
|
|
92390
|
-
* @param colorPickerLabel The label of the button responsible for color picker appearing.
|
|
92391
|
-
* @param documentColorsLabel The label for the section with the document colors.
|
|
92392
|
-
* @param documentColorsCount The number of colors in the document colors section inside the color dropdown.
|
|
92393
|
-
* @param colorPickerViewConfig The configuration of color picker feature. If set to `false`, the color picker will be hidden.
|
|
92394
|
-
*/
|
|
92395
|
-
constructor(locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, colorPickerViewConfig }) {
|
|
92396
|
-
super(locale);
|
|
92397
|
-
this.items = this.createCollection();
|
|
92398
|
-
this.focusTracker = new FocusTracker();
|
|
92399
|
-
this.keystrokes = new KeystrokeHandler();
|
|
92400
|
-
this._focusables = new ViewCollection();
|
|
92401
|
-
this._colorPickerViewConfig = colorPickerViewConfig;
|
|
92402
|
-
this._focusCycler = new FocusCycler({
|
|
92403
|
-
focusables: this._focusables,
|
|
92404
|
-
focusTracker: this.focusTracker,
|
|
92405
|
-
keystrokeHandler: this.keystrokes,
|
|
92406
|
-
actions: {
|
|
92407
|
-
// Navigate list items backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.
|
|
92408
|
-
focusPrevious: 'shift + tab',
|
|
92409
|
-
// Navigate list items forwards using the <kbd>Tab</kbd> key.
|
|
92410
|
-
focusNext: 'tab'
|
|
92411
|
-
}
|
|
92412
|
-
});
|
|
92413
|
-
this.colorGridsFragmentView = new ColorGridsFragmentView(locale, {
|
|
92414
|
-
colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel,
|
|
92415
|
-
focusTracker: this.focusTracker,
|
|
92416
|
-
focusables: this._focusables
|
|
92417
|
-
});
|
|
92418
|
-
this.colorPickerFragmentView = new ColorPickerFragmentView(locale, {
|
|
92419
|
-
focusables: this._focusables,
|
|
92420
|
-
focusTracker: this.focusTracker,
|
|
92421
|
-
keystrokes: this.keystrokes,
|
|
92422
|
-
colorPickerViewConfig
|
|
92423
|
-
});
|
|
92424
|
-
this.set('_isColorGridsFragmentVisible', true);
|
|
92425
|
-
this.set('_isColorPickerFragmentVisible', false);
|
|
92426
|
-
this.set('selectedColor', undefined);
|
|
92427
|
-
this.colorGridsFragmentView.bind('isVisible').to(this, '_isColorGridsFragmentVisible');
|
|
92428
|
-
this.colorPickerFragmentView.bind('isVisible').to(this, '_isColorPickerFragmentVisible');
|
|
92429
|
-
/**
|
|
92430
|
-
* This is kind of bindings. Unfortunately we could not use this.bind() method because the same property
|
|
92431
|
-
* can not be bound twice. So this is work around how to bind 'selectedColor' property between components.
|
|
92432
|
-
*/
|
|
92433
|
-
this.on('change:selectedColor', (evt, evtName, data) => {
|
|
92434
|
-
this.colorGridsFragmentView.set('selectedColor', data);
|
|
92435
|
-
this.colorPickerFragmentView.set('selectedColor', data);
|
|
92436
|
-
});
|
|
92437
|
-
this.colorGridsFragmentView.on('change:selectedColor', (evt, evtName, data) => {
|
|
92438
|
-
this.set('selectedColor', data);
|
|
92439
|
-
});
|
|
92440
|
-
this.colorPickerFragmentView.on('change:selectedColor', (evt, evtName, data) => {
|
|
92441
|
-
this.set('selectedColor', data);
|
|
92442
|
-
});
|
|
92443
|
-
this.setTemplate({
|
|
92444
|
-
tag: 'div',
|
|
92445
|
-
attributes: {
|
|
92446
|
-
class: [
|
|
92447
|
-
'ck',
|
|
92448
|
-
'ck-color-selector'
|
|
92449
|
-
]
|
|
92450
|
-
},
|
|
92451
|
-
children: this.items
|
|
92452
|
-
});
|
|
92453
|
-
}
|
|
92454
|
-
/**
|
|
92455
|
-
* @inheritDoc
|
|
92456
|
-
*/
|
|
92457
|
-
render() {
|
|
92458
|
-
super.render();
|
|
92459
|
-
// Start listening for the keystrokes coming from #element.
|
|
92460
|
-
this.keystrokes.listenTo(this.element);
|
|
92461
|
-
}
|
|
92462
|
-
/**
|
|
92463
|
-
* @inheritDoc
|
|
92464
|
-
*/
|
|
92465
|
-
destroy() {
|
|
92466
|
-
super.destroy();
|
|
92467
|
-
this.focusTracker.destroy();
|
|
92468
|
-
this.keystrokes.destroy();
|
|
92469
|
-
}
|
|
92470
|
-
/**
|
|
92471
|
-
* Renders the internals of the component on demand:
|
|
92472
|
-
* * {@link #colorPickerFragmentView},
|
|
92473
|
-
* * {@link #colorGridsFragmentView}.
|
|
92474
|
-
*
|
|
92475
|
-
* It allows for deferring component initialization to improve the performance.
|
|
92476
|
-
*
|
|
92477
|
-
* See {@link #showColorPickerFragment}, {@link #showColorGridsFragment}.
|
|
92478
|
-
*/
|
|
92479
|
-
appendUI() {
|
|
92480
|
-
this._appendColorGridsFragment();
|
|
92481
|
-
if (this._colorPickerViewConfig) {
|
|
92482
|
-
this._appendColorPickerFragment();
|
|
92483
|
-
}
|
|
92484
|
-
}
|
|
92485
|
-
/**
|
|
92486
|
-
* Shows the {@link #colorPickerFragmentView} and hides the {@link #colorGridsFragmentView}.
|
|
92487
|
-
*
|
|
92488
|
-
* **Note**: It requires {@link #appendUI} to be called first.
|
|
92489
|
-
*
|
|
92490
|
-
* See {@link #showColorGridsFragment}, {@link ~ColorSelectorView#event:colorPicker:show}.
|
|
92491
|
-
*/
|
|
92492
|
-
showColorPickerFragment() {
|
|
92493
|
-
if (!this.colorPickerFragmentView.colorPickerView || this._isColorPickerFragmentVisible) {
|
|
92494
|
-
return;
|
|
92495
|
-
}
|
|
92496
|
-
this._isColorPickerFragmentVisible = true;
|
|
92497
|
-
this.colorPickerFragmentView.focus();
|
|
92498
|
-
this.colorPickerFragmentView.resetValidationStatus();
|
|
92499
|
-
this._isColorGridsFragmentVisible = false;
|
|
92500
|
-
}
|
|
92501
|
-
/**
|
|
92502
|
-
* Shows the {@link #colorGridsFragmentView} and hides the {@link #colorPickerFragmentView}.
|
|
92503
|
-
*
|
|
92504
|
-
* See {@link #showColorPickerFragment}.
|
|
92505
|
-
*
|
|
92506
|
-
* **Note**: It requires {@link #appendUI} to be called first.
|
|
92507
|
-
*/
|
|
92508
|
-
showColorGridsFragment() {
|
|
92509
|
-
if (this._isColorGridsFragmentVisible) {
|
|
92510
|
-
return;
|
|
92511
|
-
}
|
|
92512
|
-
this._isColorGridsFragmentVisible = true;
|
|
92513
|
-
this.colorGridsFragmentView.focus();
|
|
92514
|
-
this._isColorPickerFragmentVisible = false;
|
|
92515
|
-
}
|
|
92516
|
-
/**
|
|
92517
|
-
* Focuses the first focusable element in {@link #items}.
|
|
92518
|
-
*/
|
|
92519
|
-
focus() {
|
|
92520
|
-
this._focusCycler.focusFirst();
|
|
92521
|
-
}
|
|
92522
|
-
/**
|
|
92523
|
-
* Focuses the last focusable element in {@link #items}.
|
|
92524
|
-
*/
|
|
92525
|
-
focusLast() {
|
|
92526
|
-
this._focusCycler.focusLast();
|
|
92527
|
-
}
|
|
92528
|
-
/**
|
|
92529
|
-
* Scans through the editor model and searches for text node attributes with the given `attributeName`.
|
|
92530
|
-
* Found entries are set as document colors in {@link #colorGridsFragmentView}.
|
|
92531
|
-
*
|
|
92532
|
-
* All the previously stored document colors will be lost in the process.
|
|
92533
|
-
*
|
|
92534
|
-
* @param model The model used as a source to obtain the document colors.
|
|
92535
|
-
* @param attributeName Determines the name of the related model's attribute for a given dropdown.
|
|
92536
|
-
*/
|
|
92537
|
-
updateDocumentColors(model, attributeName) {
|
|
92538
|
-
this.colorGridsFragmentView.updateDocumentColors(model, attributeName);
|
|
92539
|
-
}
|
|
92540
|
-
/**
|
|
92541
|
-
* Refreshes the state of the selected color in one or both grids located in {@link #colorGridsFragmentView}.
|
|
92542
|
-
*
|
|
92543
|
-
* It guarantees that the selection will occur only in one of them.
|
|
92544
|
-
*/
|
|
92545
|
-
updateSelectedColors() {
|
|
92546
|
-
this.colorGridsFragmentView.updateSelectedColors();
|
|
92547
|
-
}
|
|
92548
|
-
/**
|
|
92549
|
-
* Appends the view containing static and document color grid views.
|
|
92550
|
-
*/
|
|
92551
|
-
_appendColorGridsFragment() {
|
|
92552
|
-
if (this.items.length) {
|
|
92553
|
-
return;
|
|
92554
|
-
}
|
|
92555
|
-
this.items.add(this.colorGridsFragmentView);
|
|
92556
|
-
this.colorGridsFragmentView.delegate('execute').to(this);
|
|
92557
|
-
this.colorGridsFragmentView.delegate('colorPicker:show').to(this);
|
|
92558
|
-
}
|
|
92559
|
-
/**
|
|
92560
|
-
* Appends the view with the color picker.
|
|
92561
|
-
*/
|
|
92562
|
-
_appendColorPickerFragment() {
|
|
92563
|
-
if (this.items.length === 2) {
|
|
92564
|
-
return;
|
|
92565
|
-
}
|
|
92566
|
-
this.items.add(this.colorPickerFragmentView);
|
|
92567
|
-
if (this.colorGridsFragmentView.colorPickerButtonView) {
|
|
92568
|
-
this.colorGridsFragmentView.colorPickerButtonView.on('execute', () => {
|
|
92569
|
-
this.showColorPickerFragment();
|
|
92570
|
-
});
|
|
92571
|
-
}
|
|
92572
|
-
this.colorGridsFragmentView.addColorPickerButton();
|
|
92573
|
-
this.colorPickerFragmentView.delegate('execute').to(this);
|
|
92574
|
-
this.colorPickerFragmentView.delegate('colorPicker:cancel').to(this);
|
|
92575
|
-
}
|
|
92576
|
-
}
|
|
90360
|
+
var css_248z$K = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";.ck.ck-color-selector{& .ck-color-grids-fragment{& .ck-button.ck-color-selector__color-picker,& .ck-button.ck-color-selector__remove-color{align-items:center;display:flex;@mixin ck-dir rtl{justify-content:flex-start}}}& .ck-color-picker-fragment{& .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around;& .ck-button-cancel,& .ck-button-save{flex:1}}}}";
|
|
90361
|
+
styleInject(css_248z$K);
|
|
92577
90362
|
|
|
92578
90363
|
/**
|
|
92579
90364
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -92679,8 +90464,8 @@ function getNormalized(name) {
|
|
|
92679
90464
|
return String(name).toLowerCase();
|
|
92680
90465
|
}
|
|
92681
90466
|
|
|
92682
|
-
var css_248z$
|
|
92683
|
-
styleInject(css_248z$
|
|
90467
|
+
var css_248z$J = "@import \"../../mixins/_unselectable.css\";.ck.ck-balloon-panel.ck-tooltip{@mixin ck-unselectable;z-index:calc(var(--ck-z-dialog) + 100)}";
|
|
90468
|
+
styleInject(css_248z$J);
|
|
92684
90469
|
|
|
92685
90470
|
/**
|
|
92686
90471
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -93518,8 +91303,8 @@ function getLicenseTypeFromLicenseKey(licenseKey) {
|
|
|
93518
91303
|
return licenseContent.licenseType || 'production';
|
|
93519
91304
|
}
|
|
93520
91305
|
|
|
93521
|
-
var css_248z$
|
|
93522
|
-
styleInject(css_248z$
|
|
91306
|
+
var css_248z$I = ".ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}";
|
|
91307
|
+
styleInject(css_248z$I);
|
|
93523
91308
|
|
|
93524
91309
|
/**
|
|
93525
91310
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -93685,8 +91470,8 @@ class AriaLiveAnnouncerRegionView extends View$1 {
|
|
|
93685
91470
|
}
|
|
93686
91471
|
}
|
|
93687
91472
|
|
|
93688
|
-
var css_248z$
|
|
93689
|
-
styleInject(css_248z$
|
|
91473
|
+
var css_248z$H = "";
|
|
91474
|
+
styleInject(css_248z$H);
|
|
93690
91475
|
|
|
93691
91476
|
/**
|
|
93692
91477
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -95624,8 +93409,8 @@ function getToolbarDefinitionWeight(toolbarDef) {
|
|
|
95624
93409
|
return weight;
|
|
95625
93410
|
}
|
|
95626
93411
|
|
|
95627
|
-
var css_248z$
|
|
95628
|
-
styleInject(css_248z$
|
|
93412
|
+
var css_248z$G = "";
|
|
93413
|
+
styleInject(css_248z$G);
|
|
95629
93414
|
|
|
95630
93415
|
/**
|
|
95631
93416
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -95956,12 +93741,12 @@ class Model extends /* #__PURE__ */ ObservableMixin() {
|
|
|
95956
93741
|
}
|
|
95957
93742
|
}
|
|
95958
93743
|
|
|
95959
|
-
var css_248z$
|
|
95960
|
-
styleInject(css_248z$G);
|
|
95961
|
-
|
|
95962
|
-
var css_248z$F = ".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}";
|
|
93744
|
+
var css_248z$F = ".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}";
|
|
95963
93745
|
styleInject(css_248z$F);
|
|
95964
93746
|
|
|
93747
|
+
var css_248z$E = ".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}";
|
|
93748
|
+
styleInject(css_248z$E);
|
|
93749
|
+
|
|
95965
93750
|
/**
|
|
95966
93751
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
95967
93752
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -96532,8 +94317,8 @@ class FakePanelsView extends View$1 {
|
|
|
96532
94317
|
}
|
|
96533
94318
|
}
|
|
96534
94319
|
|
|
96535
|
-
var css_248z$
|
|
96536
|
-
styleInject(css_248z$
|
|
94320
|
+
var css_248z$D = ".ck.ck-sticky-panel{& .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}& .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}}";
|
|
94321
|
+
styleInject(css_248z$D);
|
|
96537
94322
|
|
|
96538
94323
|
/**
|
|
96539
94324
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -96955,8 +94740,8 @@ class SearchResultsView extends View$1 {
|
|
|
96955
94740
|
}
|
|
96956
94741
|
}
|
|
96957
94742
|
|
|
96958
|
-
var css_248z$
|
|
96959
|
-
styleInject(css_248z$
|
|
94743
|
+
var css_248z$C = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";.ck.ck-search{&>.ck-labeled-field-view{& .ck-search__reset,&>.ck-labeled-field-view__input-wrapper>.ck-icon{position:absolute;top:50%;transform:translateY(-50%)}}&>.ck-search__results{&>.ck-search__info{&>span:first-child{display:block}&:not(.ck-hidden)~*{display:none}}}}";
|
|
94744
|
+
styleInject(css_248z$C);
|
|
96960
94745
|
|
|
96961
94746
|
/**
|
|
96962
94747
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -97153,8 +94938,8 @@ class SearchTextView extends View$1 {
|
|
|
97153
94938
|
}
|
|
97154
94939
|
}
|
|
97155
94940
|
|
|
97156
|
-
var css_248z$
|
|
97157
|
-
styleInject(css_248z$
|
|
94941
|
+
var css_248z$B = ".ck.ck-autocomplete{position:relative;&>.ck-search__results{position:absolute;z-index:var(--ck-z-panel);&.ck-search__results_n{bottom:100%}&.ck-search__results_s{bottom:auto;top:100%}}}";
|
|
94942
|
+
styleInject(css_248z$B);
|
|
97158
94943
|
|
|
97159
94944
|
/**
|
|
97160
94945
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -97307,18 +95092,18 @@ AutocompleteView.defaultResultsPositions = [
|
|
|
97307
95092
|
*/
|
|
97308
95093
|
AutocompleteView._getOptimalPosition = getOptimalPosition;
|
|
97309
95094
|
|
|
97310
|
-
var css_248z$
|
|
97311
|
-
styleInject(css_248z$B);
|
|
97312
|
-
|
|
97313
|
-
var css_248z$A = ":root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}";
|
|
95095
|
+
var css_248z$A = ".ck.ck-highlighted-text mark{background:var(--ck-color-highlight-background);font-size:inherit;font-weight:inherit;line-height:inherit;vertical-align:initial}";
|
|
97314
95096
|
styleInject(css_248z$A);
|
|
97315
95097
|
|
|
97316
|
-
var css_248z$z = ".ck.ck-block-
|
|
95098
|
+
var css_248z$z = ":root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}";
|
|
97317
95099
|
styleInject(css_248z$z);
|
|
97318
95100
|
|
|
97319
|
-
var css_248z$y = ".ck.ck-
|
|
95101
|
+
var css_248z$y = ".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}";
|
|
97320
95102
|
styleInject(css_248z$y);
|
|
97321
95103
|
|
|
95104
|
+
var css_248z$x = ".ck.ck-menu-bar__menu{&>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}}";
|
|
95105
|
+
styleInject(css_248z$x);
|
|
95106
|
+
|
|
97322
95107
|
/**
|
|
97323
95108
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
97324
95109
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -97380,8 +95165,8 @@ class MenuBarMenuButtonView extends ListItemButtonView {
|
|
|
97380
95165
|
}
|
|
97381
95166
|
}
|
|
97382
95167
|
|
|
97383
|
-
var css_248z$
|
|
97384
|
-
styleInject(css_248z$
|
|
95168
|
+
var css_248z$w = ":root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel);&.ck-menu-bar__menu__panel_position_ne,&.ck-menu-bar__menu__panel_position_nw{bottom:100%}&.ck-menu-bar__menu__panel_position_se,&.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}&.ck-menu-bar__menu__panel_position_ne,&.ck-menu-bar__menu__panel_position_se{left:0}&.ck-menu-bar__menu__panel_position_nw,&.ck-menu-bar__menu__panel_position_sw{right:0}&.ck-menu-bar__menu__panel_position_en,&.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}&.ck-menu-bar__menu__panel_position_es{top:0}&.ck-menu-bar__menu__panel_position_en{bottom:0}&.ck-menu-bar__menu__panel_position_wn,&.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}&.ck-menu-bar__menu__panel_position_ws{top:0}&.ck-menu-bar__menu__panel_position_wn{bottom:0}}";
|
|
95169
|
+
styleInject(css_248z$w);
|
|
97385
95170
|
|
|
97386
95171
|
/**
|
|
97387
95172
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -97442,8 +95227,8 @@ class MenuBarMenuPanelView extends View$1 {
|
|
|
97442
95227
|
}
|
|
97443
95228
|
}
|
|
97444
95229
|
|
|
97445
|
-
var css_248z$
|
|
97446
|
-
styleInject(css_248z$
|
|
95230
|
+
var css_248z$v = ".ck.ck-menu-bar__menu{display:block;position:relative}";
|
|
95231
|
+
styleInject(css_248z$v);
|
|
97447
95232
|
|
|
97448
95233
|
/**
|
|
97449
95234
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -97721,8 +95506,8 @@ class MenuBarMenuListItemFileDialogButtonView extends FileDialogListItemButtonVi
|
|
|
97721
95506
|
}
|
|
97722
95507
|
}
|
|
97723
95508
|
|
|
97724
|
-
var css_248z$
|
|
97725
|
-
styleInject(css_248z$
|
|
95509
|
+
var css_248z$u = "";
|
|
95510
|
+
styleInject(css_248z$u);
|
|
97726
95511
|
|
|
97727
95512
|
/**
|
|
97728
95513
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -98207,8 +95992,8 @@ class ClassicEditorUI extends EditorUI {
|
|
|
98207
95992
|
}
|
|
98208
95993
|
}
|
|
98209
95994
|
|
|
98210
|
-
var css_248z$
|
|
98211
|
-
styleInject(css_248z$
|
|
95995
|
+
var css_248z$t = ".ck.ck-editor{position:relative;& .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}}";
|
|
95996
|
+
styleInject(css_248z$t);
|
|
98212
95997
|
|
|
98213
95998
|
/**
|
|
98214
95999
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -102496,8 +100281,8 @@ function getTypeAroundFakeCaretPosition(selection) {
|
|
|
102496
100281
|
|
|
102497
100282
|
var returnIcon = "<svg viewBox=\"0 0 10 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038\"/></svg>";
|
|
102498
100283
|
|
|
102499
|
-
var css_248z$
|
|
102500
|
-
styleInject(css_248z$
|
|
100284
|
+
var css_248z$s = ".ck .ck-widget{& .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default);& svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}&.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}&.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}}&.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,&>.ck-widget__type-around>.ck-widget__type-around__button:hover{&:after{content:\"\";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}}&>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}&:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}&.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}&.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}";
|
|
100285
|
+
styleInject(css_248z$s);
|
|
102501
100286
|
|
|
102502
100287
|
/**
|
|
102503
100288
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -103466,8 +101251,8 @@ function selectionWillShrink(selection, isForward) {
|
|
|
103466
101251
|
return !selection.isCollapsed && selection.isBackward == isForward;
|
|
103467
101252
|
}
|
|
103468
101253
|
|
|
103469
|
-
var css_248z$
|
|
103470
|
-
styleInject(css_248z$
|
|
101254
|
+
var css_248z$r = ":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative;& .ck-widget__selection-handle{position:absolute;& .ck-icon{display:block}}&.ck-widget_selected>.ck-widget__selection-handle,&:hover>.ck-widget__selection-handle{visibility:visible}}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small);&.ck-orientation-above-center,&.ck-orientation-bottom-left,&.ck-orientation-bottom-right,&.ck-orientation-top-left,&.ck-orientation-top-right{position:absolute}&.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}&.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}&.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}&.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}&.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}}";
|
|
101255
|
+
styleInject(css_248z$r);
|
|
103471
101256
|
|
|
103472
101257
|
/**
|
|
103473
101258
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -104336,8 +102121,8 @@ function isWidgetSelected(selection) {
|
|
|
104336
102121
|
return !!(viewElement && isWidget(viewElement));
|
|
104337
102122
|
}
|
|
104338
102123
|
|
|
104339
|
-
var css_248z$
|
|
104340
|
-
styleInject(css_248z$
|
|
102124
|
+
var css_248z$q = ".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected{&>.ck-widget__resizer{display:block}}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute;&.ck-widget__resizer__handle-bottom-right,&.ck-widget__resizer__handle-top-left{cursor:nwse-resize}&.ck-widget__resizer__handle-bottom-left,&.ck-widget__resizer__handle-top-right{cursor:nesw-resize}}";
|
|
102125
|
+
styleInject(css_248z$q);
|
|
104341
102126
|
|
|
104342
102127
|
/**
|
|
104343
102128
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -104889,8 +102674,8 @@ class DragDropBlockToolbar extends Plugin {
|
|
|
104889
102674
|
}
|
|
104890
102675
|
}
|
|
104891
102676
|
|
|
104892
|
-
var css_248z$
|
|
104893
|
-
styleInject(css_248z$
|
|
102677
|
+
var css_248z$p = ".ck.ck-editor__editable{& .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative;& span{position:absolute;width:0}}& .ck-widget:-webkit-drag{&>.ck-widget__selection-handle,&>.ck-widget__type-around{display:none}}}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}";
|
|
102678
|
+
styleInject(css_248z$p);
|
|
104894
102679
|
|
|
104895
102680
|
/**
|
|
104896
102681
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -106938,8 +104723,8 @@ function getLocalizedOptions(editor) {
|
|
|
106938
104723
|
});
|
|
106939
104724
|
}
|
|
106940
104725
|
|
|
106941
|
-
var css_248z$
|
|
106942
|
-
styleInject(css_248z$
|
|
104726
|
+
var css_248z$o = ".ck.ck-heading_heading1 .ck-button__label{font-size:20px}.ck.ck-heading_heading2 .ck-button__label{font-size:17px}.ck.ck-heading_heading3 .ck-button__label{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}";
|
|
104727
|
+
styleInject(css_248z$o);
|
|
106943
104728
|
|
|
106944
104729
|
/**
|
|
106945
104730
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -107448,8 +105233,8 @@ class Bold extends Plugin {
|
|
|
107448
105233
|
}
|
|
107449
105234
|
}
|
|
107450
105235
|
|
|
107451
|
-
var css_248z$
|
|
107452
|
-
styleInject(css_248z$
|
|
105236
|
+
var css_248z$n = ".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}";
|
|
105237
|
+
styleInject(css_248z$n);
|
|
107453
105238
|
|
|
107454
105239
|
/**
|
|
107455
105240
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -108309,8 +106094,8 @@ class ManualDecorator extends /* #__PURE__ */ ObservableMixin() {
|
|
|
108309
106094
|
}
|
|
108310
106095
|
}
|
|
108311
106096
|
|
|
108312
|
-
var css_248z$
|
|
108313
|
-
styleInject(css_248z$
|
|
106097
|
+
var css_248z$m = "";
|
|
106098
|
+
styleInject(css_248z$m);
|
|
108314
106099
|
|
|
108315
106100
|
/**
|
|
108316
106101
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -108599,12 +106384,12 @@ function getLinkAttributesAllowedOnText(schema) {
|
|
|
108599
106384
|
return textAttributes.filter(attribute => attribute.startsWith('link'));
|
|
108600
106385
|
}
|
|
108601
106386
|
|
|
108602
|
-
var css_248z$
|
|
108603
|
-
styleInject(css_248z$m);
|
|
108604
|
-
|
|
108605
|
-
var css_248z$l = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";.ck.ck-link-form{align-items:flex-start;display:flex;& .ck-label{display:none}@mixin ck-media-phone{flex-wrap:wrap;& .ck-labeled-field-view{flex-basis:100%}& .ck-button{flex-basis:50%}}}.ck.ck-link-form_layout-vertical{display:block;& .ck-button{&.ck-button-cancel,&.ck-button-save{margin-top:var(--ck-spacing-medium)}}}";
|
|
106387
|
+
var css_248z$l = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";.ck-vertical-form .ck-button{&:after{bottom:-1px;content:\"\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}&:focus:after{display:none}}.ck.ck-responsive-form{@mixin ck-media-phone{& .ck-button{&:after{bottom:-1px;content:\"\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}&:focus:after{display:none}}}}";
|
|
108606
106388
|
styleInject(css_248z$l);
|
|
108607
106389
|
|
|
106390
|
+
var css_248z$k = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";.ck.ck-link-form{align-items:flex-start;display:flex;& .ck-label{display:none}@mixin ck-media-phone{flex-wrap:wrap;& .ck-labeled-field-view{flex-basis:100%}& .ck-button{flex-basis:50%}}}.ck.ck-link-form_layout-vertical{display:block;& .ck-button{&.ck-button-cancel,&.ck-button-save{margin-top:var(--ck-spacing-medium)}}}";
|
|
106391
|
+
styleInject(css_248z$k);
|
|
106392
|
+
|
|
108608
106393
|
/**
|
|
108609
106394
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
108610
106395
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -108872,8 +106657,8 @@ class LinkFormView extends View$1 {
|
|
|
108872
106657
|
}
|
|
108873
106658
|
}
|
|
108874
106659
|
|
|
108875
|
-
var css_248z$
|
|
108876
|
-
styleInject(css_248z$
|
|
106660
|
+
var css_248z$j = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\";.ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap;& .ck-link-actions__preview{display:inline-block;& .ck-button__label{overflow:hidden}}@mixin ck-media-phone{flex-wrap:wrap;& .ck-link-actions__preview{flex-basis:100%}& .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}}";
|
|
106661
|
+
styleInject(css_248z$j);
|
|
108877
106662
|
|
|
108878
106663
|
var unlinkIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z\"/></svg>";
|
|
108879
106664
|
|
|
@@ -110010,8 +107795,8 @@ class Link extends Plugin {
|
|
|
110010
107795
|
}
|
|
110011
107796
|
}
|
|
110012
107797
|
|
|
110013
|
-
var css_248z$
|
|
110014
|
-
styleInject(css_248z$
|
|
107798
|
+
var css_248z$i = ".ck.ck-editor__editable{& a span.image-inline,& figure.image>a{&:after{display:block;position:absolute}}}";
|
|
107799
|
+
styleInject(css_248z$i);
|
|
110015
107800
|
|
|
110016
107801
|
/**
|
|
110017
107802
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -111994,12 +109779,12 @@ function shouldUseBogusParagraph(item, attributeNames, blocks = getAllListItemBl
|
|
|
111994
109779
|
return blocks.length < 2;
|
|
111995
109780
|
}
|
|
111996
109781
|
|
|
111997
|
-
var css_248z$
|
|
111998
|
-
styleInject(css_248z$i);
|
|
111999
|
-
|
|
112000
|
-
var css_248z$h = ".ck-content ol{list-style-type:decimal;& ol{list-style-type:lower-latin;& ol{list-style-type:lower-roman;& ol{list-style-type:upper-latin;& ol{list-style-type:upper-roman}}}}}.ck-content ul{list-style-type:disc;& ul{list-style-type:circle;& ul{list-style-type:square;& ul{list-style-type:square}}}}";
|
|
109782
|
+
var css_248z$h = ".ck-editor__editable .ck-list-bogus-paragraph{display:block}";
|
|
112001
109783
|
styleInject(css_248z$h);
|
|
112002
109784
|
|
|
109785
|
+
var css_248z$g = ".ck-content ol{list-style-type:decimal;& ol{list-style-type:lower-latin;& ol{list-style-type:lower-roman;& ol{list-style-type:upper-latin;& ol{list-style-type:upper-roman}}}}}.ck-content ul{list-style-type:disc;& ul{list-style-type:circle;& ul{list-style-type:square;& ul{list-style-type:square}}}}";
|
|
109786
|
+
styleInject(css_248z$g);
|
|
109787
|
+
|
|
112003
109788
|
/**
|
|
112004
109789
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
112005
109790
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -112810,15 +110595,15 @@ const LIST_STYLE_TYPES = [
|
|
|
112810
110595
|
for (const { listStyle, typeAttribute, listType } of LIST_STYLE_TYPES) {
|
|
112811
110596
|
}
|
|
112812
110597
|
|
|
112813
|
-
var css_248z$
|
|
112814
|
-
styleInject(css_248z$g);
|
|
112815
|
-
|
|
112816
|
-
var css_248z$f = ".ck.ck-list-styles-list{display:grid}";
|
|
110598
|
+
var css_248z$f = "";
|
|
112817
110599
|
styleInject(css_248z$f);
|
|
112818
110600
|
|
|
112819
|
-
var css_248z$e = "
|
|
110601
|
+
var css_248z$e = ".ck.ck-list-styles-list{display:grid}";
|
|
112820
110602
|
styleInject(css_248z$e);
|
|
112821
110603
|
|
|
110604
|
+
var css_248z$d = ":root{--ck-todo-list-checkmark-size:16px}@define-mixin todo-list-checkbox{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size);[dir=rtl]&{left:0;margin-left:-15px;margin-right:0;right:-25px}&:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;height:100%;transition:box-shadow .25s ease-in-out;width:100%;@media (prefers-reduced-motion:reduce){transition:none}}&:after,&:before{content:\"\";display:block;position:absolute}&:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}&[checked]{&:before{background:#26ab33;border-color:#26ab33}&:after{border-color:#fff}}}.ck-content .todo-list{list-style:none;& li{margin-bottom:5px;position:relative;& .todo-list{margin-top:5px}}& .todo-list__label{&>input{@mixin todo-list-checkbox}& .todo-list__label__description{vertical-align:middle}&.todo-list__label_without-description input[type=checkbox]{position:absolute}}}.ck-editor__editable.ck-content .todo-list .todo-list__label{&>input,&>span[contenteditable=false]>input{cursor:pointer;&:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}}&.todo-list__label_without-description,&>span[contenteditable=false]>input{& input[type=checkbox]{position:absolute}}}";
|
|
110605
|
+
styleInject(css_248z$d);
|
|
110606
|
+
|
|
112822
110607
|
/**
|
|
112823
110608
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
112824
110609
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
@@ -113111,8 +110896,8 @@ class BlockQuoteEditing extends Plugin {
|
|
|
113111
110896
|
}
|
|
113112
110897
|
}
|
|
113113
110898
|
|
|
113114
|
-
var css_248z$
|
|
113115
|
-
styleInject(css_248z$
|
|
110899
|
+
var css_248z$c = ".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}";
|
|
110900
|
+
styleInject(css_248z$c);
|
|
113116
110901
|
|
|
113117
110902
|
/**
|
|
113118
110903
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -117141,8 +114926,8 @@ function shouldRefresh(child, mapper) {
|
|
|
117141
114926
|
return isSingleParagraphWithoutAttributes(child) !== viewElement.is('element', 'span');
|
|
117142
114927
|
}
|
|
117143
114928
|
|
|
117144
|
-
var css_248z$
|
|
117145
|
-
styleInject(css_248z$
|
|
114929
|
+
var css_248z$b = "";
|
|
114930
|
+
styleInject(css_248z$b);
|
|
117146
114931
|
|
|
117147
114932
|
/**
|
|
117148
114933
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -117321,8 +115106,8 @@ function upcastCellSpan(type) {
|
|
|
117321
115106
|
};
|
|
117322
115107
|
}
|
|
117323
115108
|
|
|
117324
|
-
var css_248z$
|
|
117325
|
-
styleInject(css_248z$
|
|
115109
|
+
var css_248z$a = ".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}";
|
|
115110
|
+
styleInject(css_248z$a);
|
|
117326
115111
|
|
|
117327
115112
|
/**
|
|
117328
115113
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -117837,8 +115622,8 @@ function addListOption(option, editor, commands, itemDefinitions) {
|
|
|
117837
115622
|
itemDefinitions.add(option);
|
|
117838
115623
|
}
|
|
117839
115624
|
|
|
117840
|
-
var css_248z$
|
|
117841
|
-
styleInject(css_248z$
|
|
115625
|
+
var css_248z$9 = "";
|
|
115626
|
+
styleInject(css_248z$9);
|
|
117842
115627
|
|
|
117843
115628
|
/**
|
|
117844
115629
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -119122,8 +116907,8 @@ function haveSameTableParent(cellA, cellB) {
|
|
|
119122
116907
|
return cellA.parent.parent == cellB.parent.parent;
|
|
119123
116908
|
}
|
|
119124
116909
|
|
|
119125
|
-
var css_248z$
|
|
119126
|
-
styleInject(css_248z$
|
|
116910
|
+
var css_248z$8 = ".ck-content .table{display:table;margin:.9em auto;& table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%;& td,& th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}& th{background:rgba(0,0,0,.05);font-weight:700}}}@media print{.ck-content .table table{height:auto}}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}";
|
|
116911
|
+
styleInject(css_248z$8);
|
|
119127
116912
|
|
|
119128
116913
|
/**
|
|
119129
116914
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
@@ -119266,809 +117051,33 @@ class TableToolbar extends Plugin {
|
|
|
119266
117051
|
}
|
|
119267
117052
|
}
|
|
119268
117053
|
|
|
119269
|
-
var css_248z$
|
|
119270
|
-
styleInject(css_248z$8);
|
|
119271
|
-
|
|
119272
|
-
var css_248z$7 = ".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;&>:not(.ck-label){flex-grow:1}&.ck-table-form__action-row{& .ck-button-cancel,& .ck-button-save{justify-content:center}}}";
|
|
117054
|
+
var css_248z$7 = ".ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%;&>input.ck.ck-input-text{flex-grow:1;min-width:auto}&>div.ck.ck-dropdown{min-width:auto;&>.ck-input-color__button .ck-dropdown__arrow{display:none}}& .ck.ck-input-color__button{display:flex;& .ck.ck-input-color__button__preview{overflow:hidden;position:relative;&>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}}}}";
|
|
119273
117055
|
styleInject(css_248z$7);
|
|
119274
117056
|
|
|
119275
|
-
var css_248z$6 = "";
|
|
117057
|
+
var css_248z$6 = ".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;&>:not(.ck-label){flex-grow:1}&.ck-table-form__action-row{& .ck-button-cancel,& .ck-button-save{justify-content:center}}}";
|
|
119276
117058
|
styleInject(css_248z$6);
|
|
119277
117059
|
|
|
119278
|
-
var css_248z$5 = "
|
|
117060
|
+
var css_248z$5 = "";
|
|
119279
117061
|
styleInject(css_248z$5);
|
|
119280
117062
|
|
|
119281
|
-
var css_248z$4 = ".ck.ck-table-
|
|
117063
|
+
var css_248z$4 = ".ck.ck-table-form{& .ck-form__row{&.ck-table-form__background-row,&.ck-table-form__border-row{flex-wrap:wrap}&.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap;& .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse;& .ck.ck-dropdown{flex-grow:0}}& .ck-table-form__dimension-operator{flex-grow:0}}}& .ck.ck-labeled-field-view{position:relative;& .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1;&:after{content:\"\";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}}}}";
|
|
119282
117064
|
styleInject(css_248z$4);
|
|
119283
117065
|
|
|
119284
|
-
var css_248z$3 = ".ck.ck-table-properties-form{& .ck-form__row{&.ck-table-properties-form__alignment-row{
|
|
117066
|
+
var css_248z$3 = ".ck.ck-table-cell-properties-form{& .ck-form__row{&.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap;& .ck.ck-toolbar{&:first-of-type{flex-grow:0.57}&:last-of-type{flex-grow:0.43}& .ck-button{flex-grow:1}}}}}";
|
|
119285
117067
|
styleInject(css_248z$3);
|
|
119286
117068
|
|
|
119287
|
-
var css_248z$2 = "
|
|
117069
|
+
var css_248z$2 = ".ck.ck-table-properties-form{& .ck-form__row{&.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap;& .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}}}}";
|
|
119288
117070
|
styleInject(css_248z$2);
|
|
119289
117071
|
|
|
119290
|
-
var css_248z$1 = "
|
|
117072
|
+
var css_248z$1 = "@import \"@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css\";:root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word;@mixin ck-media-forced-colors{background-color:unset;color:unset}}.ck.ck-editor__editable .table>figcaption{@mixin ck-media-default-colors{&.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}&.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}";
|
|
119291
117073
|
styleInject(css_248z$1);
|
|
119292
117074
|
|
|
119293
|
-
|
|
119294
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119295
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119296
|
-
*/
|
|
119297
|
-
/**
|
|
119298
|
-
* @module font/fontcommand
|
|
119299
|
-
*/
|
|
119300
|
-
/**
|
|
119301
|
-
* The base font command.
|
|
119302
|
-
*/
|
|
119303
|
-
class FontCommand extends Command {
|
|
119304
|
-
/**
|
|
119305
|
-
* Creates an instance of the command.
|
|
119306
|
-
*
|
|
119307
|
-
* @param editor Editor instance.
|
|
119308
|
-
* @param attributeKey The name of a model attribute on which this command operates.
|
|
119309
|
-
*/
|
|
119310
|
-
constructor(editor, attributeKey) {
|
|
119311
|
-
super(editor);
|
|
119312
|
-
this.attributeKey = attributeKey;
|
|
119313
|
-
}
|
|
119314
|
-
/**
|
|
119315
|
-
* @inheritDoc
|
|
119316
|
-
*/
|
|
119317
|
-
refresh() {
|
|
119318
|
-
const model = this.editor.model;
|
|
119319
|
-
const doc = model.document;
|
|
119320
|
-
this.value = doc.selection.getAttribute(this.attributeKey);
|
|
119321
|
-
this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);
|
|
119322
|
-
}
|
|
119323
|
-
/**
|
|
119324
|
-
* Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.
|
|
119325
|
-
* If no `value` is passed, it removes the attribute from the selection.
|
|
119326
|
-
*
|
|
119327
|
-
* @param options Options for the executed command.
|
|
119328
|
-
* @param options.value The value to apply.
|
|
119329
|
-
* @fires execute
|
|
119330
|
-
*/
|
|
119331
|
-
execute(options = {}) {
|
|
119332
|
-
const model = this.editor.model;
|
|
119333
|
-
const document = model.document;
|
|
119334
|
-
const selection = document.selection;
|
|
119335
|
-
const value = options.value;
|
|
119336
|
-
const batch = options.batch;
|
|
119337
|
-
const updateAttribute = (writer) => {
|
|
119338
|
-
if (selection.isCollapsed) {
|
|
119339
|
-
if (value) {
|
|
119340
|
-
writer.setSelectionAttribute(this.attributeKey, value);
|
|
119341
|
-
}
|
|
119342
|
-
else {
|
|
119343
|
-
writer.removeSelectionAttribute(this.attributeKey);
|
|
119344
|
-
}
|
|
119345
|
-
}
|
|
119346
|
-
else {
|
|
119347
|
-
const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);
|
|
119348
|
-
for (const range of ranges) {
|
|
119349
|
-
if (value) {
|
|
119350
|
-
writer.setAttribute(this.attributeKey, value, range);
|
|
119351
|
-
}
|
|
119352
|
-
else {
|
|
119353
|
-
writer.removeAttribute(this.attributeKey, range);
|
|
119354
|
-
}
|
|
119355
|
-
}
|
|
119356
|
-
}
|
|
119357
|
-
};
|
|
119358
|
-
// In some scenarios, you may want to use a single undo step for multiple changes (e.g. in color picker).
|
|
119359
|
-
if (batch) {
|
|
119360
|
-
model.enqueueChange(batch, writer => {
|
|
119361
|
-
updateAttribute(writer);
|
|
119362
|
-
});
|
|
119363
|
-
}
|
|
119364
|
-
else {
|
|
119365
|
-
model.change(writer => {
|
|
119366
|
-
updateAttribute(writer);
|
|
119367
|
-
});
|
|
119368
|
-
}
|
|
119369
|
-
}
|
|
119370
|
-
}
|
|
119371
|
-
|
|
119372
|
-
/**
|
|
119373
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119374
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119375
|
-
*/
|
|
119376
|
-
/**
|
|
119377
|
-
* The name of the font color plugin.
|
|
119378
|
-
*/
|
|
119379
|
-
const FONT_COLOR = 'fontColor';
|
|
119380
|
-
/**
|
|
119381
|
-
* The name of the font background color plugin.
|
|
119382
|
-
*/
|
|
119383
|
-
const FONT_BACKGROUND_COLOR = 'fontBackgroundColor';
|
|
119384
|
-
/**
|
|
119385
|
-
* A {@link module:font/fontcolor~FontColor font color} and
|
|
119386
|
-
* {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
|
|
119387
|
-
* responsible for upcasting data to the model.
|
|
119388
|
-
*
|
|
119389
|
-
* **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
|
|
119390
|
-
*/
|
|
119391
|
-
function renderUpcastAttribute(styleAttr) {
|
|
119392
|
-
return (viewElement) => normalizeColorCode(viewElement.getStyle(styleAttr));
|
|
119393
|
-
}
|
|
119394
|
-
/**
|
|
119395
|
-
* A {@link module:font/fontcolor~FontColor font color} and
|
|
119396
|
-
* {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
|
|
119397
|
-
* responsible for downcasting a color attribute to a `<span>` element.
|
|
119398
|
-
*
|
|
119399
|
-
* **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
|
|
119400
|
-
*/
|
|
119401
|
-
function renderDowncastElement(styleAttr) {
|
|
119402
|
-
return (modelAttributeValue, { writer }) => writer.createAttributeElement('span', {
|
|
119403
|
-
style: `${styleAttr}:${modelAttributeValue}`
|
|
119404
|
-
}, { priority: 7 });
|
|
119405
|
-
}
|
|
119406
|
-
/**
|
|
119407
|
-
* A helper that adds {@link module:ui/colorselector/colorselectorview~ColorSelectorView} to the color dropdown with proper initial values.
|
|
119408
|
-
*
|
|
119409
|
-
* @param config.dropdownView The dropdown view to which a {@link module:ui/colorselector/colorselectorview~ColorSelectorView}
|
|
119410
|
-
* will be added.
|
|
119411
|
-
* @param config.colors An array with definitions representing colors to be displayed in the color selector.
|
|
119412
|
-
* @param config.removeButtonLabel The label for the button responsible for removing the color.
|
|
119413
|
-
* @param config.documentColorsLabel The label for the section with document colors.
|
|
119414
|
-
* @param config.documentColorsCount The number of document colors inside the dropdown.
|
|
119415
|
-
* @param config.colorPickerViewConfig Configuration of the color picker view.
|
|
119416
|
-
* @returns The new color selector view.
|
|
119417
|
-
*/
|
|
119418
|
-
function addColorSelectorToDropdown({ dropdownView, colors, columns, removeButtonLabel, colorPickerLabel, documentColorsLabel, documentColorsCount, colorPickerViewConfig }) {
|
|
119419
|
-
const locale = dropdownView.locale;
|
|
119420
|
-
const colorSelectorView = new ColorSelectorView(locale, {
|
|
119421
|
-
colors,
|
|
119422
|
-
columns,
|
|
119423
|
-
removeButtonLabel,
|
|
119424
|
-
colorPickerLabel,
|
|
119425
|
-
documentColorsLabel,
|
|
119426
|
-
documentColorsCount,
|
|
119427
|
-
colorPickerViewConfig
|
|
119428
|
-
});
|
|
119429
|
-
dropdownView.colorSelectorView = colorSelectorView;
|
|
119430
|
-
dropdownView.panelView.children.add(colorSelectorView);
|
|
119431
|
-
return colorSelectorView;
|
|
119432
|
-
}
|
|
119433
|
-
/**
|
|
119434
|
-
* Fixes the color value string.
|
|
119435
|
-
*/
|
|
119436
|
-
function normalizeColorCode(value) {
|
|
119437
|
-
return value.replace(/\s/g, '');
|
|
119438
|
-
}
|
|
119439
|
-
|
|
119440
|
-
var css_248z = ".ck-content{& .text-tiny{font-size:.7em}& .text-small{font-size:.85em}& .text-big{font-size:1.4em}& .text-huge{font-size:1.8em}}";
|
|
117075
|
+
var css_248z = ":root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word;position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);bottom:-999999px;opacity:.25;top:-999999px}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}";
|
|
119441
117076
|
styleInject(css_248z);
|
|
119442
117077
|
|
|
119443
|
-
|
|
119444
|
-
|
|
119445
|
-
|
|
119446
|
-
*/
|
|
119447
|
-
/**
|
|
119448
|
-
* The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}
|
|
119449
|
-
* to apply the font color.
|
|
119450
|
-
*
|
|
119451
|
-
* ```ts
|
|
119452
|
-
* editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );
|
|
119453
|
-
* ```
|
|
119454
|
-
*
|
|
119455
|
-
* **Note**: Executing the command with the `null` value removes the attribute from the model.
|
|
119456
|
-
*/
|
|
119457
|
-
class FontColorCommand extends FontCommand {
|
|
119458
|
-
/**
|
|
119459
|
-
* @inheritDoc
|
|
119460
|
-
*/
|
|
119461
|
-
constructor(editor) {
|
|
119462
|
-
super(editor, FONT_COLOR);
|
|
119463
|
-
}
|
|
119464
|
-
}
|
|
119465
|
-
|
|
119466
|
-
/**
|
|
119467
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119468
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119469
|
-
*/
|
|
119470
|
-
/**
|
|
119471
|
-
* @module font/fontcolor/fontcolorediting
|
|
119472
|
-
*/
|
|
119473
|
-
/**
|
|
119474
|
-
* The font color editing feature.
|
|
119475
|
-
*
|
|
119476
|
-
* It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and
|
|
119477
|
-
* the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders
|
|
119478
|
-
* in the {@link module:engine/view/view view} as a `<span>` element (`<span style="color: ...">`),
|
|
119479
|
-
* depending on the {@link module:font/fontconfig~FontColorConfig configuration}.
|
|
119480
|
-
*/
|
|
119481
|
-
class FontColorEditing extends Plugin {
|
|
119482
|
-
/**
|
|
119483
|
-
* @inheritDoc
|
|
119484
|
-
*/
|
|
119485
|
-
static get pluginName() {
|
|
119486
|
-
return 'FontColorEditing';
|
|
119487
|
-
}
|
|
119488
|
-
/**
|
|
119489
|
-
* @inheritDoc
|
|
119490
|
-
*/
|
|
119491
|
-
static get isOfficialPlugin() {
|
|
119492
|
-
return true;
|
|
119493
|
-
}
|
|
119494
|
-
/**
|
|
119495
|
-
* @inheritDoc
|
|
119496
|
-
*/
|
|
119497
|
-
constructor(editor) {
|
|
119498
|
-
super(editor);
|
|
119499
|
-
editor.config.define(FONT_COLOR, {
|
|
119500
|
-
colors: [
|
|
119501
|
-
{
|
|
119502
|
-
color: 'hsl(0, 0%, 0%)',
|
|
119503
|
-
label: 'Black'
|
|
119504
|
-
},
|
|
119505
|
-
{
|
|
119506
|
-
color: 'hsl(0, 0%, 30%)',
|
|
119507
|
-
label: 'Dim grey'
|
|
119508
|
-
},
|
|
119509
|
-
{
|
|
119510
|
-
color: 'hsl(0, 0%, 60%)',
|
|
119511
|
-
label: 'Grey'
|
|
119512
|
-
},
|
|
119513
|
-
{
|
|
119514
|
-
color: 'hsl(0, 0%, 90%)',
|
|
119515
|
-
label: 'Light grey'
|
|
119516
|
-
},
|
|
119517
|
-
{
|
|
119518
|
-
color: 'hsl(0, 0%, 100%)',
|
|
119519
|
-
label: 'White',
|
|
119520
|
-
hasBorder: true
|
|
119521
|
-
},
|
|
119522
|
-
{
|
|
119523
|
-
color: 'hsl(0, 75%, 60%)',
|
|
119524
|
-
label: 'Red'
|
|
119525
|
-
},
|
|
119526
|
-
{
|
|
119527
|
-
color: 'hsl(30, 75%, 60%)',
|
|
119528
|
-
label: 'Orange'
|
|
119529
|
-
},
|
|
119530
|
-
{
|
|
119531
|
-
color: 'hsl(60, 75%, 60%)',
|
|
119532
|
-
label: 'Yellow'
|
|
119533
|
-
},
|
|
119534
|
-
{
|
|
119535
|
-
color: 'hsl(90, 75%, 60%)',
|
|
119536
|
-
label: 'Light green'
|
|
119537
|
-
},
|
|
119538
|
-
{
|
|
119539
|
-
color: 'hsl(120, 75%, 60%)',
|
|
119540
|
-
label: 'Green'
|
|
119541
|
-
},
|
|
119542
|
-
{
|
|
119543
|
-
color: 'hsl(150, 75%, 60%)',
|
|
119544
|
-
label: 'Aquamarine'
|
|
119545
|
-
},
|
|
119546
|
-
{
|
|
119547
|
-
color: 'hsl(180, 75%, 60%)',
|
|
119548
|
-
label: 'Turquoise'
|
|
119549
|
-
},
|
|
119550
|
-
{
|
|
119551
|
-
color: 'hsl(210, 75%, 60%)',
|
|
119552
|
-
label: 'Light blue'
|
|
119553
|
-
},
|
|
119554
|
-
{
|
|
119555
|
-
color: 'hsl(240, 75%, 60%)',
|
|
119556
|
-
label: 'Blue'
|
|
119557
|
-
},
|
|
119558
|
-
{
|
|
119559
|
-
color: 'hsl(270, 75%, 60%)',
|
|
119560
|
-
label: 'Purple'
|
|
119561
|
-
}
|
|
119562
|
-
],
|
|
119563
|
-
columns: 5
|
|
119564
|
-
});
|
|
119565
|
-
editor.conversion.for('upcast').elementToAttribute({
|
|
119566
|
-
view: {
|
|
119567
|
-
name: 'span',
|
|
119568
|
-
styles: {
|
|
119569
|
-
'color': /[\s\S]+/
|
|
119570
|
-
}
|
|
119571
|
-
},
|
|
119572
|
-
model: {
|
|
119573
|
-
key: FONT_COLOR,
|
|
119574
|
-
value: renderUpcastAttribute('color')
|
|
119575
|
-
}
|
|
119576
|
-
});
|
|
119577
|
-
// Support legacy `<font color="..">` formatting.
|
|
119578
|
-
editor.conversion.for('upcast').elementToAttribute({
|
|
119579
|
-
view: {
|
|
119580
|
-
name: 'font',
|
|
119581
|
-
attributes: {
|
|
119582
|
-
'color': /^#?\w+$/
|
|
119583
|
-
}
|
|
119584
|
-
},
|
|
119585
|
-
model: {
|
|
119586
|
-
key: FONT_COLOR,
|
|
119587
|
-
value: (viewElement) => viewElement.getAttribute('color')
|
|
119588
|
-
}
|
|
119589
|
-
});
|
|
119590
|
-
editor.conversion.for('downcast').attributeToElement({
|
|
119591
|
-
model: FONT_COLOR,
|
|
119592
|
-
view: renderDowncastElement('color')
|
|
119593
|
-
});
|
|
119594
|
-
editor.commands.add(FONT_COLOR, new FontColorCommand(editor));
|
|
119595
|
-
// Allow the font color attribute on text nodes.
|
|
119596
|
-
editor.model.schema.extend('$text', { allowAttributes: FONT_COLOR });
|
|
119597
|
-
editor.model.schema.setAttributeProperties(FONT_COLOR, {
|
|
119598
|
-
isFormatting: true,
|
|
119599
|
-
copyOnEnter: true
|
|
119600
|
-
});
|
|
119601
|
-
}
|
|
119602
|
-
}
|
|
119603
|
-
|
|
119604
|
-
/**
|
|
119605
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119606
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119607
|
-
*/
|
|
119608
|
-
/**
|
|
119609
|
-
* @module font/ui/colorui
|
|
119610
|
-
*/
|
|
119611
|
-
/**
|
|
119612
|
-
* The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
|
|
119613
|
-
*
|
|
119614
|
-
* It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
|
|
119615
|
-
* a {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
|
|
119616
|
-
*/
|
|
119617
|
-
class ColorUI extends Plugin {
|
|
119618
|
-
/**
|
|
119619
|
-
* Creates a plugin which introduces a dropdown with a pre–configured
|
|
119620
|
-
* {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
|
|
119621
|
-
*
|
|
119622
|
-
* @param config The configuration object.
|
|
119623
|
-
* @param config.commandName The name of the command which will be executed when a color tile is clicked.
|
|
119624
|
-
* @param config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
|
|
119625
|
-
* and the configuration scope name in `editor.config`.
|
|
119626
|
-
* @param config.icon The SVG icon used by the dropdown.
|
|
119627
|
-
* @param config.dropdownLabel The label used by the dropdown.
|
|
119628
|
-
*/
|
|
119629
|
-
constructor(editor, { commandName, componentName, icon, dropdownLabel }) {
|
|
119630
|
-
super(editor);
|
|
119631
|
-
this.commandName = commandName;
|
|
119632
|
-
this.componentName = componentName;
|
|
119633
|
-
this.icon = icon;
|
|
119634
|
-
this.dropdownLabel = dropdownLabel;
|
|
119635
|
-
this.columns = editor.config.get(`${this.componentName}.columns`);
|
|
119636
|
-
}
|
|
119637
|
-
/**
|
|
119638
|
-
* @inheritDoc
|
|
119639
|
-
*/
|
|
119640
|
-
init() {
|
|
119641
|
-
const editor = this.editor;
|
|
119642
|
-
const locale = editor.locale;
|
|
119643
|
-
const t = locale.t;
|
|
119644
|
-
const command = editor.commands.get(this.commandName);
|
|
119645
|
-
const componentConfig = editor.config.get(this.componentName);
|
|
119646
|
-
const colorsConfig = normalizeColorOptions(componentConfig.colors);
|
|
119647
|
-
const localizedColors = getLocalizedColorOptions(locale, colorsConfig);
|
|
119648
|
-
const documentColorsCount = componentConfig.documentColors;
|
|
119649
|
-
const hasColorPicker = componentConfig.colorPicker !== false;
|
|
119650
|
-
// Register the UI component.
|
|
119651
|
-
editor.ui.componentFactory.add(this.componentName, locale => {
|
|
119652
|
-
const dropdownView = createDropdown(locale);
|
|
119653
|
-
// Font color dropdown rendering is deferred once it gets open to improve performance (#6192).
|
|
119654
|
-
let dropdownContentRendered = false;
|
|
119655
|
-
const colorSelectorView = addColorSelectorToDropdown({
|
|
119656
|
-
dropdownView,
|
|
119657
|
-
colors: localizedColors.map(option => ({
|
|
119658
|
-
label: option.label,
|
|
119659
|
-
color: option.model,
|
|
119660
|
-
options: {
|
|
119661
|
-
hasBorder: option.hasBorder
|
|
119662
|
-
}
|
|
119663
|
-
})),
|
|
119664
|
-
columns: this.columns,
|
|
119665
|
-
removeButtonLabel: t('Remove color'),
|
|
119666
|
-
colorPickerLabel: t('Color picker'),
|
|
119667
|
-
documentColorsLabel: documentColorsCount !== 0 ? t('Document colors') : '',
|
|
119668
|
-
documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount,
|
|
119669
|
-
colorPickerViewConfig: hasColorPicker ? (componentConfig.colorPicker || {}) : false
|
|
119670
|
-
});
|
|
119671
|
-
colorSelectorView.bind('selectedColor').to(command, 'value');
|
|
119672
|
-
dropdownView.buttonView.set({
|
|
119673
|
-
label: this.dropdownLabel,
|
|
119674
|
-
icon: this.icon,
|
|
119675
|
-
tooltip: true
|
|
119676
|
-
});
|
|
119677
|
-
dropdownView.extendTemplate({
|
|
119678
|
-
attributes: {
|
|
119679
|
-
class: 'ck-color-ui-dropdown'
|
|
119680
|
-
}
|
|
119681
|
-
});
|
|
119682
|
-
dropdownView.bind('isEnabled').to(command);
|
|
119683
|
-
colorSelectorView.on('execute', (evt, data) => {
|
|
119684
|
-
if (dropdownView.isOpen) {
|
|
119685
|
-
editor.execute(this.commandName, {
|
|
119686
|
-
value: data.value,
|
|
119687
|
-
batch: this._undoStepBatch
|
|
119688
|
-
});
|
|
119689
|
-
}
|
|
119690
|
-
if (data.source !== 'colorPicker') {
|
|
119691
|
-
editor.editing.view.focus();
|
|
119692
|
-
}
|
|
119693
|
-
if (data.source === 'colorPickerSaveButton') {
|
|
119694
|
-
dropdownView.isOpen = false;
|
|
119695
|
-
}
|
|
119696
|
-
});
|
|
119697
|
-
colorSelectorView.on('colorPicker:show', () => {
|
|
119698
|
-
this._undoStepBatch = editor.model.createBatch();
|
|
119699
|
-
});
|
|
119700
|
-
colorSelectorView.on('colorPicker:cancel', () => {
|
|
119701
|
-
if (this._undoStepBatch.operations.length) {
|
|
119702
|
-
// We need to close the dropdown before the undo batch.
|
|
119703
|
-
// Otherwise, ColorUI treats undo as a selected color change,
|
|
119704
|
-
// propagating the update to the whole selection.
|
|
119705
|
-
// That's an issue if spans with various colors were selected.
|
|
119706
|
-
dropdownView.isOpen = false;
|
|
119707
|
-
editor.execute('undo', this._undoStepBatch);
|
|
119708
|
-
}
|
|
119709
|
-
editor.editing.view.focus();
|
|
119710
|
-
});
|
|
119711
|
-
dropdownView.on('change:isOpen', (evt, name, isVisible) => {
|
|
119712
|
-
if (!dropdownContentRendered) {
|
|
119713
|
-
dropdownContentRendered = true;
|
|
119714
|
-
dropdownView.colorSelectorView.appendUI();
|
|
119715
|
-
}
|
|
119716
|
-
if (isVisible) {
|
|
119717
|
-
if (documentColorsCount !== 0) {
|
|
119718
|
-
colorSelectorView.updateDocumentColors(editor.model, this.componentName);
|
|
119719
|
-
}
|
|
119720
|
-
colorSelectorView.updateSelectedColors();
|
|
119721
|
-
colorSelectorView.showColorGridsFragment();
|
|
119722
|
-
}
|
|
119723
|
-
});
|
|
119724
|
-
// Accessibility: focus the first active color when opening the dropdown.
|
|
119725
|
-
focusChildOnDropdownOpen(dropdownView, () => dropdownView.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((item) => item.isOn));
|
|
119726
|
-
return dropdownView;
|
|
119727
|
-
});
|
|
119728
|
-
// Register menu bar button..
|
|
119729
|
-
editor.ui.componentFactory.add(`menuBar:${this.componentName}`, locale => {
|
|
119730
|
-
const menuView = new MenuBarMenuView(locale);
|
|
119731
|
-
menuView.buttonView.set({
|
|
119732
|
-
label: this.dropdownLabel,
|
|
119733
|
-
icon: this.icon
|
|
119734
|
-
});
|
|
119735
|
-
menuView.bind('isEnabled').to(command);
|
|
119736
|
-
// Font color sub-menu rendering is deferred once it gets open to improve performance (#6192).
|
|
119737
|
-
let contentRendered = false;
|
|
119738
|
-
const colorSelectorView = new ColorSelectorView(locale, {
|
|
119739
|
-
colors: localizedColors.map(option => ({
|
|
119740
|
-
label: option.label,
|
|
119741
|
-
color: option.model,
|
|
119742
|
-
options: {
|
|
119743
|
-
hasBorder: option.hasBorder
|
|
119744
|
-
}
|
|
119745
|
-
})),
|
|
119746
|
-
columns: this.columns,
|
|
119747
|
-
removeButtonLabel: t('Remove color'),
|
|
119748
|
-
colorPickerLabel: t('Color picker'),
|
|
119749
|
-
documentColorsLabel: documentColorsCount !== 0 ? t('Document colors') : '',
|
|
119750
|
-
documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount,
|
|
119751
|
-
colorPickerViewConfig: false
|
|
119752
|
-
});
|
|
119753
|
-
colorSelectorView.bind('selectedColor').to(command, 'value');
|
|
119754
|
-
colorSelectorView.delegate('execute').to(menuView);
|
|
119755
|
-
colorSelectorView.on('execute', (evt, data) => {
|
|
119756
|
-
editor.execute(this.commandName, {
|
|
119757
|
-
value: data.value,
|
|
119758
|
-
batch: this._undoStepBatch
|
|
119759
|
-
});
|
|
119760
|
-
editor.editing.view.focus();
|
|
119761
|
-
});
|
|
119762
|
-
menuView.on('change:isOpen', (evt, name, isVisible) => {
|
|
119763
|
-
if (!contentRendered) {
|
|
119764
|
-
contentRendered = true;
|
|
119765
|
-
colorSelectorView.appendUI();
|
|
119766
|
-
}
|
|
119767
|
-
if (isVisible) {
|
|
119768
|
-
if (documentColorsCount !== 0) {
|
|
119769
|
-
colorSelectorView.updateDocumentColors(editor.model, this.componentName);
|
|
119770
|
-
}
|
|
119771
|
-
colorSelectorView.updateSelectedColors();
|
|
119772
|
-
colorSelectorView.showColorGridsFragment();
|
|
119773
|
-
}
|
|
119774
|
-
});
|
|
119775
|
-
menuView.panelView.children.add(colorSelectorView);
|
|
119776
|
-
return menuView;
|
|
119777
|
-
});
|
|
119778
|
-
}
|
|
119779
|
-
}
|
|
119780
|
-
|
|
119781
|
-
var fontColorIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z\"/></svg>";
|
|
119782
|
-
|
|
119783
|
-
/**
|
|
119784
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119785
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119786
|
-
*/
|
|
119787
|
-
/**
|
|
119788
|
-
* @module font/fontcolor/fontcolorui
|
|
119789
|
-
*/
|
|
119790
|
-
/**
|
|
119791
|
-
* The font color UI plugin. It introduces the `'fontColor'` dropdown.
|
|
119792
|
-
*/
|
|
119793
|
-
class FontColorUI extends ColorUI {
|
|
119794
|
-
/**
|
|
119795
|
-
* @inheritDoc
|
|
119796
|
-
*/
|
|
119797
|
-
constructor(editor) {
|
|
119798
|
-
const t = editor.locale.t;
|
|
119799
|
-
super(editor, {
|
|
119800
|
-
commandName: FONT_COLOR,
|
|
119801
|
-
componentName: FONT_COLOR,
|
|
119802
|
-
icon: fontColorIcon,
|
|
119803
|
-
dropdownLabel: t('Font Color')
|
|
119804
|
-
});
|
|
119805
|
-
}
|
|
119806
|
-
/**
|
|
119807
|
-
* @inheritDoc
|
|
119808
|
-
*/
|
|
119809
|
-
static get pluginName() {
|
|
119810
|
-
return 'FontColorUI';
|
|
119811
|
-
}
|
|
119812
|
-
}
|
|
119813
|
-
|
|
119814
|
-
/**
|
|
119815
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119816
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119817
|
-
*/
|
|
119818
|
-
/**
|
|
119819
|
-
* @module font/fontcolor
|
|
119820
|
-
*/
|
|
119821
|
-
/**
|
|
119822
|
-
* The font color plugin.
|
|
119823
|
-
*
|
|
119824
|
-
* For a detailed overview, check the {@glink features/font font feature} documentation
|
|
119825
|
-
* and the {@glink api/font package page}.
|
|
119826
|
-
*
|
|
119827
|
-
* This is a "glue" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
|
|
119828
|
-
* {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.
|
|
119829
|
-
*/
|
|
119830
|
-
class FontColor extends Plugin {
|
|
119831
|
-
/**
|
|
119832
|
-
* @inheritDoc
|
|
119833
|
-
*/
|
|
119834
|
-
static get requires() {
|
|
119835
|
-
return [FontColorEditing, FontColorUI];
|
|
119836
|
-
}
|
|
119837
|
-
/**
|
|
119838
|
-
* @inheritDoc
|
|
119839
|
-
*/
|
|
119840
|
-
static get pluginName() {
|
|
119841
|
-
return 'FontColor';
|
|
119842
|
-
}
|
|
119843
|
-
/**
|
|
119844
|
-
* @inheritDoc
|
|
119845
|
-
*/
|
|
119846
|
-
static get isOfficialPlugin() {
|
|
119847
|
-
return true;
|
|
119848
|
-
}
|
|
119849
|
-
}
|
|
119850
|
-
|
|
119851
|
-
/**
|
|
119852
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119853
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119854
|
-
*/
|
|
119855
|
-
/**
|
|
119856
|
-
* The font background color command. It is used by
|
|
119857
|
-
* {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}
|
|
119858
|
-
* to apply the font background color.
|
|
119859
|
-
*
|
|
119860
|
-
* ```ts
|
|
119861
|
-
* editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );
|
|
119862
|
-
* ```
|
|
119863
|
-
*
|
|
119864
|
-
* **Note**: Executing the command with the `null` value removes the attribute from the model.
|
|
119865
|
-
*/
|
|
119866
|
-
class FontBackgroundColorCommand extends FontCommand {
|
|
119867
|
-
/**
|
|
119868
|
-
* @inheritDoc
|
|
119869
|
-
*/
|
|
119870
|
-
constructor(editor) {
|
|
119871
|
-
super(editor, FONT_BACKGROUND_COLOR);
|
|
119872
|
-
}
|
|
119873
|
-
}
|
|
119874
|
-
|
|
119875
|
-
/**
|
|
119876
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
119877
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
119878
|
-
*/
|
|
119879
|
-
/**
|
|
119880
|
-
* @module font/fontbackgroundcolor/fontbackgroundcolorediting
|
|
119881
|
-
*/
|
|
119882
|
-
/**
|
|
119883
|
-
* The font background color editing feature.
|
|
119884
|
-
*
|
|
119885
|
-
* It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and
|
|
119886
|
-
* the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders
|
|
119887
|
-
* in the {@link module:engine/view/view view} as a `<span>` element (`<span style="background-color: ...">`),
|
|
119888
|
-
* depending on the {@link module:font/fontconfig~FontColorConfig configuration}.
|
|
119889
|
-
*/
|
|
119890
|
-
class FontBackgroundColorEditing extends Plugin {
|
|
119891
|
-
/**
|
|
119892
|
-
* @inheritDoc
|
|
119893
|
-
*/
|
|
119894
|
-
static get pluginName() {
|
|
119895
|
-
return 'FontBackgroundColorEditing';
|
|
119896
|
-
}
|
|
119897
|
-
/**
|
|
119898
|
-
* @inheritDoc
|
|
119899
|
-
*/
|
|
119900
|
-
static get isOfficialPlugin() {
|
|
119901
|
-
return true;
|
|
119902
|
-
}
|
|
119903
|
-
/**
|
|
119904
|
-
* @inheritDoc
|
|
119905
|
-
*/
|
|
119906
|
-
constructor(editor) {
|
|
119907
|
-
super(editor);
|
|
119908
|
-
editor.config.define(FONT_BACKGROUND_COLOR, {
|
|
119909
|
-
colors: [
|
|
119910
|
-
{
|
|
119911
|
-
color: 'hsl(0, 0%, 0%)',
|
|
119912
|
-
label: 'Black'
|
|
119913
|
-
},
|
|
119914
|
-
{
|
|
119915
|
-
color: 'hsl(0, 0%, 30%)',
|
|
119916
|
-
label: 'Dim grey'
|
|
119917
|
-
},
|
|
119918
|
-
{
|
|
119919
|
-
color: 'hsl(0, 0%, 60%)',
|
|
119920
|
-
label: 'Grey'
|
|
119921
|
-
},
|
|
119922
|
-
{
|
|
119923
|
-
color: 'hsl(0, 0%, 90%)',
|
|
119924
|
-
label: 'Light grey'
|
|
119925
|
-
},
|
|
119926
|
-
{
|
|
119927
|
-
color: 'hsl(0, 0%, 100%)',
|
|
119928
|
-
label: 'White',
|
|
119929
|
-
hasBorder: true
|
|
119930
|
-
},
|
|
119931
|
-
{
|
|
119932
|
-
color: 'hsl(0, 75%, 60%)',
|
|
119933
|
-
label: 'Red'
|
|
119934
|
-
},
|
|
119935
|
-
{
|
|
119936
|
-
color: 'hsl(30, 75%, 60%)',
|
|
119937
|
-
label: 'Orange'
|
|
119938
|
-
},
|
|
119939
|
-
{
|
|
119940
|
-
color: 'hsl(60, 75%, 60%)',
|
|
119941
|
-
label: 'Yellow'
|
|
119942
|
-
},
|
|
119943
|
-
{
|
|
119944
|
-
color: 'hsl(90, 75%, 60%)',
|
|
119945
|
-
label: 'Light green'
|
|
119946
|
-
},
|
|
119947
|
-
{
|
|
119948
|
-
color: 'hsl(120, 75%, 60%)',
|
|
119949
|
-
label: 'Green'
|
|
119950
|
-
},
|
|
119951
|
-
{
|
|
119952
|
-
color: 'hsl(150, 75%, 60%)',
|
|
119953
|
-
label: 'Aquamarine'
|
|
119954
|
-
},
|
|
119955
|
-
{
|
|
119956
|
-
color: 'hsl(180, 75%, 60%)',
|
|
119957
|
-
label: 'Turquoise'
|
|
119958
|
-
},
|
|
119959
|
-
{
|
|
119960
|
-
color: 'hsl(210, 75%, 60%)',
|
|
119961
|
-
label: 'Light blue'
|
|
119962
|
-
},
|
|
119963
|
-
{
|
|
119964
|
-
color: 'hsl(240, 75%, 60%)',
|
|
119965
|
-
label: 'Blue'
|
|
119966
|
-
},
|
|
119967
|
-
{
|
|
119968
|
-
color: 'hsl(270, 75%, 60%)',
|
|
119969
|
-
label: 'Purple'
|
|
119970
|
-
}
|
|
119971
|
-
],
|
|
119972
|
-
columns: 5
|
|
119973
|
-
});
|
|
119974
|
-
editor.data.addStyleProcessorRules(addBackgroundRules);
|
|
119975
|
-
editor.conversion.for('upcast').elementToAttribute({
|
|
119976
|
-
view: {
|
|
119977
|
-
name: 'span',
|
|
119978
|
-
styles: {
|
|
119979
|
-
'background-color': /[\s\S]+/
|
|
119980
|
-
}
|
|
119981
|
-
},
|
|
119982
|
-
model: {
|
|
119983
|
-
key: FONT_BACKGROUND_COLOR,
|
|
119984
|
-
value: renderUpcastAttribute('background-color')
|
|
119985
|
-
}
|
|
119986
|
-
});
|
|
119987
|
-
editor.conversion.for('downcast').attributeToElement({
|
|
119988
|
-
model: FONT_BACKGROUND_COLOR,
|
|
119989
|
-
view: renderDowncastElement('background-color')
|
|
119990
|
-
});
|
|
119991
|
-
editor.commands.add(FONT_BACKGROUND_COLOR, new FontBackgroundColorCommand(editor));
|
|
119992
|
-
// Allow the font backgroundColor attribute on text nodes.
|
|
119993
|
-
editor.model.schema.extend('$text', { allowAttributes: FONT_BACKGROUND_COLOR });
|
|
119994
|
-
editor.model.schema.setAttributeProperties(FONT_BACKGROUND_COLOR, {
|
|
119995
|
-
isFormatting: true,
|
|
119996
|
-
copyOnEnter: true
|
|
119997
|
-
});
|
|
119998
|
-
}
|
|
119999
|
-
}
|
|
120000
|
-
|
|
120001
|
-
var fontBackgroundColorIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z\"/></svg>";
|
|
120002
|
-
|
|
120003
|
-
/**
|
|
120004
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
120005
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
120006
|
-
*/
|
|
120007
|
-
/**
|
|
120008
|
-
* @module font/fontbackgroundcolor/fontbackgroundcolorui
|
|
120009
|
-
*/
|
|
120010
|
-
/**
|
|
120011
|
-
* The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.
|
|
120012
|
-
*/
|
|
120013
|
-
class FontBackgroundColorUI extends ColorUI {
|
|
120014
|
-
/**
|
|
120015
|
-
* @inheritDoc
|
|
120016
|
-
*/
|
|
120017
|
-
constructor(editor) {
|
|
120018
|
-
const t = editor.locale.t;
|
|
120019
|
-
super(editor, {
|
|
120020
|
-
commandName: FONT_BACKGROUND_COLOR,
|
|
120021
|
-
componentName: FONT_BACKGROUND_COLOR,
|
|
120022
|
-
icon: fontBackgroundColorIcon,
|
|
120023
|
-
dropdownLabel: t('Font Background Color')
|
|
120024
|
-
});
|
|
120025
|
-
}
|
|
120026
|
-
/**
|
|
120027
|
-
* @inheritDoc
|
|
120028
|
-
*/
|
|
120029
|
-
static get pluginName() {
|
|
120030
|
-
return 'FontBackgroundColorUI';
|
|
120031
|
-
}
|
|
120032
|
-
}
|
|
120033
|
-
|
|
120034
|
-
/**
|
|
120035
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
120036
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
120037
|
-
*/
|
|
120038
|
-
/**
|
|
120039
|
-
* @module font/fontbackgroundcolor
|
|
120040
|
-
*/
|
|
120041
|
-
/**
|
|
120042
|
-
* The font background color plugin.
|
|
120043
|
-
*
|
|
120044
|
-
* For a detailed overview, check the {@glink features/font font feature} documentation
|
|
120045
|
-
* and the {@glink api/font package page}.
|
|
120046
|
-
*
|
|
120047
|
-
* This is a "glue" plugin which loads
|
|
120048
|
-
* the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and
|
|
120049
|
-
* {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.
|
|
120050
|
-
*/
|
|
120051
|
-
class FontBackgroundColor extends Plugin {
|
|
120052
|
-
/**
|
|
120053
|
-
* @inheritDoc
|
|
120054
|
-
*/
|
|
120055
|
-
static get requires() {
|
|
120056
|
-
return [FontBackgroundColorEditing, FontBackgroundColorUI];
|
|
120057
|
-
}
|
|
120058
|
-
/**
|
|
120059
|
-
* @inheritDoc
|
|
120060
|
-
*/
|
|
120061
|
-
static get pluginName() {
|
|
120062
|
-
return 'FontBackgroundColor';
|
|
120063
|
-
}
|
|
120064
|
-
/**
|
|
120065
|
-
* @inheritDoc
|
|
120066
|
-
*/
|
|
120067
|
-
static get isOfficialPlugin() {
|
|
120068
|
-
return true;
|
|
120069
|
-
}
|
|
120070
|
-
}
|
|
120071
|
-
|
|
117078
|
+
// 추가하고 싶은 플러그인들
|
|
117079
|
+
//import { FontColor, FontBackgroundColor } from '@ckeditor/ckeditor5-font';
|
|
117080
|
+
|
|
120072
117081
|
class nxEditor extends nxDiv {
|
|
120073
117082
|
#editor = null;
|
|
120074
117083
|
|