@syncfusion/ej2-richtexteditor 21.2.10 → 22.1.34
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/.eslintrc.json +1 -0
- package/CHANGELOG.md +18 -0
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +1558 -186
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +1571 -189
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/common/config.js +2 -2
- package/src/common/constant.d.ts +6 -0
- package/src/common/constant.js +6 -0
- package/src/common/interface.d.ts +2 -2
- package/src/common/util.js +2 -0
- package/src/editor-manager/base/editor-manager.d.ts +4 -3
- package/src/editor-manager/base/editor-manager.js +6 -1
- package/src/editor-manager/base/interface.d.ts +44 -9
- package/src/editor-manager/plugin/clearformat.d.ts +1 -0
- package/src/editor-manager/plugin/clearformat.js +1 -0
- package/src/editor-manager/plugin/dom-node.js +10 -6
- package/src/editor-manager/plugin/emoji-picker-action.d.ts +8 -0
- package/src/editor-manager/plugin/emoji-picker-action.js +62 -0
- package/src/editor-manager/plugin/format-painter-actions.d.ts +19 -36
- package/src/editor-manager/plugin/format-painter-actions.js +224 -81
- package/src/editor-manager/plugin/inserthtml.js +6 -1
- package/src/editor-manager/plugin/link.js +1 -1
- package/src/editor-manager/plugin/ms-word-clean-up.d.ts +3 -0
- package/src/editor-manager/plugin/ms-word-clean-up.js +40 -7
- package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
- package/src/editor-manager/plugin/selection-commands.js +48 -23
- package/src/editor-manager/plugin/table.js +2 -2
- package/src/editor-manager/plugin/toolbar-status.js +6 -0
- package/src/editor-manager/plugin/undo.d.ts +1 -0
- package/src/editor-manager/plugin/undo.js +26 -5
- package/src/editor-manager/plugin.d.ts +1 -0
- package/src/editor-manager/plugin.js +1 -0
- package/src/global.js +1 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +8 -1
- package/src/rich-text-editor/actions/base-toolbar.js +3 -2
- package/src/rich-text-editor/actions/emoji-picker.d.ts +48 -0
- package/src/rich-text-editor/actions/emoji-picker.js +778 -0
- package/src/rich-text-editor/actions/enter-key.js +2 -2
- package/src/rich-text-editor/actions/execute-command-callback.js +3 -1
- package/src/rich-text-editor/actions/file-manager.js +1 -0
- package/src/rich-text-editor/actions/format-painter.d.ts +2 -2
- package/src/rich-text-editor/actions/format-painter.js +11 -9
- package/src/rich-text-editor/actions/full-screen.js +6 -0
- package/src/rich-text-editor/actions/html-editor.js +11 -2
- package/src/rich-text-editor/actions/paste-clean-up.js +1 -0
- package/src/rich-text-editor/actions/resize.js +1 -1
- package/src/rich-text-editor/actions.d.ts +1 -0
- package/src/rich-text-editor/actions.js +1 -0
- package/src/rich-text-editor/base/constant.d.ts +10 -0
- package/src/rich-text-editor/base/constant.js +10 -0
- package/src/rich-text-editor/base/enum.d.ts +0 -4
- package/src/rich-text-editor/base/interface.d.ts +44 -6
- package/src/rich-text-editor/base/rich-text-editor-model.d.ts +13 -7
- package/src/rich-text-editor/base/rich-text-editor.d.ts +27 -7
- package/src/rich-text-editor/base/rich-text-editor.js +42 -12
- package/src/rich-text-editor/base/util.js +2 -2
- package/src/rich-text-editor/formatter/formatter.js +7 -5
- package/src/rich-text-editor/models/default-locale.js +14 -2
- package/src/rich-text-editor/models/items.d.ts +2 -1
- package/src/rich-text-editor/models/items.js +188 -1
- package/src/rich-text-editor/models/toolbar-settings-model.d.ts +212 -9
- package/src/rich-text-editor/models/toolbar-settings.d.ts +209 -11
- package/src/rich-text-editor/models/toolbar-settings.js +23 -6
- package/src/rich-text-editor/renderer/audio-module.js +3 -3
- package/src/rich-text-editor/renderer/iframe-content-renderer.js +1 -1
- package/src/rich-text-editor/renderer/image-module.js +11 -6
- package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +2 -0
- package/src/rich-text-editor/renderer/toolbar-renderer.js +7 -2
- package/src/rich-text-editor/renderer/video-module.js +14 -9
- package/styles/bootstrap-dark.css +299 -137
- package/styles/bootstrap.css +305 -140
- package/styles/bootstrap4.css +304 -133
- package/styles/bootstrap5-dark.css +310 -165
- package/styles/bootstrap5.css +310 -165
- package/styles/fabric-dark.css +297 -136
- package/styles/fabric.css +294 -133
- package/styles/fluent-dark.css +311 -170
- package/styles/fluent.css +311 -170
- package/styles/highcontrast-light.css +289 -128
- package/styles/highcontrast.css +296 -135
- package/styles/material-dark.css +295 -129
- package/styles/material.css +300 -134
- package/styles/material3-dark.css +3082 -0
- package/styles/material3-dark.scss +3 -0
- package/styles/material3.css +3138 -0
- package/styles/material3.scss +3 -0
- package/styles/rich-text-editor/_bootstrap-dark-definition.scss +54 -12
- package/styles/rich-text-editor/_bootstrap-definition.scss +57 -13
- package/styles/rich-text-editor/_bootstrap4-definition.scss +50 -7
- package/styles/rich-text-editor/_bootstrap5-definition.scss +56 -13
- package/styles/rich-text-editor/_fabric-dark-definition.scss +53 -10
- package/styles/rich-text-editor/_fabric-definition.scss +52 -9
- package/styles/rich-text-editor/_fluent-definition.scss +56 -15
- package/styles/rich-text-editor/_fusionnew-definition.scss +46 -4
- package/styles/rich-text-editor/_highcontrast-definition.scss +52 -9
- package/styles/rich-text-editor/_highcontrast-light-definition.scss +48 -5
- package/styles/rich-text-editor/_layout.scss +280 -68
- package/styles/rich-text-editor/_material-dark-definition.scss +48 -5
- package/styles/rich-text-editor/_material-definition.scss +50 -6
- package/styles/rich-text-editor/_material3-dark-definition.scss +1 -0
- package/styles/rich-text-editor/_material3-definition.scss +262 -0
- package/styles/rich-text-editor/_tailwind-definition.scss +63 -23
- package/styles/rich-text-editor/_theme.scss +103 -19
- package/styles/rich-text-editor/bootstrap-dark.css +299 -137
- package/styles/rich-text-editor/bootstrap.css +305 -140
- package/styles/rich-text-editor/bootstrap4.css +304 -133
- package/styles/rich-text-editor/bootstrap5-dark.css +310 -165
- package/styles/rich-text-editor/bootstrap5.css +310 -165
- package/styles/rich-text-editor/fabric-dark.css +297 -136
- package/styles/rich-text-editor/fabric.css +294 -133
- package/styles/rich-text-editor/fluent-dark.css +311 -170
- package/styles/rich-text-editor/fluent.css +311 -170
- package/styles/rich-text-editor/highcontrast-light.css +289 -128
- package/styles/rich-text-editor/highcontrast.css +296 -135
- package/styles/rich-text-editor/icons/_bootstrap-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap4.scss +1 -1
- package/styles/rich-text-editor/icons/_bootstrap5.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_fabric.scss +1 -1
- package/styles/rich-text-editor/icons/_fluent.scss +1 -1
- package/styles/rich-text-editor/icons/_fusionnew.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast-light.scss +1 -1
- package/styles/rich-text-editor/icons/_highcontrast.scss +1 -1
- package/styles/rich-text-editor/icons/_material-dark.scss +1 -1
- package/styles/rich-text-editor/icons/_material.scss +1 -1
- package/styles/rich-text-editor/icons/_material3-dark.scss +1 -0
- package/styles/rich-text-editor/icons/_material3.scss +1 -1
- package/styles/rich-text-editor/icons/_tailwind.scss +1 -1
- package/styles/rich-text-editor/material-dark.css +295 -129
- package/styles/rich-text-editor/material.css +300 -134
- package/styles/rich-text-editor/material3-dark.css +3082 -0
- package/styles/rich-text-editor/material3-dark.scss +5 -0
- package/styles/rich-text-editor/material3.css +3138 -0
- package/styles/rich-text-editor/material3.scss +5 -0
- package/styles/rich-text-editor/tailwind-dark.css +313 -157
- package/styles/rich-text-editor/tailwind.css +313 -157
- package/styles/tailwind-dark.css +313 -157
- package/styles/tailwind.css +313 -157
|
@@ -729,6 +729,16 @@ const formatPainterClick = 'formatPainterClick';
|
|
|
729
729
|
* @deprecated
|
|
730
730
|
*/
|
|
731
731
|
const formatPainterDoubleClick = 'formatPainterDoubleClick';
|
|
732
|
+
/**
|
|
733
|
+
* @hidden
|
|
734
|
+
* @deprecated
|
|
735
|
+
*/
|
|
736
|
+
const emojiPicker = 'emojiPicker';
|
|
737
|
+
/**
|
|
738
|
+
* @hidden
|
|
739
|
+
* @deprecated
|
|
740
|
+
*/
|
|
741
|
+
const maximizeMinimizeClick = 'maximizeMinimizeClick';
|
|
732
742
|
/**
|
|
733
743
|
* @hidden
|
|
734
744
|
* @deprecated
|
|
@@ -1970,6 +1980,13 @@ let tools = {
|
|
|
1970
1980
|
'tooltip': 'Format Painter',
|
|
1971
1981
|
'command': 'FormatPainter',
|
|
1972
1982
|
'subCommand': 'FormatPainter'
|
|
1983
|
+
},
|
|
1984
|
+
'emojipicker': {
|
|
1985
|
+
'id': 'EmojiPicker',
|
|
1986
|
+
'icon': 'e-emoji',
|
|
1987
|
+
'tooltip': 'Emoji Icon',
|
|
1988
|
+
'command': 'EmojiPicker',
|
|
1989
|
+
'subCommand': 'EmojiPicker'
|
|
1973
1990
|
}
|
|
1974
1991
|
};
|
|
1975
1992
|
let alignmentLocale = [
|
|
@@ -2182,8 +2199,188 @@ let windowKeys = {
|
|
|
2182
2199
|
'Clear Format': 'Ctrl + Shift + R',
|
|
2183
2200
|
'Numbered List': 'Ctrl + Shift + O',
|
|
2184
2201
|
'Bulleted List': 'Ctrl + Alt + O',
|
|
2185
|
-
'Format Painter': '
|
|
2202
|
+
'Format Painter': 'Alt + Shift + C, Alt + Shift + V'
|
|
2186
2203
|
};
|
|
2204
|
+
const defaultEmojiIcons = [{
|
|
2205
|
+
name: 'Smilies & People', code: '1F600', iconCss: 'e-emoji', icons: [{ code: '1F600', desc: 'Grinning face' },
|
|
2206
|
+
{ code: '1F603', desc: 'Grinning face with big eyes' },
|
|
2207
|
+
{ code: '1F604', desc: 'Grinning face with smiling eyes' },
|
|
2208
|
+
{ code: '1F606', desc: 'Grinning squinting face' },
|
|
2209
|
+
{ code: '1F605', desc: 'Grinning face with sweat' },
|
|
2210
|
+
{ code: '1F602', desc: 'Face with tears of joy' },
|
|
2211
|
+
{ code: '1F923', desc: 'Rolling on the floor laughing' },
|
|
2212
|
+
{ code: '1F60A', desc: 'Smiling face with smiling eyes' },
|
|
2213
|
+
{ code: '1F607', desc: 'Smiling face with halo' },
|
|
2214
|
+
{ code: '1F642', desc: 'Slightly smiling face' },
|
|
2215
|
+
{ code: '1F643', desc: 'Upside-down face' },
|
|
2216
|
+
{ code: '1F60D', desc: 'Smiling face with heart-eyes' },
|
|
2217
|
+
{ code: '1F618', desc: 'Face blowing a kiss' },
|
|
2218
|
+
{ code: '1F61B', desc: 'Face with tongue' },
|
|
2219
|
+
{ code: '1F61C', desc: 'Winking face with tongue' },
|
|
2220
|
+
{ code: '1F604', desc: 'Grinning face with smiling eyes' },
|
|
2221
|
+
{ code: '1F469', desc: 'Woman' },
|
|
2222
|
+
{ code: '1F468', desc: 'Man' },
|
|
2223
|
+
{ code: '1F467', desc: 'Girl' },
|
|
2224
|
+
{ code: '1F466', desc: 'Boy' },
|
|
2225
|
+
{ code: '1F476', desc: 'Baby' },
|
|
2226
|
+
{ code: '1F475', desc: 'Old woman' },
|
|
2227
|
+
{ code: '1F474', desc: 'Old man' },
|
|
2228
|
+
{ code: '1F46E', desc: 'Police officer' },
|
|
2229
|
+
{ code: '1F477', desc: 'Construction worker' },
|
|
2230
|
+
{ code: '1F482', desc: 'Guard' },
|
|
2231
|
+
{ code: '1F575', desc: 'Detective' },
|
|
2232
|
+
{ code: '1F9D1', desc: 'Cook' }]
|
|
2233
|
+
}, {
|
|
2234
|
+
name: 'Animals & Nature', code: '1F435', iconCss: 'e-animals', icons: [{ code: '1F436', desc: 'Dog face' },
|
|
2235
|
+
{ code: '1F431', desc: 'Cat face' },
|
|
2236
|
+
{ code: '1F42D', desc: 'Mouse face' },
|
|
2237
|
+
{ code: '1F439', desc: 'Hamster face' },
|
|
2238
|
+
{ code: '1F430', desc: 'Rabbit face' },
|
|
2239
|
+
{ code: '1F98A', desc: 'Fox face' },
|
|
2240
|
+
{ code: '1F43B', desc: 'Bear face' },
|
|
2241
|
+
{ code: '1F43C', desc: 'Panda face' },
|
|
2242
|
+
{ code: '1F428', desc: 'Koala' },
|
|
2243
|
+
{ code: '1F42F', desc: 'Tiger face' },
|
|
2244
|
+
{ code: '1F981', desc: 'Lion face' },
|
|
2245
|
+
{ code: '1F42E', desc: 'Cow face' },
|
|
2246
|
+
{ code: '1F437', desc: 'Pig face' },
|
|
2247
|
+
{ code: '1F43D', desc: 'Pig nose' },
|
|
2248
|
+
{ code: '1F438', desc: 'Frog face' },
|
|
2249
|
+
{ code: '1F435', desc: 'Monkey face' },
|
|
2250
|
+
{ code: '1F649', desc: 'Hear-no-evil monkey' },
|
|
2251
|
+
{ code: '1F64A', desc: 'Speak-no-evil monkey' },
|
|
2252
|
+
{ code: '1F412', desc: 'Monkey' },
|
|
2253
|
+
{ code: '1F414', desc: 'Chicken' },
|
|
2254
|
+
{ code: '1F427', desc: 'Penguin' },
|
|
2255
|
+
{ code: '1F426', desc: 'Bird' },
|
|
2256
|
+
{ code: '1F424', desc: 'Baby chick' },
|
|
2257
|
+
{ code: '1F986', desc: 'Duck' },
|
|
2258
|
+
{ code: '1F985', desc: 'Eagle' }]
|
|
2259
|
+
}, {
|
|
2260
|
+
name: 'Food & Drink', code: '1F347', iconCss: 'e-food-and-drinks', icons: [{ code: '1F34E', desc: 'Red apple' },
|
|
2261
|
+
{ code: '1F34C', desc: 'Banana' },
|
|
2262
|
+
{ code: '1F347', desc: 'Grapes' },
|
|
2263
|
+
{ code: '1F353', desc: 'Strawberry' },
|
|
2264
|
+
{ code: '1F35E', desc: 'Bread' },
|
|
2265
|
+
{ code: '1F950', desc: 'Croissant' },
|
|
2266
|
+
{ code: '1F955', desc: 'Carrot' },
|
|
2267
|
+
{ code: '1F354', desc: 'Hamburger' },
|
|
2268
|
+
{ code: '1F355', desc: 'Pizza' },
|
|
2269
|
+
{ code: '1F32D', desc: 'Hot dog' },
|
|
2270
|
+
{ code: '1F35F', desc: 'French fries' },
|
|
2271
|
+
{ code: '1F37F', desc: 'Popcorn' },
|
|
2272
|
+
{ code: '1F366', desc: 'Soft ice cream' },
|
|
2273
|
+
{ code: '1F367', desc: 'Shaved ice' },
|
|
2274
|
+
{ code: '1F36A', desc: 'Cookie' },
|
|
2275
|
+
{ code: '1F382', desc: 'Birthday cake' },
|
|
2276
|
+
{ code: '1F370', desc: 'Shortcake' },
|
|
2277
|
+
{ code: '1F36B', desc: 'Chocolate bar' },
|
|
2278
|
+
{ code: '1F369', desc: 'Donut' },
|
|
2279
|
+
{ code: '1F36E', desc: 'Custard' },
|
|
2280
|
+
{ code: '1F36D', desc: 'Lollipop' },
|
|
2281
|
+
{ code: '1F36C', desc: 'Candy' },
|
|
2282
|
+
{ code: '1F377', desc: 'Wine glass' },
|
|
2283
|
+
{ code: '1F37A', desc: 'Beer mug' },
|
|
2284
|
+
{ code: '1F37E', desc: 'Bottle with popping cork' }]
|
|
2285
|
+
}, {
|
|
2286
|
+
name: 'Activities', code: '1F383', iconCss: 'e-activities', icons: [{ code: '26BD', desc: 'Soccer ball' },
|
|
2287
|
+
{ code: '1F3C0', desc: 'Basketball' },
|
|
2288
|
+
{ code: '1F3C8', desc: 'American football' },
|
|
2289
|
+
{ code: '26BE', desc: 'Baseball' },
|
|
2290
|
+
{ code: '1F3BE', desc: 'Tennis' },
|
|
2291
|
+
{ code: '1F3D0', desc: 'Volleyball' },
|
|
2292
|
+
{ code: '1F3C9', desc: 'Rugby football' },
|
|
2293
|
+
{ code: '1F3B1', desc: 'Pool 8 ball' },
|
|
2294
|
+
{ code: '1F3D3', desc: 'Ping pong' },
|
|
2295
|
+
{ code: '1F3F8', desc: 'Badminton' },
|
|
2296
|
+
{ code: '1F94A', desc: 'Boxing glove' },
|
|
2297
|
+
{ code: '1F3CA', desc: 'Swimmer' },
|
|
2298
|
+
{ code: '1F3CB', desc: 'Weightlifter' },
|
|
2299
|
+
{ code: '1F6B4', desc: 'Bicyclist' },
|
|
2300
|
+
{ code: '1F6F9', desc: 'Skateboard' },
|
|
2301
|
+
{ code: '1F3AE', desc: 'Video game' },
|
|
2302
|
+
{ code: '1F579', desc: 'Joystick' },
|
|
2303
|
+
{ code: '1F3CF', desc: 'Cricket' },
|
|
2304
|
+
{ code: '1F3C7', desc: 'Horse racing' },
|
|
2305
|
+
{ code: '1F3AF', desc: 'Direct hit' },
|
|
2306
|
+
{ code: '1F3D1', desc: 'Field hockey' },
|
|
2307
|
+
{ code: '1F3B0', desc: 'Slot machine' },
|
|
2308
|
+
{ code: '1F3B3', desc: 'Bowling' },
|
|
2309
|
+
{ code: '1F3B2', desc: 'Game die' },
|
|
2310
|
+
{ code: '265F', desc: 'Chess pawn' }]
|
|
2311
|
+
}, {
|
|
2312
|
+
name: 'Travel & Places', code: '1F30D', iconCss: 'e-travel-and-places', icons: [{ code: '2708', desc: 'Airplane' },
|
|
2313
|
+
{ code: '1F697', desc: 'Automobile' },
|
|
2314
|
+
{ code: '1F695', desc: 'Taxi' },
|
|
2315
|
+
{ code: '1F6B2', desc: 'Bicycle' },
|
|
2316
|
+
{ code: '1F68C', desc: 'Bus' },
|
|
2317
|
+
{ code: '1F682', desc: 'Locomotive' },
|
|
2318
|
+
{ code: '1F6F3', desc: 'Passenger ship' },
|
|
2319
|
+
{ code: '1F680', desc: 'Rocket' },
|
|
2320
|
+
{ code: '1F681', desc: 'Helicopter' },
|
|
2321
|
+
{ code: '1F6A2', desc: 'Ship' },
|
|
2322
|
+
{ code: '1F3DF', desc: 'Stadium' },
|
|
2323
|
+
{ code: '1F54C', desc: 'Mosque' },
|
|
2324
|
+
{ code: '26EA', desc: 'Church' },
|
|
2325
|
+
{ code: '1F6D5', desc: 'Hindu Temple' },
|
|
2326
|
+
{ code: '1F3D4', desc: 'Snow-capped mountain' },
|
|
2327
|
+
{ code: '1F3EB', desc: 'School' },
|
|
2328
|
+
{ code: '1F30B', desc: 'Volcano' },
|
|
2329
|
+
{ code: '1F3D6', desc: 'Beach with umbrella' },
|
|
2330
|
+
{ code: '1F3DD', desc: 'Desert island' },
|
|
2331
|
+
{ code: '1F3DE', desc: 'National park' },
|
|
2332
|
+
{ code: '1F3F0', desc: 'Castle' },
|
|
2333
|
+
{ code: '1F5FC', desc: 'Tokyo tower' },
|
|
2334
|
+
{ code: '1F5FD', desc: 'Statue of liberty' },
|
|
2335
|
+
{ code: '26E9', desc: 'Shinto shrine' },
|
|
2336
|
+
{ code: '1F3EF', desc: 'Japanese castle' },
|
|
2337
|
+
{ code: '1F3A2', desc: 'Roller coaster' }]
|
|
2338
|
+
}, {
|
|
2339
|
+
name: 'Objects', code: '1F507', iconCss: 'e-objects', icons: [{ code: '1F4A1', desc: 'Light bulb' },
|
|
2340
|
+
{ code: '1F526', desc: 'Flashlight' },
|
|
2341
|
+
{ code: '1F4BB', desc: 'Laptop computer' },
|
|
2342
|
+
{ code: '1F5A5', desc: 'Desktop computer' },
|
|
2343
|
+
{ code: '1F5A8', desc: 'Printer' },
|
|
2344
|
+
{ code: '1F4F7', desc: 'Camera' },
|
|
2345
|
+
{ code: '1F4F8', desc: 'Camera with flash' },
|
|
2346
|
+
{ code: '1F4FD', desc: 'Film projector' },
|
|
2347
|
+
{ code: '1F3A5', desc: 'Movie camera' },
|
|
2348
|
+
{ code: '1F4FA', desc: 'Television' },
|
|
2349
|
+
{ code: '1F4FB', desc: 'Radio' },
|
|
2350
|
+
{ code: '1F50B', desc: 'Battery' },
|
|
2351
|
+
{ code: '231A', desc: 'Watch' },
|
|
2352
|
+
{ code: '1F4F1', desc: 'Mobile phone' },
|
|
2353
|
+
{ code: '260E', desc: 'Telephone' },
|
|
2354
|
+
{ code: '1F4BE', desc: 'Floppy disk' },
|
|
2355
|
+
{ code: '1F4BF', desc: 'Optical disk' },
|
|
2356
|
+
{ code: '1F4C0', desc: 'Digital versatile disc' },
|
|
2357
|
+
{ code: '1F4BD', desc: 'Computer disk' },
|
|
2358
|
+
{ code: '1F3A7', desc: 'Headphone' },
|
|
2359
|
+
{ code: '1F3A4', desc: 'Microphone' },
|
|
2360
|
+
{ code: '1F3B6', desc: 'Multiple musical notes' },
|
|
2361
|
+
{ code: '1F4DA', desc: 'Books' }]
|
|
2362
|
+
}, {
|
|
2363
|
+
name: 'Symbols', code: '1F3E7', iconCss: 'e-symbols', icons: [{ code: '274C', desc: 'Cross mark' },
|
|
2364
|
+
{ code: '2714', desc: 'Check mark' },
|
|
2365
|
+
{ code: '26A0', desc: 'Warning sign' },
|
|
2366
|
+
{ code: '1F6AB', desc: 'Prohibited' },
|
|
2367
|
+
{ code: '2139', desc: 'Information' },
|
|
2368
|
+
{ code: '267B', desc: 'Recycling symbol' },
|
|
2369
|
+
{ code: '1F6AD', desc: 'No smoking' },
|
|
2370
|
+
{ code: '1F4F5', desc: 'No mobile phones' },
|
|
2371
|
+
{ code: '1F6AF', desc: 'No littering' },
|
|
2372
|
+
{ code: '1F6B3', desc: 'No bicycles' },
|
|
2373
|
+
{ code: '1F6B7', desc: 'No pedestrians' },
|
|
2374
|
+
{ code: '2795', desc: 'Plus' },
|
|
2375
|
+
{ code: '2796', desc: 'Minus' },
|
|
2376
|
+
{ code: '2797', desc: 'Divide' },
|
|
2377
|
+
{ code: '2716', desc: 'Multiplication' },
|
|
2378
|
+
{ code: '1F4B2', desc: 'Dollar banknote' },
|
|
2379
|
+
{ code: '1F4AC', desc: 'Speech balloon' },
|
|
2380
|
+
{ code: '2755', desc: 'White exclamation mark' },
|
|
2381
|
+
{ code: '2754', desc: 'White question mark' },
|
|
2382
|
+
{ code: '2764', desc: 'Red heart' }]
|
|
2383
|
+
}];
|
|
2187
2384
|
|
|
2188
2385
|
/* eslint-disable */
|
|
2189
2386
|
/**
|
|
@@ -2378,7 +2575,13 @@ let defaultLocale = {
|
|
|
2378
2575
|
'bulletFormatListSquare': 'Square',
|
|
2379
2576
|
'numberFormatListNone': 'None',
|
|
2380
2577
|
'bulletFormatListNone': 'None',
|
|
2381
|
-
'formatPainter': 'Format Painter'
|
|
2578
|
+
'formatPainter': 'Format Painter',
|
|
2579
|
+
'emojiPicker': 'Emoji Picker',
|
|
2580
|
+
'embeddedCode': 'Embedded Code',
|
|
2581
|
+
'pasteEmbeddedCodeHere': 'Paste Embedded Code here',
|
|
2582
|
+
'emojiPickerTypeToFind': 'Type to find',
|
|
2583
|
+
'emojiPickerNoResultFound': 'No results found',
|
|
2584
|
+
'emojiPickerTrySomethingElse': 'Try something else',
|
|
2382
2585
|
};
|
|
2383
2586
|
let toolsLocale = {
|
|
2384
2587
|
'alignments': 'alignments',
|
|
@@ -2466,7 +2669,13 @@ let toolsLocale = {
|
|
|
2466
2669
|
'insertrowbefore': 'insertRowBefore',
|
|
2467
2670
|
'insertrowafter': 'insertRowAfter',
|
|
2468
2671
|
'deleterow': 'deleteRow',
|
|
2469
|
-
'formatpainter': 'formatPainter'
|
|
2672
|
+
'formatpainter': 'formatPainter',
|
|
2673
|
+
'emojipicker': 'emojiPicker',
|
|
2674
|
+
'embeddedCode': 'Embedded Code',
|
|
2675
|
+
'pasteEmbeddedCodeHere': 'Paste Embedded Code here',
|
|
2676
|
+
'emojiPickerTypeToFind': 'Type to find',
|
|
2677
|
+
'emojiPickerNoResultFound': 'No results found',
|
|
2678
|
+
'emojiPickerTrySomethingElse': 'Try something else',
|
|
2470
2679
|
};
|
|
2471
2680
|
let fontNameLocale = [
|
|
2472
2681
|
{ locale: 'fontNameSegoeUI', value: 'Segoe UI' },
|
|
@@ -2649,7 +2858,8 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
2649
2858
|
const item = e.tbItems[j].subCommand;
|
|
2650
2859
|
const itemStr = item && item.toLocaleLowerCase();
|
|
2651
2860
|
if (item && (itemStr === key) || (item === 'UL' && key === 'unorderedlist') || (item === 'OL' && key === 'orderedlist') ||
|
|
2652
|
-
(itemStr === 'pre' && key === 'insertcode')
|
|
2861
|
+
(itemStr === 'pre' && key === 'insertcode') || (item === 'NumberFormatList' && key === 'numberFormatList' ||
|
|
2862
|
+
item === 'BulletFormatList' && key === 'bulletFormatList')) {
|
|
2653
2863
|
if (typeof data[`${key}`] === 'boolean') {
|
|
2654
2864
|
if (data[`${key}`] === true) {
|
|
2655
2865
|
addClass([e.tbElements[j]], [CLS_ACTIVE]);
|
|
@@ -2701,7 +2911,6 @@ function setToolbarStatus(e, isPopToolbar, self) {
|
|
|
2701
2911
|
const fontNameContent = isNullOrUndefined(e.parent.fontFamily.default) ? fontNameItems[0].text :
|
|
2702
2912
|
e.parent.fontFamily.default;
|
|
2703
2913
|
const name = (isNullOrUndefined(result) ? fontNameContent : result);
|
|
2704
|
-
e.tbElements[j].title = name;
|
|
2705
2914
|
dropDown.fontNameDropDown.content = ('<span style="display: inline-flex;' +
|
|
2706
2915
|
'width:' + e.parent.fontFamily.width + '" >' +
|
|
2707
2916
|
'<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
|
|
@@ -3096,6 +3305,10 @@ class ToolbarRenderer {
|
|
|
3096
3305
|
}
|
|
3097
3306
|
wireEvent() {
|
|
3098
3307
|
this.parent.on(destroy, this.unWireEvent, this);
|
|
3308
|
+
this.parent.on(maximizeMinimizeClick, this.destroyTooltip, this);
|
|
3309
|
+
}
|
|
3310
|
+
destroyTooltip() {
|
|
3311
|
+
this.tooltip.close();
|
|
3099
3312
|
}
|
|
3100
3313
|
unWireEvent() {
|
|
3101
3314
|
this.parent.off(destroy, this.unWireEvent);
|
|
@@ -3192,12 +3405,13 @@ class ToolbarRenderer {
|
|
|
3192
3405
|
args.rteToolbarObj.toolbarObj.createElement = this.parent.createElement;
|
|
3193
3406
|
args.rteToolbarObj.toolbarObj.appendTo(args.target);
|
|
3194
3407
|
if (this.parent.showTooltip) {
|
|
3195
|
-
|
|
3408
|
+
this.tooltip = new Tooltip({
|
|
3196
3409
|
target: '#' + this.parent.getID() + '_toolbar_wrapper [title]',
|
|
3197
3410
|
showTipPointer: true,
|
|
3411
|
+
openDelay: 400,
|
|
3198
3412
|
cssClass: this.parent.cssClass
|
|
3199
3413
|
});
|
|
3200
|
-
tooltip.appendTo(args.target);
|
|
3414
|
+
this.tooltip.appendTo(args.target);
|
|
3201
3415
|
}
|
|
3202
3416
|
}
|
|
3203
3417
|
/**
|
|
@@ -3796,8 +4010,9 @@ class BaseToolbar {
|
|
|
3796
4010
|
this.parent.formatter.saveData();
|
|
3797
4011
|
}
|
|
3798
4012
|
callback.call(this);
|
|
3799
|
-
|
|
3800
|
-
|
|
4013
|
+
const currentContentElem = this.parent.createElement('div');
|
|
4014
|
+
currentContentElem.appendChild(this.parent.formatter.getUndoRedoStack()[this.parent.formatter.getUndoRedoStack().length - 1].text);
|
|
4015
|
+
if (currentContentElem.innerHTML.trim() === this.parent.inputElement.innerHTML.trim()) {
|
|
3801
4016
|
return;
|
|
3802
4017
|
}
|
|
3803
4018
|
if (proxy.undo) {
|
|
@@ -5849,7 +6064,8 @@ class BaseQuickToolbar {
|
|
|
5849
6064
|
* @deprecated
|
|
5850
6065
|
*/
|
|
5851
6066
|
showPopup(x, y, target) {
|
|
5852
|
-
const eventArgs = { popup: this.popupObj, cancel: false, targetElement: target,
|
|
6067
|
+
const eventArgs = { popup: this.popupObj, cancel: false, targetElement: target,
|
|
6068
|
+
positionX: x, positionY: y };
|
|
5853
6069
|
this.parent.trigger(beforeQuickToolbarOpen, eventArgs, (beforeQuickToolbarArgs) => {
|
|
5854
6070
|
if (!beforeQuickToolbarArgs.cancel) {
|
|
5855
6071
|
let editPanelTop;
|
|
@@ -5885,6 +6101,7 @@ class BaseQuickToolbar {
|
|
|
5885
6101
|
if (this.parent.showTooltip) {
|
|
5886
6102
|
this.tooltip = new Tooltip({
|
|
5887
6103
|
target: '#' + this.element.id + ' [title]',
|
|
6104
|
+
openDelay: 400,
|
|
5888
6105
|
showTipPointer: true
|
|
5889
6106
|
});
|
|
5890
6107
|
this.tooltip.appendTo(this.element);
|
|
@@ -5965,6 +6182,11 @@ class BaseQuickToolbar {
|
|
|
5965
6182
|
}
|
|
5966
6183
|
this.tooltip.destroy();
|
|
5967
6184
|
}
|
|
6185
|
+
else {
|
|
6186
|
+
if (!isNullOrUndefined(this.tooltip)) {
|
|
6187
|
+
this.tooltip.destroy();
|
|
6188
|
+
}
|
|
6189
|
+
}
|
|
5968
6190
|
if (!isNullOrUndefined(this.parent.getToolbar()) && !this.parent.inlineMode.enable) {
|
|
5969
6191
|
if (isNullOrUndefined(viewSourcePanel) || viewSourcePanel.style.display === 'none') {
|
|
5970
6192
|
this.parent.enableToolbarItem(this.parent.toolbarSettings.items);
|
|
@@ -7179,6 +7401,8 @@ function getDefaultHtmlTbStatus() {
|
|
|
7179
7401
|
strikethrough: false,
|
|
7180
7402
|
orderedlist: false,
|
|
7181
7403
|
unorderedlist: false,
|
|
7404
|
+
numberFormatList: false,
|
|
7405
|
+
bulletFormatList: false,
|
|
7182
7406
|
underline: false,
|
|
7183
7407
|
alignments: null,
|
|
7184
7408
|
backgroundcolor: null,
|
|
@@ -7345,7 +7569,8 @@ class ExecCommandCallBack {
|
|
|
7345
7569
|
this.parent.on(destroy, this.removeEventListener, this);
|
|
7346
7570
|
}
|
|
7347
7571
|
commandCallBack(args) {
|
|
7348
|
-
|
|
7572
|
+
const formatPainterCopy = !isNullOrUndefined(args.requestType) && args.requestType === 'FormatPainter' && args.action === 'format-copy';
|
|
7573
|
+
if (!isNullOrUndefined(args) && !isNullOrUndefined(args.requestType) && args.requestType !== 'Undo' && args.requestType !== 'Redo' && !formatPainterCopy) {
|
|
7349
7574
|
this.parent.formatter.saveData();
|
|
7350
7575
|
}
|
|
7351
7576
|
this.parent.notify(toolbarRefresh, { args: args });
|
|
@@ -7444,6 +7669,12 @@ const SPACE_ACTION = 'actionBegin';
|
|
|
7444
7669
|
* @hidden
|
|
7445
7670
|
*/
|
|
7446
7671
|
const FORMAT_PAINTER_ACTIONS = 'format_painter_actions';
|
|
7672
|
+
/**
|
|
7673
|
+
* Emoji picker event constant
|
|
7674
|
+
*
|
|
7675
|
+
* @hidden
|
|
7676
|
+
*/
|
|
7677
|
+
const EMOJI_PICKER_ACTIONS = 'emoji_picker_actions';
|
|
7447
7678
|
|
|
7448
7679
|
/**
|
|
7449
7680
|
* Formatter
|
|
@@ -7485,6 +7716,7 @@ class Formatter {
|
|
|
7485
7716
|
&& args.item.command !== 'Files'
|
|
7486
7717
|
&& args.item.command !== 'Audios'
|
|
7487
7718
|
&& args.item.command !== 'Videos'
|
|
7719
|
+
&& args.item.command !== 'EmojiPicker'
|
|
7488
7720
|
&& range
|
|
7489
7721
|
&& !(self.contentModule.getEditPanel().contains(this.getAncestorNode(range.commonAncestorContainer))
|
|
7490
7722
|
|| self.contentModule.getEditPanel() === range.commonAncestorContainer
|
|
@@ -7550,13 +7782,14 @@ class Formatter {
|
|
|
7550
7782
|
&& args.item.command !== 'Font')
|
|
7551
7783
|
|| ((args.item.subCommand === 'FontName' || args.item.subCommand === 'FontSize') && args.name === 'dropDownSelect')
|
|
7552
7784
|
|| ((args.item.subCommand === 'BackgroundColor' || args.item.subCommand === 'FontColor')
|
|
7553
|
-
&& args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter')) {
|
|
7785
|
+
&& args.name === 'colorPickerChanged') || args.item.subCommand === 'FormatPainter' || args.item.subCommand === 'EmojiPicker')) {
|
|
7554
7786
|
extend(args, args, { requestType: args.item.subCommand, cancel: false, itemCollection: value, selectType: args.name }, true);
|
|
7555
7787
|
self.trigger(actionBegin, args, (actionBeginArgs) => {
|
|
7556
7788
|
if (!actionBeginArgs.cancel) {
|
|
7557
|
-
const
|
|
7558
|
-
|
|
7559
|
-
|
|
7789
|
+
const formatPainterCopy = !isNullOrUndefined(actionBeginArgs.requestType) && actionBeginArgs.requestType === 'FormatPainter' && actionBeginArgs.name === 'format-copy';
|
|
7790
|
+
const formatPainterPaste = !isNullOrUndefined(actionBeginArgs.requestType) && actionBeginArgs.requestType === 'FormatPainter' && actionBeginArgs.name === 'format-paste';
|
|
7791
|
+
if ((this.getUndoRedoStack().length === 0 && actionBeginArgs.item.command !== 'Links' && actionBeginArgs.item.command !== 'Images' && !formatPainterCopy)
|
|
7792
|
+
|| formatPainterPaste) {
|
|
7560
7793
|
this.saveData();
|
|
7561
7794
|
}
|
|
7562
7795
|
self.isBlur = false;
|
|
@@ -7578,7 +7811,7 @@ class Formatter {
|
|
|
7578
7811
|
}
|
|
7579
7812
|
});
|
|
7580
7813
|
}
|
|
7581
|
-
if (isNullOrUndefined(event) || event && event.action !== 'copy') {
|
|
7814
|
+
if ((isNullOrUndefined(event) || event && event.action !== 'copy')) {
|
|
7582
7815
|
this.enableUndo(self);
|
|
7583
7816
|
}
|
|
7584
7817
|
}
|
|
@@ -8834,8 +9067,8 @@ const htmlKeyConfig = {
|
|
|
8834
9067
|
'enter': '13',
|
|
8835
9068
|
'tab': 'tab',
|
|
8836
9069
|
'delete': '46',
|
|
8837
|
-
'format-copy': '
|
|
8838
|
-
'format-paste': '
|
|
9070
|
+
'format-copy': 'alt+shift+c',
|
|
9071
|
+
'format-paste': 'alt+shift+v'
|
|
8839
9072
|
};
|
|
8840
9073
|
/**
|
|
8841
9074
|
* Default markdown key config for adapter
|
|
@@ -10913,7 +11146,11 @@ class DOMNode {
|
|
|
10913
11146
|
let startTextNode;
|
|
10914
11147
|
let endTextNode;
|
|
10915
11148
|
if (start.textContent === '' && isNullOrUndefined(end) && action !== 'tab') {
|
|
10916
|
-
if (
|
|
11149
|
+
if (isNullOrUndefined(action) && save.range.startContainer.nodeType === 1 &&
|
|
11150
|
+
save.range.startContainer.querySelectorAll('audio,video,image').length === 0) {
|
|
11151
|
+
start.innerHTML = '<br>';
|
|
11152
|
+
}
|
|
11153
|
+
else if (start.childNodes.length === 1 && start.childNodes[0].nodeName === 'BR') {
|
|
10917
11154
|
start.innerHTML = '<br>';
|
|
10918
11155
|
}
|
|
10919
11156
|
else {
|
|
@@ -11002,7 +11239,7 @@ class DOMNode {
|
|
|
11002
11239
|
markerStart.appendChild(start);
|
|
11003
11240
|
}
|
|
11004
11241
|
else {
|
|
11005
|
-
if (start.nodeType !== 3 && start.nodeName !== '#text') {
|
|
11242
|
+
if (start.nodeType !== 3 && start.nodeName !== '#text' && start.nodeName !== 'BR') {
|
|
11006
11243
|
const marker = this.marker(markerClassName.startSelection, '');
|
|
11007
11244
|
append([this.parseHTMLFragment(marker)], start);
|
|
11008
11245
|
}
|
|
@@ -13228,7 +13465,12 @@ class InsertHtml {
|
|
|
13228
13465
|
static removeEmptyElements(element) {
|
|
13229
13466
|
const emptyElements = element.querySelectorAll(':empty');
|
|
13230
13467
|
for (let i = 0; i < emptyElements.length; i++) {
|
|
13231
|
-
|
|
13468
|
+
let lineWithDiv = true;
|
|
13469
|
+
if (emptyElements[i].tagName === 'DIV') {
|
|
13470
|
+
lineWithDiv = emptyElements[i].style.borderBottom === 'none' ||
|
|
13471
|
+
emptyElements[i].style.borderBottom === '' ? true : false;
|
|
13472
|
+
}
|
|
13473
|
+
if (SELF_CLOSING_TAGS.indexOf(emptyElements[i].tagName.toLowerCase()) < 0 && lineWithDiv) {
|
|
13232
13474
|
const detachableElement = this.findDetachEmptyElem(emptyElements[i]);
|
|
13233
13475
|
if (!isNullOrUndefined(detachableElement)) {
|
|
13234
13476
|
detach(detachableElement);
|
|
@@ -13334,7 +13576,7 @@ class LinkCommand {
|
|
|
13334
13576
|
const domSelection = new NodeSelection();
|
|
13335
13577
|
let range = domSelection.getRange(this.parent.currentDocument);
|
|
13336
13578
|
if (range.endContainer.nodeName === '#text' && range.startContainer.textContent.length === (range.endOffset + 1) &&
|
|
13337
|
-
range.endContainer.textContent.charAt(range.endOffset) === ' ' && range.endContainer.nextSibling.nodeName === 'A') {
|
|
13579
|
+
range.endContainer.textContent.charAt(range.endOffset) === ' ' && (!isNullOrUndefined(range.endContainer.nextSibling) && range.endContainer.nextSibling.nodeName === 'A')) {
|
|
13338
13580
|
domSelection.setSelectionText(this.parent.currentDocument, range.startContainer, range.endContainer, range.startOffset, range.endOffset + 1);
|
|
13339
13581
|
range = domSelection.getRange(this.parent.currentDocument);
|
|
13340
13582
|
}
|
|
@@ -15050,10 +15292,10 @@ class TableCommand {
|
|
|
15050
15292
|
this.updateRowSpanStyle(minMaxIndexes.startRow, minMaxIndexes.endRow, this.getCorrespondingColumns());
|
|
15051
15293
|
this.updateColSpanStyle(minMaxIndexes.startColumn, minMaxIndexes.endColumn, this.getCorrespondingColumns());
|
|
15052
15294
|
e.item.selection.setSelectionText(this.parent.currentDocument, e.item.selection.range.startContainer, e.item.selection.range.startContainer, 0, 0);
|
|
15053
|
-
if (this.parent.nodeSelection
|
|
15295
|
+
if (this.parent.nodeSelection && firstCell) {
|
|
15054
15296
|
this.parent.nodeSelection.setCursorPoint(this.parent.currentDocument,
|
|
15055
15297
|
// eslint-disable-next-line
|
|
15056
|
-
|
|
15298
|
+
firstCell, 0);
|
|
15057
15299
|
}
|
|
15058
15300
|
if (e.callBack) {
|
|
15059
15301
|
e.callBack({
|
|
@@ -16180,8 +16422,10 @@ class SelectionCommands {
|
|
|
16180
16422
|
while (currentFormatNode) {
|
|
16181
16423
|
const isSameTextContent = currentFormatNode.parentElement.textContent.trim()
|
|
16182
16424
|
=== nodes[index].textContent.trim();
|
|
16183
|
-
|
|
16184
|
-
|
|
16425
|
+
const parent = currentFormatNode.parentElement;
|
|
16426
|
+
if (!domNode.isBlockNode(parent) && isSameTextContent &&
|
|
16427
|
+
!(parent.nodeName === 'SPAN' && parent.classList.contains('e-img-inner'))) {
|
|
16428
|
+
currentFormatNode = parent;
|
|
16185
16429
|
}
|
|
16186
16430
|
else {
|
|
16187
16431
|
break;
|
|
@@ -16362,33 +16606,19 @@ class SelectionCommands {
|
|
|
16362
16606
|
}
|
|
16363
16607
|
// Below function is used to insert the element created by the format painter plugin.
|
|
16364
16608
|
static insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode) {
|
|
16365
|
-
let parent = nodes[index].parentElement
|
|
16609
|
+
let parent = !domNode.isBlockNode(nodes[index].parentElement) ?
|
|
16610
|
+
nodes[index].parentElement : nodes[index];
|
|
16366
16611
|
if (!domNode.isBlockNode(parent)) {
|
|
16367
|
-
// The below code is used to remove the already present inline style from the text node.
|
|
16368
16612
|
while (parent.textContent.trim() === parent.parentElement.textContent.trim() && !domNode.isBlockNode(parent.parentElement)) {
|
|
16369
16613
|
parent = parent.parentElement;
|
|
16370
16614
|
}
|
|
16371
|
-
|
|
16372
|
-
|
|
16373
|
-
|
|
16374
|
-
|
|
16375
|
-
if (childELemList[i].textContent.trim() === nodes[i].textContent.trim()) {
|
|
16376
|
-
parent.parentNode.insertBefore(childELemList[i], parent);
|
|
16377
|
-
break;
|
|
16378
|
-
}
|
|
16379
|
-
}
|
|
16380
|
-
const blockChildNodes = parent.parentElement.childNodes;
|
|
16381
|
-
for (let k = 0; k < blockChildNodes.length; k++) {
|
|
16382
|
-
if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) {
|
|
16383
|
-
detach(blockChildNodes[k]);
|
|
16384
|
-
}
|
|
16385
|
-
}
|
|
16386
|
-
}
|
|
16387
|
-
else {
|
|
16388
|
-
InsertMethods.unwrap(parent);
|
|
16389
|
-
}
|
|
16615
|
+
}
|
|
16616
|
+
// The below code is used to remove the already present inline style from the text node.
|
|
16617
|
+
if (!isNullOrUndefined(parent) && parent.nodeType === 1 && !(parent.classList.contains('e-rte-img-caption') || parent.classList.contains('e-img-inner'))) {
|
|
16618
|
+
this.formatPainterCleanup(index, nodes, parent, range, nodeCutter, domNode);
|
|
16390
16619
|
}
|
|
16391
16620
|
const elem = painterValues.element;
|
|
16621
|
+
// The below code is used to apply the inline format copied.
|
|
16392
16622
|
if (!isNullOrUndefined(elem)) {
|
|
16393
16623
|
// Step 1: Cloning the element that is created by format painter.
|
|
16394
16624
|
// Step 2: Finding the last child of the nested elememt using the paintervalues.lastchild nodename
|
|
@@ -16413,6 +16643,43 @@ class SelectionCommands {
|
|
|
16413
16643
|
}
|
|
16414
16644
|
return nodes[index];
|
|
16415
16645
|
}
|
|
16646
|
+
static formatPainterCleanup(index, nodes, parent, range, nodeCutter, domNode) {
|
|
16647
|
+
const INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
16648
|
+
if (index === 0 && parent.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
16649
|
+
nodeCutter.SplitNode(range, parent, true);
|
|
16650
|
+
const childELemList = nodes[index].parentElement.childNodes;
|
|
16651
|
+
for (let i = 0; i < childELemList.length; i++) {
|
|
16652
|
+
if (childELemList[i].textContent.trim() === nodes[i].textContent.trim()) {
|
|
16653
|
+
parent.parentNode.insertBefore(childELemList[i], parent);
|
|
16654
|
+
break;
|
|
16655
|
+
}
|
|
16656
|
+
}
|
|
16657
|
+
const blockChildNodes = parent.parentElement.childNodes;
|
|
16658
|
+
for (let k = 0; k < blockChildNodes.length; k++) {
|
|
16659
|
+
if (blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) {
|
|
16660
|
+
detach(blockChildNodes[k]);
|
|
16661
|
+
}
|
|
16662
|
+
}
|
|
16663
|
+
}
|
|
16664
|
+
else if (parent.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
16665
|
+
parent.parentElement.insertBefore(nodes[index], parent);
|
|
16666
|
+
}
|
|
16667
|
+
else {
|
|
16668
|
+
while (!isNullOrUndefined(parent) && parent.nodeType !== 3 && !domNode.isBlockNode(parent)) {
|
|
16669
|
+
let temp;
|
|
16670
|
+
for (let i = 0; i < parent.childNodes.length; i++) {
|
|
16671
|
+
const currentChild = parent.childNodes[i];
|
|
16672
|
+
if (currentChild.textContent.trim().length !== 0 && currentChild.nodeType !== 3) {
|
|
16673
|
+
temp = parent.childNodes[i];
|
|
16674
|
+
}
|
|
16675
|
+
}
|
|
16676
|
+
if (INVALID_TAGS.indexOf(parent.tagName) === -1) {
|
|
16677
|
+
InsertMethods.unwrap(parent);
|
|
16678
|
+
}
|
|
16679
|
+
parent = temp;
|
|
16680
|
+
}
|
|
16681
|
+
}
|
|
16682
|
+
}
|
|
16416
16683
|
}
|
|
16417
16684
|
SelectionCommands.enterAction = 'P';
|
|
16418
16685
|
|
|
@@ -16524,6 +16791,7 @@ class ClearFormat$1 {
|
|
|
16524
16791
|
* @param {Node} endNode - specifies the end node
|
|
16525
16792
|
* @param {string} enterAction - specifies the enter key action
|
|
16526
16793
|
* @param {string} selector - specifies the string value
|
|
16794
|
+
* @param {string} command - specifies the command value
|
|
16527
16795
|
* @returns {void}
|
|
16528
16796
|
* @hidden
|
|
16529
16797
|
* @deprecated
|
|
@@ -16888,6 +17156,19 @@ class UndoRedoManager {
|
|
|
16888
17156
|
this.saveData(e);
|
|
16889
17157
|
}
|
|
16890
17158
|
}
|
|
17159
|
+
getTextContentFromFragment(fragment) {
|
|
17160
|
+
let textContent = '';
|
|
17161
|
+
for (let i = 0; i < fragment.childNodes.length; i++) {
|
|
17162
|
+
const childNode = fragment.childNodes[i];
|
|
17163
|
+
if (childNode.nodeType === Node.TEXT_NODE) {
|
|
17164
|
+
textContent += childNode.textContent;
|
|
17165
|
+
}
|
|
17166
|
+
else if (childNode.nodeType === Node.ELEMENT_NODE) {
|
|
17167
|
+
textContent += this.getTextContentFromFragment(childNode);
|
|
17168
|
+
}
|
|
17169
|
+
}
|
|
17170
|
+
return textContent;
|
|
17171
|
+
}
|
|
16891
17172
|
/**
|
|
16892
17173
|
* RTE collection stored html format.
|
|
16893
17174
|
*
|
|
@@ -16910,8 +17191,12 @@ class UndoRedoManager {
|
|
|
16910
17191
|
}
|
|
16911
17192
|
range = new NodeSelection().getRange(this.parent.currentDocument);
|
|
16912
17193
|
const save = new NodeSelection().save(range, this.parent.currentDocument);
|
|
16913
|
-
const
|
|
16914
|
-
const
|
|
17194
|
+
const clonedElement = this.parent.editableElement.cloneNode(true);
|
|
17195
|
+
const fragment = document.createDocumentFragment();
|
|
17196
|
+
while (clonedElement.firstChild) {
|
|
17197
|
+
fragment.appendChild(clonedElement.firstChild);
|
|
17198
|
+
}
|
|
17199
|
+
const changEle = { text: fragment, range: save };
|
|
16915
17200
|
if (this.undoRedoStack.length >= this.steps) {
|
|
16916
17201
|
this.undoRedoStack = this.undoRedoStack.slice(0, this.steps + 1);
|
|
16917
17202
|
}
|
|
@@ -16919,7 +17204,8 @@ class UndoRedoManager {
|
|
|
16919
17204
|
&& (this.undoRedoStack[this.undoRedoStack.length - 1].range.startOffset === save.range.startOffset) &&
|
|
16920
17205
|
(this.undoRedoStack[this.undoRedoStack.length - 1].range.endOffset === save.range.endOffset) &&
|
|
16921
17206
|
(this.undoRedoStack[this.undoRedoStack.length - 1].range.range.startContainer === save.range.startContainer) &&
|
|
16922
|
-
(this.undoRedoStack[this.undoRedoStack.length - 1].text.trim() ===
|
|
17207
|
+
(this.getTextContentFromFragment(this.undoRedoStack[this.undoRedoStack.length - 1].text).trim() ===
|
|
17208
|
+
this.getTextContentFromFragment(changEle.text).trim())) {
|
|
16923
17209
|
return;
|
|
16924
17210
|
}
|
|
16925
17211
|
this.undoRedoStack.push(changEle);
|
|
@@ -16945,7 +17231,8 @@ class UndoRedoManager {
|
|
|
16945
17231
|
if (this.steps > 0) {
|
|
16946
17232
|
const range = this.undoRedoStack[this.steps - 1].range;
|
|
16947
17233
|
const removedContent = this.undoRedoStack[this.steps - 1].text;
|
|
16948
|
-
this.parent.editableElement.innerHTML =
|
|
17234
|
+
this.parent.editableElement.innerHTML = '';
|
|
17235
|
+
this.parent.editableElement.appendChild(removedContent.cloneNode(true));
|
|
16949
17236
|
this.parent.editableElement.focus();
|
|
16950
17237
|
if (isIDevice$1()) {
|
|
16951
17238
|
setEditFrameFocus(this.parent.editableElement, e.selector);
|
|
@@ -16975,7 +17262,9 @@ class UndoRedoManager {
|
|
|
16975
17262
|
redo(e) {
|
|
16976
17263
|
if (this.undoRedoStack[this.steps + 1] != null) {
|
|
16977
17264
|
const range = this.undoRedoStack[this.steps + 1].range;
|
|
16978
|
-
|
|
17265
|
+
const addedContent = this.undoRedoStack[this.steps + 1].text;
|
|
17266
|
+
this.parent.editableElement.innerHTML = '';
|
|
17267
|
+
this.parent.editableElement.appendChild(addedContent.cloneNode(true));
|
|
16979
17268
|
this.parent.editableElement.focus();
|
|
16980
17269
|
if (isIDevice$1()) {
|
|
16981
17270
|
setEditFrameFocus(this.parent.editableElement, e.selector);
|
|
@@ -17085,6 +17374,8 @@ class MsWordPaste {
|
|
|
17085
17374
|
listNodes[0].parentElement.tagName !== 'OL') {
|
|
17086
17375
|
this.listConverter(listNodes);
|
|
17087
17376
|
}
|
|
17377
|
+
this.cleanList(elm, 'UL');
|
|
17378
|
+
this.cleanList(elm, 'OL');
|
|
17088
17379
|
this.styleCorrection(elm, wordPasteStyleConfig);
|
|
17089
17380
|
this.removingComments(elm);
|
|
17090
17381
|
this.removeUnwantedElements(elm);
|
|
@@ -17110,11 +17401,38 @@ class MsWordPaste {
|
|
|
17110
17401
|
e.callBack(elm.innerHTML);
|
|
17111
17402
|
}
|
|
17112
17403
|
}
|
|
17404
|
+
cleanList(elm, listTag) {
|
|
17405
|
+
let replacableElem = elm.querySelectorAll(listTag + ' div');
|
|
17406
|
+
for (let j = replacableElem.length - 1; j >= 0; j--) {
|
|
17407
|
+
const parentElem = replacableElem[j].parentNode;
|
|
17408
|
+
while (replacableElem[j].firstChild) {
|
|
17409
|
+
parentElem.insertBefore(replacableElem[j].firstChild, replacableElem[j]);
|
|
17410
|
+
}
|
|
17411
|
+
let closestListElem = this.findClosestListElem(replacableElem[j]);
|
|
17412
|
+
if (closestListElem) {
|
|
17413
|
+
this.insertAfter(replacableElem[j], closestListElem);
|
|
17414
|
+
}
|
|
17415
|
+
}
|
|
17416
|
+
}
|
|
17417
|
+
insertAfter(newNode, referenceNode) {
|
|
17418
|
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
|
17419
|
+
}
|
|
17420
|
+
findClosestListElem(listElem) {
|
|
17421
|
+
let closestListElem;
|
|
17422
|
+
while (!isNullOrUndefined(listElem)) {
|
|
17423
|
+
listElem = !isNullOrUndefined(listElem.closest('ul')) && listElem.tagName !== 'UL' ?
|
|
17424
|
+
listElem.closest('ul') : (listElem.tagName !== 'OL' ? listElem.closest('ol') : null);
|
|
17425
|
+
closestListElem = !isNullOrUndefined(listElem) ? listElem : closestListElem;
|
|
17426
|
+
}
|
|
17427
|
+
return closestListElem;
|
|
17428
|
+
}
|
|
17113
17429
|
addListClass(elm) {
|
|
17114
17430
|
const allNodes = elm.querySelectorAll('*');
|
|
17115
17431
|
for (let index = 0; index < allNodes.length; index++) {
|
|
17116
17432
|
if (!isNullOrUndefined(allNodes[index].getAttribute('style')) && allNodes[index].getAttribute('style').replace(/ /g, '').replace('\n', '').indexOf('mso-list:l') >= 0 &&
|
|
17117
|
-
allNodes[index].className.toLowerCase().indexOf('msolistparagraph') === -1 &&
|
|
17433
|
+
allNodes[index].className.toLowerCase().indexOf('msolistparagraph') === -1 &&
|
|
17434
|
+
allNodes[index].tagName.charAt(0) !== 'H' && allNodes[index].tagName !== 'LI' &&
|
|
17435
|
+
allNodes[index].tagName !== 'OL' && allNodes[index].tagName !== 'UL') {
|
|
17118
17436
|
allNodes[index].classList.add('msolistparagraph');
|
|
17119
17437
|
}
|
|
17120
17438
|
}
|
|
@@ -17238,7 +17556,7 @@ class MsWordPaste {
|
|
|
17238
17556
|
hexConversion(rtfData) {
|
|
17239
17557
|
// eslint-disable-next-line
|
|
17240
17558
|
const picHead = /\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/;
|
|
17241
|
-
// eslint-disable-next-line
|
|
17559
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17242
17560
|
const pic = new RegExp('(?:(' + picHead.source + '))([\\da-fA-F\\s]+)\\}', 'g');
|
|
17243
17561
|
const fullImg = rtfData.match(pic);
|
|
17244
17562
|
let imgType;
|
|
@@ -17302,9 +17620,9 @@ class MsWordPaste {
|
|
|
17302
17620
|
removeUnwantedElements(elm) {
|
|
17303
17621
|
let innerElement = elm.innerHTML;
|
|
17304
17622
|
for (let i = 0; i < this.removableElements.length; i++) {
|
|
17305
|
-
// eslint-disable-next-line
|
|
17623
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17306
17624
|
const regExpStartElem = new RegExp('<' + this.removableElements[i] + '>', 'g');
|
|
17307
|
-
// eslint-disable-next-line
|
|
17625
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
17308
17626
|
const regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
|
|
17309
17627
|
innerElement = innerElement.replace(regExpStartElem, '');
|
|
17310
17628
|
innerElement = innerElement.replace(regExpEndElem, '');
|
|
@@ -17347,9 +17665,14 @@ class MsWordPaste {
|
|
|
17347
17665
|
!isNullOrUndefined(emptyElements[i].closest('td').querySelector('.MsoNormal'))) {
|
|
17348
17666
|
emptyElements[i].innerHTML = '-';
|
|
17349
17667
|
}
|
|
17668
|
+
let lineWithDiv = true;
|
|
17669
|
+
if (emptyElements[i].tagName === 'DIV') {
|
|
17670
|
+
lineWithDiv = emptyElements[i].style.borderBottom === 'none' ||
|
|
17671
|
+
emptyElements[i].style.borderBottom === '' ? true : false;
|
|
17672
|
+
}
|
|
17350
17673
|
if (emptyElements[i].tagName !== 'IMG' && emptyElements[i].tagName !== 'BR' &&
|
|
17351
17674
|
emptyElements[i].tagName !== 'IFRAME' && emptyElements[i].tagName !== 'TD' &&
|
|
17352
|
-
emptyElements[i].tagName !== 'HR') {
|
|
17675
|
+
emptyElements[i].tagName !== 'HR' && lineWithDiv) {
|
|
17353
17676
|
const detachableElement = this.findDetachEmptyElem(emptyElements[i]);
|
|
17354
17677
|
if (!isNullOrUndefined(detachableElement)) {
|
|
17355
17678
|
detach(detachableElement);
|
|
@@ -17478,7 +17801,6 @@ class MsWordPaste {
|
|
|
17478
17801
|
elm.innerHTML = innerElement;
|
|
17479
17802
|
}
|
|
17480
17803
|
cleanUp(node, listNodes) {
|
|
17481
|
-
// eslint-disable-next-line
|
|
17482
17804
|
const tempCleaner = [];
|
|
17483
17805
|
let prevflagState;
|
|
17484
17806
|
const allNodes = node.querySelectorAll('*');
|
|
@@ -17679,7 +18001,7 @@ class MsWordPaste {
|
|
|
17679
18001
|
break;
|
|
17680
18002
|
}
|
|
17681
18003
|
}
|
|
17682
|
-
if (!isNullOrUndefined(prevList) && index
|
|
18004
|
+
if (!isNullOrUndefined(prevList) && index !== 0 &&
|
|
17683
18005
|
collection[index - 1].listType !== collection[index].listType &&
|
|
17684
18006
|
!isNormalList) {
|
|
17685
18007
|
prevList = null;
|
|
@@ -17815,7 +18137,7 @@ class MsWordPaste {
|
|
|
17815
18137
|
else {
|
|
17816
18138
|
//Add to support separate list which looks like same list and also to add all tags as it is inside list
|
|
17817
18139
|
if (firstChild.childNodes.length > 0) {
|
|
17818
|
-
|
|
18140
|
+
const listOrder = firstChild.querySelector('span[style="mso-list:Ignore"]');
|
|
17819
18141
|
if (!isNullOrUndefined(listOrder)) {
|
|
17820
18142
|
this.listContents.push(listOrder.textContent.trim());
|
|
17821
18143
|
detach(listOrder);
|
|
@@ -18193,6 +18515,9 @@ class ToolbarStatus {
|
|
|
18193
18515
|
else if (list === 'none') {
|
|
18194
18516
|
return 'None';
|
|
18195
18517
|
}
|
|
18518
|
+
else if (this.isOrderedList(node)) {
|
|
18519
|
+
return true;
|
|
18520
|
+
}
|
|
18196
18521
|
else {
|
|
18197
18522
|
return null;
|
|
18198
18523
|
}
|
|
@@ -18211,18 +18536,81 @@ class ToolbarStatus {
|
|
|
18211
18536
|
else if (list === 'disc') {
|
|
18212
18537
|
return 'Disc';
|
|
18213
18538
|
}
|
|
18539
|
+
else if (this.isUnorderedList(node)) {
|
|
18540
|
+
return true;
|
|
18541
|
+
}
|
|
18214
18542
|
else {
|
|
18215
18543
|
return null;
|
|
18216
18544
|
}
|
|
18217
18545
|
}
|
|
18218
18546
|
}
|
|
18219
18547
|
|
|
18548
|
+
class EmojiPickerAction {
|
|
18549
|
+
constructor(parent) {
|
|
18550
|
+
this.parent = parent;
|
|
18551
|
+
this.addEventListener();
|
|
18552
|
+
}
|
|
18553
|
+
addEventListener() {
|
|
18554
|
+
this.parent.observer.on(EMOJI_PICKER_ACTIONS, this.emojiInsert, this);
|
|
18555
|
+
}
|
|
18556
|
+
emojiInsert(args) {
|
|
18557
|
+
const node = document.createTextNode(args.value);
|
|
18558
|
+
const selection = window.getSelection();
|
|
18559
|
+
const range = selection.getRangeAt(0);
|
|
18560
|
+
const cursorPos = range.startOffset;
|
|
18561
|
+
for (let i = cursorPos - 1; i >= cursorPos - 15; i--) {
|
|
18562
|
+
const prevChar = selection.focusNode.textContent.substring(i - 1, i);
|
|
18563
|
+
const isPrevSpace = /:$/.test(prevChar);
|
|
18564
|
+
if (isPrevSpace) {
|
|
18565
|
+
this.beforeApplyFormat(true);
|
|
18566
|
+
break;
|
|
18567
|
+
}
|
|
18568
|
+
}
|
|
18569
|
+
const colon = /:$/.test(selection.focusNode.textContent.charAt(cursorPos - 1));
|
|
18570
|
+
const prevChar = selection.focusNode.textContent.charAt(cursorPos - 2);
|
|
18571
|
+
const isPrevSpace = /\s/.test(prevChar);
|
|
18572
|
+
if (colon && (isPrevSpace || selection.focusOffset === 1)) {
|
|
18573
|
+
this.beforeApplyFormat(true);
|
|
18574
|
+
}
|
|
18575
|
+
InsertHtml.Insert(this.parent.currentDocument, node, this.parent.editableElement);
|
|
18576
|
+
if (args.callBack) {
|
|
18577
|
+
args.callBack({
|
|
18578
|
+
requestType: args.subCommand,
|
|
18579
|
+
editorMode: 'HTML',
|
|
18580
|
+
event: args.event,
|
|
18581
|
+
range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
|
|
18582
|
+
elements: this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)
|
|
18583
|
+
});
|
|
18584
|
+
}
|
|
18585
|
+
}
|
|
18586
|
+
beforeApplyFormat(isBlockFormat) {
|
|
18587
|
+
const range1 = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
18588
|
+
const node = this.parent.nodeSelection.getNodeCollection(range1)[0];
|
|
18589
|
+
const blockNewLine = !(node.parentElement.innerHTML.replace(/ |<br>/g, '').trim() === ':' || node.textContent.trim().indexOf('/') === 0);
|
|
18590
|
+
let startNode = node;
|
|
18591
|
+
if (blockNewLine && isBlockFormat) {
|
|
18592
|
+
while (startNode !== this.parent.editableElement) {
|
|
18593
|
+
startNode = startNode.parentElement;
|
|
18594
|
+
}
|
|
18595
|
+
}
|
|
18596
|
+
let startPoint = range1.startOffset;
|
|
18597
|
+
while (this.parent.nodeSelection.getRange(document).toString().indexOf(':') === -1) {
|
|
18598
|
+
this.parent.nodeSelection.setSelectionText(document, node, node, startPoint, range1.endOffset);
|
|
18599
|
+
startPoint--;
|
|
18600
|
+
}
|
|
18601
|
+
const range2 = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
18602
|
+
const node2 = this.parent.nodeCutter.GetSpliceNode(range2, node);
|
|
18603
|
+
node2.parentNode.removeChild(node2);
|
|
18604
|
+
}
|
|
18605
|
+
}
|
|
18606
|
+
|
|
18220
18607
|
/**
|
|
18221
18608
|
* Base export
|
|
18222
18609
|
*/
|
|
18223
18610
|
|
|
18224
18611
|
class FormatPainterActions {
|
|
18225
18612
|
constructor(parent, options) {
|
|
18613
|
+
this.INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
18226
18614
|
this.parent = parent;
|
|
18227
18615
|
this.settings = options;
|
|
18228
18616
|
this.addEventListener();
|
|
@@ -18230,8 +18618,43 @@ class FormatPainterActions {
|
|
|
18230
18618
|
}
|
|
18231
18619
|
addEventListener() {
|
|
18232
18620
|
this.parent.observer.on(FORMAT_PAINTER_ACTIONS, this.actionHandler, this);
|
|
18621
|
+
this.parent.observer.on(MODEL_CHANGED_PLUGIN, this.onPropertyChanged, this);
|
|
18622
|
+
}
|
|
18623
|
+
onPropertyChanged(prop) {
|
|
18624
|
+
if (prop && prop.module === 'formatPainter') {
|
|
18625
|
+
if (!isNullOrUndefined(prop.newProp.formatPainterSettings.allowedFormats)) {
|
|
18626
|
+
this.settings.allowedFormats = prop.newProp.formatPainterSettings.allowedFormats;
|
|
18627
|
+
}
|
|
18628
|
+
if (!isNullOrUndefined(prop.newProp.formatPainterSettings.deniedFormats)) {
|
|
18629
|
+
this.settings.deniedFormats = prop.newProp.formatPainterSettings.deniedFormats;
|
|
18630
|
+
this.setDeniedFormats();
|
|
18631
|
+
}
|
|
18632
|
+
}
|
|
18633
|
+
}
|
|
18634
|
+
removeEventListener() {
|
|
18635
|
+
this.parent.observer.off(FORMAT_PAINTER_ACTIONS, this.actionHandler);
|
|
18636
|
+
this.parent.observer.off(MODEL_CHANGED_PLUGIN, this.onPropertyChanged);
|
|
18637
|
+
}
|
|
18638
|
+
/**
|
|
18639
|
+
* Destroys the format painter.
|
|
18640
|
+
*
|
|
18641
|
+
* @function destroy
|
|
18642
|
+
* @returns {void}
|
|
18643
|
+
* @hidden
|
|
18644
|
+
* @deprecated
|
|
18645
|
+
*/
|
|
18646
|
+
destroy() {
|
|
18647
|
+
this.removeEventListener();
|
|
18648
|
+
this.INVALID_TAGS = null;
|
|
18649
|
+
this.copyCollection = null;
|
|
18650
|
+
this.deniedFormatsCollection = null;
|
|
18651
|
+
this.newElem = null;
|
|
18652
|
+
this.newElemLastChild = null;
|
|
18653
|
+
this.settings = null;
|
|
18654
|
+
this.parent = null;
|
|
18233
18655
|
}
|
|
18234
18656
|
actionHandler(args) {
|
|
18657
|
+
this.settings.allowedContext = ['Text', 'List', 'Table'];
|
|
18235
18658
|
if (!isNullOrUndefined(args) && !isNullOrUndefined(args.item) && !isNullOrUndefined(args.item.formatPainterAction)) {
|
|
18236
18659
|
switch (args.item.formatPainterAction) {
|
|
18237
18660
|
case 'format-copy':
|
|
@@ -18244,6 +18667,19 @@ class FormatPainterActions {
|
|
|
18244
18667
|
this.escapeAction();
|
|
18245
18668
|
break;
|
|
18246
18669
|
}
|
|
18670
|
+
this.callBack(args);
|
|
18671
|
+
}
|
|
18672
|
+
}
|
|
18673
|
+
callBack(event) {
|
|
18674
|
+
if (event.callBack) {
|
|
18675
|
+
event.callBack({
|
|
18676
|
+
requestType: 'FormatPainter',
|
|
18677
|
+
action: event.item.formatPainterAction,
|
|
18678
|
+
event: event.event,
|
|
18679
|
+
editorMode: 'HTML',
|
|
18680
|
+
range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
|
|
18681
|
+
elements: this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)
|
|
18682
|
+
});
|
|
18247
18683
|
}
|
|
18248
18684
|
}
|
|
18249
18685
|
generateElement() {
|
|
@@ -18298,7 +18734,6 @@ class FormatPainterActions {
|
|
|
18298
18734
|
return;
|
|
18299
18735
|
}
|
|
18300
18736
|
this.insertFormatNode(this.newElem, this.newElemLastChild);
|
|
18301
|
-
this.parent.undoRedoManager.saveData();
|
|
18302
18737
|
}
|
|
18303
18738
|
removeDeniedFormats(parentElement) {
|
|
18304
18739
|
if (!isNullOrUndefined(this.deniedFormatsCollection) && this.deniedFormatsCollection.length > 0) {
|
|
@@ -18347,13 +18782,23 @@ class FormatPainterActions {
|
|
|
18347
18782
|
copyAction() {
|
|
18348
18783
|
const copyCollection = [];
|
|
18349
18784
|
const range = this.parent.nodeSelection.getRange(document);
|
|
18350
|
-
|
|
18785
|
+
const domSelection = this.parent.nodeSelection;
|
|
18786
|
+
let nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
18787
|
+
domSelection.getSelectionNodeCollectionBr(range);
|
|
18788
|
+
if (nodes.length === 0 && domSelection.getSelectionNodeCollectionBr(range).length === 0) {
|
|
18789
|
+
return;
|
|
18790
|
+
}
|
|
18791
|
+
else {
|
|
18792
|
+
nodes = nodes.length === 0 ? domSelection.getSelectionNodeCollectionBr(range) : nodes;
|
|
18793
|
+
}
|
|
18794
|
+
let parentElem = nodes[0].parentElement;
|
|
18351
18795
|
let currentContext = this.findCurrentContext(parentElem);
|
|
18352
|
-
const allowedRulesArray = this.settings.allowedFormats.split(';')
|
|
18796
|
+
const allowedRulesArray = this.settings.allowedFormats.indexOf(';') > -1 ? this.settings.allowedFormats.split(';') :
|
|
18797
|
+
[this.settings.allowedFormats];
|
|
18353
18798
|
for (let i = 0; i < allowedRulesArray.length; i++) {
|
|
18354
18799
|
allowedRulesArray[i] = allowedRulesArray[i].trim();
|
|
18355
18800
|
}
|
|
18356
|
-
const [rangeParentElem, context] = this.getRangeParentElem(currentContext,
|
|
18801
|
+
const [rangeParentElem, context] = this.getRangeParentElem(currentContext, parentElem);
|
|
18357
18802
|
if (currentContext === null) {
|
|
18358
18803
|
currentContext = context;
|
|
18359
18804
|
}
|
|
@@ -18398,8 +18843,8 @@ class FormatPainterActions {
|
|
|
18398
18843
|
}
|
|
18399
18844
|
this.generateElement();
|
|
18400
18845
|
}
|
|
18401
|
-
getRangeParentElem(currentContext,
|
|
18402
|
-
let startContainer =
|
|
18846
|
+
getRangeParentElem(currentContext, rangeParent) {
|
|
18847
|
+
let startContainer = rangeParent;
|
|
18403
18848
|
let rangeParentELem;
|
|
18404
18849
|
if (startContainer.nodeType === 3) {
|
|
18405
18850
|
startContainer = startContainer.parentElement;
|
|
@@ -18419,7 +18864,7 @@ class FormatPainterActions {
|
|
|
18419
18864
|
break;
|
|
18420
18865
|
}
|
|
18421
18866
|
if (isNullOrUndefined(rangeParentELem)) {
|
|
18422
|
-
const nearBlockParentName = this.getNearestBlockParentElement(
|
|
18867
|
+
const nearBlockParentName = this.getNearestBlockParentElement(rangeParent);
|
|
18423
18868
|
if (!isNullOrUndefined(nearBlockParentName) && nearBlockParentName !== 'UL' &&
|
|
18424
18869
|
nearBlockParentName !== 'OL' && nearBlockParentName !== 'LI') {
|
|
18425
18870
|
rangeParentELem = closest(startContainer, nearBlockParentName);
|
|
@@ -18431,8 +18876,8 @@ class FormatPainterActions {
|
|
|
18431
18876
|
}
|
|
18432
18877
|
return [rangeParentELem, currentContext];
|
|
18433
18878
|
}
|
|
18434
|
-
getNearestBlockParentElement(
|
|
18435
|
-
let node =
|
|
18879
|
+
getNearestBlockParentElement(rangeParent) {
|
|
18880
|
+
let node = rangeParent;
|
|
18436
18881
|
if (node.nodeType === 3) {
|
|
18437
18882
|
node = node.parentNode;
|
|
18438
18883
|
}
|
|
@@ -18475,29 +18920,32 @@ class FormatPainterActions {
|
|
|
18475
18920
|
}
|
|
18476
18921
|
}
|
|
18477
18922
|
validateELementTag(node) {
|
|
18478
|
-
const INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
18479
18923
|
if (node.nodeType === 3) {
|
|
18480
18924
|
node = node.parentElement;
|
|
18481
18925
|
}
|
|
18482
|
-
return INVALID_TAGS.indexOf(node.tagName) > -1;
|
|
18926
|
+
return this.INVALID_TAGS.indexOf(node.tagName) > -1;
|
|
18483
18927
|
}
|
|
18484
18928
|
findCurrentContext(parentElem) {
|
|
18485
|
-
if (closest(parentElem, '
|
|
18486
|
-
return '
|
|
18929
|
+
if (closest(parentElem, 'p')) {
|
|
18930
|
+
return 'Text';
|
|
18487
18931
|
}
|
|
18488
18932
|
else if (closest(parentElem, 'li')) {
|
|
18489
18933
|
return 'List';
|
|
18490
18934
|
}
|
|
18491
|
-
else if (closest(parentElem, '
|
|
18492
|
-
return '
|
|
18935
|
+
else if (closest(parentElem, 'td') || closest(parentElem, 'tr') || closest(parentElem, 'th')) {
|
|
18936
|
+
return 'Table';
|
|
18493
18937
|
}
|
|
18494
18938
|
return null;
|
|
18495
18939
|
}
|
|
18496
18940
|
insertFormatNode(elem, lastChild) {
|
|
18941
|
+
let clonedElem = elem.cloneNode(true);
|
|
18942
|
+
if (!this.isBlockElement(elem)) {
|
|
18943
|
+
const newBlockElem = createElement('P');
|
|
18944
|
+
newBlockElem.appendChild(elem);
|
|
18945
|
+
clonedElem = newBlockElem.cloneNode(true);
|
|
18946
|
+
}
|
|
18497
18947
|
const endNode = this.parent.editableElement;
|
|
18498
18948
|
const docElement = this.parent.currentDocument;
|
|
18499
|
-
const domSelection = this.parent.nodeSelection;
|
|
18500
|
-
const clonedElem = elem.cloneNode(true);
|
|
18501
18949
|
let childElem = clonedElem.firstChild;
|
|
18502
18950
|
let inlineElement;
|
|
18503
18951
|
while (childElem) {
|
|
@@ -18514,80 +18962,70 @@ class FormatPainterActions {
|
|
|
18514
18962
|
lastChild: lastChild
|
|
18515
18963
|
};
|
|
18516
18964
|
SelectionCommands.applyFormat(docElement, null, endNode, 'P', 'formatPainter', null, formatValues);
|
|
18517
|
-
let isFullNodeSelected;
|
|
18518
18965
|
const range = this.parent.nodeSelection.getRange(docElement);
|
|
18519
18966
|
const isCollapsed = range.collapsed;
|
|
18520
|
-
const
|
|
18521
|
-
|
|
18522
|
-
if (
|
|
18523
|
-
|
|
18524
|
-
nodes[0] = nodes[0].parentElement;
|
|
18525
|
-
}
|
|
18526
|
-
isFullNodeSelected = nodes[0].textContent.trim() === range.commonAncestorContainer.wholeText.trim();
|
|
18967
|
+
const blockNodes = this.parent.domNode.blockNodes();
|
|
18968
|
+
let isFullNodeSelected = false;
|
|
18969
|
+
if (blockNodes.length === 1) {
|
|
18970
|
+
isFullNodeSelected = blockNodes[0].textContent.trim() === range.toString().trim();
|
|
18527
18971
|
}
|
|
18528
|
-
if (this.isBlockElement(
|
|
18529
|
-
this.insertBlockNode(
|
|
18972
|
+
if (this.isBlockElement(clonedElem) && isCollapsed || blockNodes.length > 1 || isFullNodeSelected) {
|
|
18973
|
+
this.insertBlockNode(clonedElem, range, docElement, blockNodes);
|
|
18530
18974
|
}
|
|
18531
18975
|
}
|
|
18532
|
-
insertBlockNode(element, range, docElement,
|
|
18976
|
+
insertBlockNode(element, range, docElement, nodes) {
|
|
18533
18977
|
const domSelection = this.parent.nodeSelection;
|
|
18978
|
+
const saveSelection = domSelection.save(range, docElement);
|
|
18979
|
+
this.parent.domNode.setMarker(saveSelection);
|
|
18534
18980
|
let listElement; // To clone to multiple list elements
|
|
18535
18981
|
let cloneListParentNode;
|
|
18982
|
+
let sameListType = false;
|
|
18536
18983
|
if (element.nodeName === 'UL' || element.nodeName === 'OL') {
|
|
18537
18984
|
cloneListParentNode = element.cloneNode(true);
|
|
18538
18985
|
listElement = cloneListParentNode.firstChild;
|
|
18539
18986
|
}
|
|
18540
|
-
const
|
|
18987
|
+
const cloneElementNode = isNullOrUndefined(cloneListParentNode) ? element : element.firstChild;
|
|
18541
18988
|
for (let index = 0; index < nodes.length; index++) {
|
|
18542
|
-
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
}
|
|
18546
|
-
while (!this.isBlockElement(nodes[index])) {
|
|
18547
|
-
nodes[index] = nodes[index].parentElement;
|
|
18548
|
-
}
|
|
18549
|
-
let cloneParentNode;
|
|
18550
|
-
if (!isNullOrUndefined(cloneListParentNode)) {
|
|
18551
|
-
cloneParentNode = listElement.cloneNode(true);
|
|
18552
|
-
}
|
|
18553
|
-
else {
|
|
18554
|
-
cloneParentNode = element.cloneNode(true);
|
|
18989
|
+
if (this.INVALID_TAGS.indexOf(nodes[index].nodeName) > -1 ||
|
|
18990
|
+
nodes[index].querySelectorAll('a,img,audio,video,iframe').length > 0) {
|
|
18991
|
+
continue;
|
|
18555
18992
|
}
|
|
18993
|
+
const cloneParentNode = cloneElementNode.cloneNode(false);
|
|
18556
18994
|
// Appending all the child elements
|
|
18557
18995
|
while (nodes[index].firstChild) {
|
|
18558
|
-
if (
|
|
18996
|
+
if (nodes[index].textContent.trim().length !== 0) {
|
|
18559
18997
|
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
18560
18998
|
}
|
|
18561
18999
|
else {
|
|
18562
|
-
|
|
18563
|
-
if (nodes[index].nodeType === 3) {
|
|
18564
|
-
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
18565
|
-
}
|
|
18566
|
-
else {
|
|
18567
|
-
cloneParentNode.innerHTML = nodes[index].innerHTML;
|
|
18568
|
-
nodes[index].innerHTML = '';
|
|
18569
|
-
}
|
|
18570
|
-
nodes[index] = nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
|
|
19000
|
+
nodes[index].removeChild(nodes[index].firstChild);
|
|
18571
19001
|
}
|
|
18572
19002
|
}
|
|
18573
|
-
if (
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
this.parent.nodeCutter.SplitNode(range, parent, true);
|
|
18583
|
-
if (!isNullOrUndefined(parent.previousElementSibling)) {
|
|
18584
|
-
parent.parentNode.insertBefore(cloneListParentNode, parent.nextElementSibling);
|
|
18585
|
-
}
|
|
18586
|
-
else {
|
|
18587
|
-
parent.parentElement.insertBefore(cloneListParentNode, parent);
|
|
18588
|
-
}
|
|
19003
|
+
if (nodes[index].nodeName === 'TD' || nodes[index].nodeName === 'TH') {
|
|
19004
|
+
if (isNullOrUndefined(cloneListParentNode)) {
|
|
19005
|
+
nodes[index].appendChild(cloneParentNode);
|
|
19006
|
+
continue;
|
|
19007
|
+
}
|
|
19008
|
+
else if (index === 0 && !isNullOrUndefined(cloneListParentNode)) {
|
|
19009
|
+
nodes[index].appendChild(cloneListParentNode);
|
|
19010
|
+
cloneListParentNode.appendChild(cloneParentNode);
|
|
19011
|
+
continue;
|
|
18589
19012
|
}
|
|
18590
|
-
|
|
19013
|
+
else {
|
|
19014
|
+
nodes[index].appendChild(cloneParentNode);
|
|
19015
|
+
continue;
|
|
19016
|
+
}
|
|
19017
|
+
}
|
|
19018
|
+
if (!isNullOrUndefined(cloneListParentNode)) {
|
|
19019
|
+
sameListType = this.isSameListType(element, nodes[index]);
|
|
19020
|
+
}
|
|
19021
|
+
if (cloneParentNode.nodeName === 'LI' && !sameListType) {
|
|
19022
|
+
this.insertNewList(range, nodes, index, cloneListParentNode, cloneParentNode);
|
|
19023
|
+
}
|
|
19024
|
+
else if (sameListType) {
|
|
19025
|
+
this.insertSameList(nodes, index, cloneListParentNode, cloneParentNode);
|
|
19026
|
+
}
|
|
19027
|
+
else {
|
|
19028
|
+
nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
|
|
18591
19029
|
}
|
|
18592
19030
|
/**Removing the inserted block node in list and appending to previous element sibling */
|
|
18593
19031
|
if (cloneParentNode.nodeName !== 'LI' && (cloneParentNode.parentElement.nodeName === 'OL' ||
|
|
@@ -18597,24 +19035,110 @@ class FormatPainterActions {
|
|
|
18597
19035
|
this.parent.nodeCutter.SplitNode(range, parent, true);
|
|
18598
19036
|
if (!isNullOrUndefined(parent.previousElementSibling)) {
|
|
18599
19037
|
parent.previousElementSibling.after(cloneParentNode);
|
|
19038
|
+
// To remove the nested list items out of the block element
|
|
19039
|
+
if (cloneParentNode.childNodes.length > 1) {
|
|
19040
|
+
for (let j = 0; j < cloneParentNode.childNodes.length; j++) {
|
|
19041
|
+
const currentChild = cloneParentNode.childNodes[j];
|
|
19042
|
+
if (currentChild.nodeName === 'OL' || currentChild.nodeName === 'UL') {
|
|
19043
|
+
cloneParentNode.after(currentChild);
|
|
19044
|
+
}
|
|
19045
|
+
}
|
|
19046
|
+
}
|
|
18600
19047
|
}
|
|
18601
19048
|
else {
|
|
18602
19049
|
parent.parentElement.prepend(cloneParentNode);
|
|
18603
19050
|
}
|
|
18604
19051
|
}
|
|
18605
|
-
nodes[index] = lastTextNode;
|
|
18606
19052
|
}
|
|
18607
19053
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18608
19054
|
!isNullOrUndefined(listElement) ? detach(listElement) : false;
|
|
18609
19055
|
this.cleanEmptyLists();
|
|
18610
|
-
|
|
18611
|
-
|
|
18612
|
-
|
|
18613
|
-
|
|
19056
|
+
const save = this.parent.domNode.saveMarker(saveSelection, null);
|
|
19057
|
+
save.restore();
|
|
19058
|
+
}
|
|
19059
|
+
insertNewList(range, nodes, index, cloneListParentNode, cloneParentNode) {
|
|
19060
|
+
// Appending the li nodes to the ol or ul node
|
|
19061
|
+
if (index === 0) {
|
|
19062
|
+
const nodeName = nodes[index].nodeName;
|
|
19063
|
+
nodes[index] = nodes[index].parentNode.replaceChild(cloneListParentNode, nodes[index]);
|
|
19064
|
+
const parent = nodeName === 'LI' ? cloneListParentNode.parentElement
|
|
19065
|
+
: cloneListParentNode;
|
|
19066
|
+
// Splicing and then inserting the node to previous element sibling of the Listparent.parent
|
|
19067
|
+
this.parent.nodeCutter.SplitNode(range, parent, true);
|
|
19068
|
+
if (nodes[index].nodeName === 'LI' && !isNullOrUndefined(parent)) {
|
|
19069
|
+
cloneListParentNode.append(cloneParentNode);
|
|
19070
|
+
if (!isNullOrUndefined(parent.parentNode)) {
|
|
19071
|
+
parent.parentNode.insertBefore(cloneListParentNode, parent);
|
|
19072
|
+
}
|
|
19073
|
+
}
|
|
19074
|
+
else {
|
|
19075
|
+
if (!isNullOrUndefined(parent)) {
|
|
19076
|
+
if (!isNullOrUndefined(parent.previousElementSibling) && parent.previousElementSibling.nodeName === cloneListParentNode.nodeName) {
|
|
19077
|
+
const currentParent = parent.previousElementSibling;
|
|
19078
|
+
currentParent.append(cloneParentNode);
|
|
19079
|
+
while (currentParent.firstChild) {
|
|
19080
|
+
cloneListParentNode.append(currentParent.firstChild);
|
|
19081
|
+
}
|
|
19082
|
+
}
|
|
19083
|
+
else if (!isNullOrUndefined(parent.nextElementSibling) && parent.nextElementSibling.nodeName === cloneListParentNode.nodeName) {
|
|
19084
|
+
const currentParent = parent.nextElementSibling;
|
|
19085
|
+
currentParent.prepend(cloneParentNode);
|
|
19086
|
+
while (currentParent.firstChild) {
|
|
19087
|
+
cloneListParentNode.append(currentParent.firstChild);
|
|
19088
|
+
}
|
|
19089
|
+
}
|
|
19090
|
+
else {
|
|
19091
|
+
cloneListParentNode.append(cloneParentNode);
|
|
19092
|
+
}
|
|
19093
|
+
}
|
|
19094
|
+
else {
|
|
19095
|
+
cloneListParentNode.append(cloneParentNode);
|
|
19096
|
+
}
|
|
19097
|
+
}
|
|
19098
|
+
}
|
|
19099
|
+
else {
|
|
19100
|
+
cloneListParentNode.append(cloneParentNode);
|
|
19101
|
+
}
|
|
19102
|
+
this.detachEmptyBlockNodes(nodes[index]);
|
|
19103
|
+
}
|
|
19104
|
+
insertSameList(nodes, index, cloneListParentNode, cloneParentNode) {
|
|
19105
|
+
if (index === 0) {
|
|
19106
|
+
if (!isNullOrUndefined(nodes[index].parentNode) && (nodes[index].parentNode.nodeName === 'UL' || nodes[index].parentNode.nodeName === 'OL')) {
|
|
19107
|
+
// append the nodes[index].parentNode.childNodes to the clonelistparentnode
|
|
19108
|
+
if (nodes.length === 1) {
|
|
19109
|
+
// When clicked with cursor in the single list item
|
|
19110
|
+
while (cloneParentNode.firstChild) {
|
|
19111
|
+
nodes[index].append(cloneParentNode.firstChild);
|
|
19112
|
+
}
|
|
19113
|
+
for (let i = 0; i < nodes[index].parentNode.childNodes.length; i++) {
|
|
19114
|
+
const currentChild = nodes[index].parentNode.childNodes[i];
|
|
19115
|
+
cloneListParentNode.append(currentChild.cloneNode(true));
|
|
19116
|
+
}
|
|
19117
|
+
}
|
|
19118
|
+
else {
|
|
19119
|
+
cloneListParentNode.append(cloneParentNode);
|
|
19120
|
+
}
|
|
19121
|
+
// replace the older ol and ul with new ol and ul of clonelistparentnode
|
|
19122
|
+
nodes[index].parentNode.parentNode.replaceChild(cloneListParentNode, nodes[index].parentNode);
|
|
19123
|
+
}
|
|
18614
19124
|
}
|
|
18615
19125
|
else {
|
|
18616
|
-
|
|
19126
|
+
cloneListParentNode.append(cloneParentNode);
|
|
19127
|
+
}
|
|
19128
|
+
this.detachEmptyBlockNodes(nodes[index]);
|
|
19129
|
+
}
|
|
19130
|
+
isSameListType(element, node) {
|
|
19131
|
+
let isSameListType = false;
|
|
19132
|
+
const nearestListNode = closest(node, 'ol, ul');
|
|
19133
|
+
if (!isNullOrUndefined(nearestListNode) && nearestListNode.querySelectorAll('li').length > 0) {
|
|
19134
|
+
if (nearestListNode.nodeName === element.nodeName) {
|
|
19135
|
+
isSameListType = true;
|
|
19136
|
+
}
|
|
19137
|
+
else {
|
|
19138
|
+
isSameListType = false;
|
|
19139
|
+
}
|
|
18617
19140
|
}
|
|
19141
|
+
return isSameListType;
|
|
18618
19142
|
}
|
|
18619
19143
|
cleanEmptyLists() {
|
|
18620
19144
|
const listElem = this.parent.editableElement.querySelectorAll('ol, ul');
|
|
@@ -18629,7 +19153,8 @@ class FormatPainterActions {
|
|
|
18629
19153
|
if (isNullOrUndefined(this.settings) || isNullOrUndefined(this.settings.deniedFormats)) {
|
|
18630
19154
|
return;
|
|
18631
19155
|
}
|
|
18632
|
-
const deniedFormats = this.settings.deniedFormats.split(';')
|
|
19156
|
+
const deniedFormats = this.settings.deniedFormats.indexOf(';') > -1 ? this.settings.deniedFormats.split(';') :
|
|
19157
|
+
[this.settings.deniedFormats];
|
|
18633
19158
|
const length = deniedFormats.length;
|
|
18634
19159
|
for (let i = 0; i < length; i++) {
|
|
18635
19160
|
const formatString = deniedFormats[i];
|
|
@@ -18643,6 +19168,11 @@ class FormatPainterActions {
|
|
|
18643
19168
|
}
|
|
18644
19169
|
this.deniedFormatsCollection = deniedFormatsCollection;
|
|
18645
19170
|
}
|
|
19171
|
+
detachEmptyBlockNodes(node) {
|
|
19172
|
+
if (!isNullOrUndefined(node) && node.textContent.trim() === '') {
|
|
19173
|
+
detach(node);
|
|
19174
|
+
}
|
|
19175
|
+
}
|
|
18646
19176
|
makeDeniedFormatsCollection(value) {
|
|
18647
19177
|
const openParenIndex = value.indexOf('(');
|
|
18648
19178
|
const closeParenIndex = value.indexOf(')');
|
|
@@ -18727,7 +19257,8 @@ class EditorManager {
|
|
|
18727
19257
|
this.tableObj = new TableCommand(this);
|
|
18728
19258
|
this.undoRedoManager = new UndoRedoManager(this, options.options);
|
|
18729
19259
|
this.msWordPaste = new MsWordPaste(this);
|
|
18730
|
-
this.
|
|
19260
|
+
this.formatPainterEditor = new FormatPainterActions(this, options.formatPainterSettings);
|
|
19261
|
+
this.emojiPickerObj = new EmojiPickerAction(this);
|
|
18731
19262
|
this.wireEvents();
|
|
18732
19263
|
}
|
|
18733
19264
|
wireEvents() {
|
|
@@ -18875,6 +19406,9 @@ class EditorManager {
|
|
|
18875
19406
|
case 'formatpainter':
|
|
18876
19407
|
this.observer.notify(FORMAT_PAINTER_ACTIONS, { item: exeValue, subCommand: value, event: event, callBack: callBack });
|
|
18877
19408
|
break;
|
|
19409
|
+
case 'emojipicker':
|
|
19410
|
+
this.observer.notify(EMOJI_PICKER_ACTIONS, { item: exeValue, subCommand: value, value: text,
|
|
19411
|
+
event: event, callBack: callBack });
|
|
18878
19412
|
}
|
|
18879
19413
|
}
|
|
18880
19414
|
}
|
|
@@ -19151,8 +19685,7 @@ const IFRAMEHEADER = `
|
|
|
19151
19685
|
span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
|
|
19152
19686
|
.e-table-rhelper { background-color: #4a90e2;}
|
|
19153
19687
|
.e-rtl { direction: rtl; }
|
|
19154
|
-
.e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden;
|
|
19155
|
-
padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }
|
|
19688
|
+
.e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden; padding-top: 16px; position: absolute; text-align: start; top: 0; z-index: 1; }
|
|
19156
19689
|
</style>
|
|
19157
19690
|
</head>`;
|
|
19158
19691
|
/**
|
|
@@ -19673,9 +20206,15 @@ class HtmlEditor {
|
|
|
19673
20206
|
}
|
|
19674
20207
|
backSpaceCleanup(e, currentRange) {
|
|
19675
20208
|
let isLiElement = false;
|
|
20209
|
+
let isPreviousNotContentEditable = true;
|
|
20210
|
+
if (!isNullOrUndefined(currentRange.startContainer.previousSibling) &&
|
|
20211
|
+
currentRange.startContainer.previousSibling.nodeName === 'SPAN') {
|
|
20212
|
+
isPreviousNotContentEditable = currentRange.startContainer.previousSibling.contentEditable === 'false' ? false : true;
|
|
20213
|
+
}
|
|
19676
20214
|
if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
|
|
19677
20215
|
currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
|
|
19678
|
-
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH'
|
|
20216
|
+
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH' &&
|
|
20217
|
+
isPreviousNotContentEditable) {
|
|
19679
20218
|
const checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
19680
20219
|
if (!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
|
|
19681
20220
|
!isNullOrUndefined(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') {
|
|
@@ -19903,7 +20442,7 @@ class HtmlEditor {
|
|
|
19903
20442
|
let resultSplitContent = '';
|
|
19904
20443
|
for (let j = 0; j < splitTextContent.length; j++) {
|
|
19905
20444
|
if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
|
|
19906
|
-
resultSplitContent += '<a
|
|
20445
|
+
resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
|
|
19907
20446
|
'" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
|
|
19908
20447
|
}
|
|
19909
20448
|
else {
|
|
@@ -20059,6 +20598,9 @@ class HtmlEditor {
|
|
|
20059
20598
|
member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
20060
20599
|
});
|
|
20061
20600
|
break;
|
|
20601
|
+
case 'EmojiPicker':
|
|
20602
|
+
this.parent.notify(emojiPicker, { member: 'emojiPicker', args: args });
|
|
20603
|
+
break;
|
|
20062
20604
|
default:
|
|
20063
20605
|
this.parent.formatter.process(this.parent, args, args.originalEvent, null);
|
|
20064
20606
|
break;
|
|
@@ -20348,6 +20890,7 @@ class PasteCleanup {
|
|
|
20348
20890
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
20349
20891
|
let currentFocusNode = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()).startContainer;
|
|
20350
20892
|
if (currentFocusNode.nodeName !== '#text') {
|
|
20893
|
+
// eslint-disable-next-line
|
|
20351
20894
|
currentFocusNode = currentFocusNode.childNodes[this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()).startOffset];
|
|
20352
20895
|
}
|
|
20353
20896
|
if (currentFocusNode.previousSibling.nodeName === 'IMG') {
|
|
@@ -21255,7 +21798,7 @@ class Resize {
|
|
|
21255
21798
|
else {
|
|
21256
21799
|
const eventType = Browser.info.name !== 'msie' ? e.touches[0] : e;
|
|
21257
21800
|
this.parent.element.style.height = eventType.clientY - boundRect.top + 'px';
|
|
21258
|
-
this.parent.element.style.width = (!this.parent.enableRtl) ?
|
|
21801
|
+
this.parent.element.style.width = (!this.parent.enableRtl) ? eventType.clientX - boundRect.left + 'px' : boundRect.right - eventType.clientX + 'px';
|
|
21259
21802
|
}
|
|
21260
21803
|
if (!this.parent.toolbarSettings.enable) {
|
|
21261
21804
|
this.parent.setContentHeight('', false);
|
|
@@ -21429,6 +21972,7 @@ class FileManager$1 {
|
|
|
21429
21972
|
detailsViewSettings: this.parent.fileManagerSettings.detailsViewSettings,
|
|
21430
21973
|
contextMenuSettings: this.parent.fileManagerSettings.contextMenuSettings,
|
|
21431
21974
|
navigationPaneSettings: this.parent.fileManagerSettings.navigationPaneSettings,
|
|
21975
|
+
beforeSend: this.parent.fileManagerSettings.beforeSend,
|
|
21432
21976
|
fileSelect: (e) => {
|
|
21433
21977
|
const selectedFile = e.fileDetails;
|
|
21434
21978
|
if (selectedFile.isFile && proxy.parent.insertImageSettings.allowedTypes.indexOf(selectedFile.type) > -1) {
|
|
@@ -21587,6 +22131,9 @@ class FullScreen {
|
|
|
21587
22131
|
&& !isNullOrUndefined(this.parent.quickToolbarModule)) {
|
|
21588
22132
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
21589
22133
|
}
|
|
22134
|
+
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22135
|
+
this.parent.notify(maximizeMinimizeClick, { args: event });
|
|
22136
|
+
}
|
|
21590
22137
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
21591
22138
|
if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
21592
22139
|
const evenArgs = {
|
|
@@ -21638,6 +22185,9 @@ class FullScreen {
|
|
|
21638
22185
|
&& !isNullOrUndefined(this.parent.quickToolbarModule)) {
|
|
21639
22186
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
21640
22187
|
}
|
|
22188
|
+
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22189
|
+
this.parent.notify(maximizeMinimizeClick, { args: event });
|
|
22190
|
+
}
|
|
21641
22191
|
if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
21642
22192
|
const evenArgs = {
|
|
21643
22193
|
cancel: false,
|
|
@@ -21813,14 +22363,10 @@ class FormatPainter {
|
|
|
21813
22363
|
}
|
|
21814
22364
|
onKeyDown(event) {
|
|
21815
22365
|
const originalEvent = event.args;
|
|
21816
|
-
if ((originalEvent.
|
|
22366
|
+
if ((originalEvent.altKey && originalEvent.shiftKey && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste'))
|
|
21817
22367
|
|| (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
|
|
21818
|
-
if (
|
|
21819
|
-
originalEvent.
|
|
21820
|
-
}
|
|
21821
|
-
if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'v' &&
|
|
21822
|
-
this.previousAction === 'format-copy' || this.previousAction === 'format-paste' || this.isSticky) {
|
|
21823
|
-
originalEvent.preventDefault();
|
|
22368
|
+
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
22369
|
+
originalEvent.stopPropagation();
|
|
21824
22370
|
}
|
|
21825
22371
|
this.actionHandler(event, 'keyBoard');
|
|
21826
22372
|
}
|
|
@@ -21904,8 +22450,7 @@ class FormatPainter {
|
|
|
21904
22450
|
}
|
|
21905
22451
|
}
|
|
21906
22452
|
destroy() {
|
|
21907
|
-
|
|
21908
|
-
if (this.parent.isDestroyed) {
|
|
22453
|
+
if (isNullOrUndefined(this.parent) || this.parent.isDestroyed) {
|
|
21909
22454
|
return;
|
|
21910
22455
|
}
|
|
21911
22456
|
this.parent.off(formatPainterClick, this.toolbarClick);
|
|
@@ -21913,6 +22458,13 @@ class FormatPainter {
|
|
|
21913
22458
|
this.parent.off(formatPainterDoubleClick, this.toolbarDoubleClick);
|
|
21914
22459
|
this.parent.off(keyDown, this.onKeyDown);
|
|
21915
22460
|
this.parent.off(destroy, this.destroy);
|
|
22461
|
+
if (!isNullOrUndefined(this.parent.formatter.editorManager.formatPainterEditor)) {
|
|
22462
|
+
this.parent.formatter.editorManager.formatPainterEditor.destroy();
|
|
22463
|
+
}
|
|
22464
|
+
this.parent = undefined;
|
|
22465
|
+
this.isSticky = undefined;
|
|
22466
|
+
this.isActive = undefined;
|
|
22467
|
+
this.previousAction = undefined;
|
|
21916
22468
|
}
|
|
21917
22469
|
/**
|
|
21918
22470
|
* For internal use only - Get the module name.
|
|
@@ -21925,6 +22477,775 @@ class FormatPainter {
|
|
|
21925
22477
|
}
|
|
21926
22478
|
}
|
|
21927
22479
|
|
|
22480
|
+
class EmojiPicker {
|
|
22481
|
+
constructor(parent, serviceLocator) {
|
|
22482
|
+
this.parent = parent;
|
|
22483
|
+
this.locator = serviceLocator;
|
|
22484
|
+
this.i10n = serviceLocator.getService('rteLocale');
|
|
22485
|
+
this.renderFactory = this.locator.getService('rendererFactory');
|
|
22486
|
+
this.baseToolbar = new BaseToolbar(this.parent, this.locator);
|
|
22487
|
+
this.addEventListener();
|
|
22488
|
+
}
|
|
22489
|
+
/**
|
|
22490
|
+
* Destroys the Count.
|
|
22491
|
+
*
|
|
22492
|
+
* @function destroy
|
|
22493
|
+
* @returns {void}
|
|
22494
|
+
* @hidden
|
|
22495
|
+
* @deprecated
|
|
22496
|
+
*/
|
|
22497
|
+
destroy() {
|
|
22498
|
+
this.removeEventListener();
|
|
22499
|
+
}
|
|
22500
|
+
addEventListener() {
|
|
22501
|
+
this.parent.on(emojiPicker, this.toolbarClick, this);
|
|
22502
|
+
this.parent.on(docClick, this.docClick, this);
|
|
22503
|
+
this.parent.on(keyDown, this.onkeyPress, this);
|
|
22504
|
+
this.parent.on(keyUp, this.onkeyUp, this);
|
|
22505
|
+
this.parent.on(contentscroll, this.contentscroll, this);
|
|
22506
|
+
this.parent.on(scroll, this.contentscroll, this);
|
|
22507
|
+
}
|
|
22508
|
+
// eslint-disable-next-line
|
|
22509
|
+
toolbarClick(args) {
|
|
22510
|
+
const spanElement = this.parent.element.querySelector('.e-emoji');
|
|
22511
|
+
this.divElement = spanElement.closest('div');
|
|
22512
|
+
const range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
|
|
22513
|
+
this.save = this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument());
|
|
22514
|
+
this.clickEvent = args.args;
|
|
22515
|
+
const emojiPicker$$1 = this.parent.emojiPickerSettings.iconsSet;
|
|
22516
|
+
if (this.popupObj) {
|
|
22517
|
+
removeClass([this.divElement], 'e-active');
|
|
22518
|
+
if (this.popupObj.element.querySelector('.e-rte-emoji-search') || !this.parent.emojiPickerSettings.showSearchBox) {
|
|
22519
|
+
this.popupObj.hide();
|
|
22520
|
+
return;
|
|
22521
|
+
}
|
|
22522
|
+
this.popupObj.hide();
|
|
22523
|
+
}
|
|
22524
|
+
this.popDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-popup', id: this.parent.getID() + '_emojiPicker' });
|
|
22525
|
+
this.parent.getToolbar().appendChild(this.popDiv);
|
|
22526
|
+
EventHandler.add(this.popDiv, 'keydown', this.onKeyDown, this);
|
|
22527
|
+
EventHandler.add(this.popDiv, 'keyup', this.searchFilter, this);
|
|
22528
|
+
const extendEle = this.parent.element.querySelector('.e-toolbar-extended');
|
|
22529
|
+
let zIndex;
|
|
22530
|
+
if (!isNullOrUndefined(extendEle)) {
|
|
22531
|
+
const computedStyle = window.getComputedStyle(extendEle);
|
|
22532
|
+
zIndex = computedStyle.getPropertyValue('z-index');
|
|
22533
|
+
}
|
|
22534
|
+
else {
|
|
22535
|
+
zIndex = '10001';
|
|
22536
|
+
}
|
|
22537
|
+
let target;
|
|
22538
|
+
let xValue;
|
|
22539
|
+
let yValue;
|
|
22540
|
+
if (!isNullOrUndefined(args.args)) {
|
|
22541
|
+
target = args.args.originalEvent.target;
|
|
22542
|
+
target = target.classList.contains('e-toolbar-item') ? target.firstChild : target.parentElement;
|
|
22543
|
+
xValue = 'left';
|
|
22544
|
+
yValue = 'bottom';
|
|
22545
|
+
}
|
|
22546
|
+
else if (isNullOrUndefined(args.x) && isNullOrUndefined(args.y)) {
|
|
22547
|
+
target = this.parent.inputElement;
|
|
22548
|
+
if (window.getSelection().rangeCount > 0) {
|
|
22549
|
+
const coordinates = this.getCoordinates();
|
|
22550
|
+
xValue = coordinates.left;
|
|
22551
|
+
yValue = coordinates.top;
|
|
22552
|
+
}
|
|
22553
|
+
}
|
|
22554
|
+
else {
|
|
22555
|
+
target = this.parent.inputElement;
|
|
22556
|
+
xValue = args.x;
|
|
22557
|
+
yValue = args.y;
|
|
22558
|
+
}
|
|
22559
|
+
this.popupObj = new Popup(this.popDiv, {
|
|
22560
|
+
targetType: 'relative',
|
|
22561
|
+
relateTo: target,
|
|
22562
|
+
collision: { X: 'fit', Y: 'none' },
|
|
22563
|
+
offsetY: 8,
|
|
22564
|
+
viewPortElement: this.parent.element,
|
|
22565
|
+
position: { X: xValue, Y: yValue },
|
|
22566
|
+
enableRtl: this.parent.enableRtl,
|
|
22567
|
+
zIndex: parseInt(zIndex, 10) + 1,
|
|
22568
|
+
actionOnScroll: 'hide',
|
|
22569
|
+
// eslint-disable-next-line
|
|
22570
|
+
close: (event) => {
|
|
22571
|
+
this.parent.isBlur = false;
|
|
22572
|
+
this.popupObj.destroy();
|
|
22573
|
+
detach(this.popupObj.element);
|
|
22574
|
+
this.popupObj = null;
|
|
22575
|
+
}
|
|
22576
|
+
});
|
|
22577
|
+
addClass([this.popupObj.element], 'e-popup-open');
|
|
22578
|
+
this.popupObj.refreshPosition(target);
|
|
22579
|
+
// header search element
|
|
22580
|
+
if ((!isNullOrUndefined(args.args) || (isNullOrUndefined(args.x) && isNullOrUndefined(args.y))) && this.parent.emojiPickerSettings.showSearchBox) {
|
|
22581
|
+
const inputEle = createElement('input', { id: 'e-rte-emoji-search', className: 'e-rte-emoji-search' });
|
|
22582
|
+
this.popDiv.append(inputEle);
|
|
22583
|
+
const inputobj = new TextBox({
|
|
22584
|
+
placeholder: this.i10n.getConstant('emojiPickerTypeToFind'),
|
|
22585
|
+
showClearButton: true
|
|
22586
|
+
});
|
|
22587
|
+
inputobj.appendTo(inputEle);
|
|
22588
|
+
inputEle.focus();
|
|
22589
|
+
}
|
|
22590
|
+
const closeIcon = this.popupObj.element.querySelector('.e-clear-icon');
|
|
22591
|
+
if (!isNullOrUndefined(closeIcon)) {
|
|
22592
|
+
EventHandler.add(closeIcon, 'mousedown', this.searchFilter, this);
|
|
22593
|
+
}
|
|
22594
|
+
// Header emoji toolbar div
|
|
22595
|
+
const emojiToolBar = this.parent.createElement('div', { className: 'e-rte-emojipicker-toolbar' });
|
|
22596
|
+
this.popDiv.appendChild(emojiToolBar);
|
|
22597
|
+
const pushToolBar = [];
|
|
22598
|
+
for (let i = 0; i < this.parent.emojiPickerSettings.iconsSet.length; i++) {
|
|
22599
|
+
if (!isNullOrUndefined(this.parent.emojiPickerSettings.iconsSet[i].iconCss)) {
|
|
22600
|
+
pushToolBar.push({ prefixIcon: this.parent.emojiPickerSettings.iconsSet[i].iconCss, htmlAttributes: { ['title']: this.parent.emojiPickerSettings.iconsSet[i].name } });
|
|
22601
|
+
}
|
|
22602
|
+
else {
|
|
22603
|
+
pushToolBar.push({ text: '&#x' + this.parent.emojiPickerSettings.iconsSet[i].code + ';', htmlAttributes: { ['title']: this.parent.emojiPickerSettings.iconsSet[i].name } });
|
|
22604
|
+
}
|
|
22605
|
+
}
|
|
22606
|
+
const toolbarObj = new Toolbar({
|
|
22607
|
+
items: pushToolBar,
|
|
22608
|
+
clicked: this.emojiToolbarClick.bind(this)
|
|
22609
|
+
});
|
|
22610
|
+
toolbarObj.appendTo(emojiToolBar);
|
|
22611
|
+
// emoji btn div
|
|
22612
|
+
const emojiBtnDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-btn' });
|
|
22613
|
+
this.popDiv.appendChild(emojiBtnDiv);
|
|
22614
|
+
let height;
|
|
22615
|
+
const popupBorder = window.getComputedStyle(this.popDiv);
|
|
22616
|
+
if ((isNullOrUndefined(args.args) && !(isNullOrUndefined(args.x) && isNullOrUndefined(args.y))) || !this.parent.emojiPickerSettings.showSearchBox) {
|
|
22617
|
+
height = (this.popDiv.getBoundingClientRect().height - emojiToolBar.getBoundingClientRect().height - (2 * parseFloat(popupBorder.borderWidth))) + 'px';
|
|
22618
|
+
emojiBtnDiv.style.setProperty('height', height, 'important');
|
|
22619
|
+
}
|
|
22620
|
+
else {
|
|
22621
|
+
const inputELe = this.parent.element.querySelector('.e-rte-emoji-search').parentElement;
|
|
22622
|
+
const getComputedStyle = window.getComputedStyle(inputELe);
|
|
22623
|
+
height = (this.popDiv.getBoundingClientRect().height - emojiToolBar.getBoundingClientRect().height
|
|
22624
|
+
- inputELe.getBoundingClientRect().height
|
|
22625
|
+
- parseFloat(getComputedStyle.marginTop) - parseFloat(getComputedStyle.marginBottom)
|
|
22626
|
+
- (2 * parseFloat(popupBorder.borderWidth))) + 'px';
|
|
22627
|
+
emojiBtnDiv.style.setProperty('height', height, 'important');
|
|
22628
|
+
}
|
|
22629
|
+
for (let i = 0; i < emojiPicker$$1.length; i++) {
|
|
22630
|
+
const emojiGroupDiv = this.parent.createElement('div', { className: 'e-rte-emojipicker-group' });
|
|
22631
|
+
emojiBtnDiv.appendChild(emojiGroupDiv);
|
|
22632
|
+
const emojiName = this.parent.createElement('div', { className: 'e-rte-emojipicker-name' });
|
|
22633
|
+
emojiName.innerText = this.parent.emojiPickerSettings.iconsSet[i].name;
|
|
22634
|
+
emojiName.setAttribute('aria-label', this.parent.emojiPickerSettings.iconsSet[i].name);
|
|
22635
|
+
emojiGroupDiv.appendChild(emojiName);
|
|
22636
|
+
const emojiBtn = this.parent.createElement('div', { className: 'e-rte-emojipickerbtn-group' });
|
|
22637
|
+
emojiGroupDiv.appendChild(emojiBtn);
|
|
22638
|
+
for (let j = 0; j < emojiPicker$$1[i].icons.length; j++) {
|
|
22639
|
+
const button = this.parent.createElement('button', { className: 'e-btn ' + ' ' + 'e-control' });
|
|
22640
|
+
button.innerHTML = this.buttoncode(this.parent.emojiPickerSettings.iconsSet[i].icons[j].code);
|
|
22641
|
+
button.setAttribute('aria-label', (this.parent.emojiPickerSettings.iconsSet[i].icons[j].desc));
|
|
22642
|
+
button.setAttribute('title', (this.parent.emojiPickerSettings.iconsSet[i].icons[j].desc));
|
|
22643
|
+
emojiBtn.appendChild(button);
|
|
22644
|
+
if (button.innerHTML.length > 2) {
|
|
22645
|
+
button.style.fontSize = '17px';
|
|
22646
|
+
}
|
|
22647
|
+
}
|
|
22648
|
+
}
|
|
22649
|
+
EventHandler.add(emojiBtnDiv, 'scroll', this.scrollEvent, this);
|
|
22650
|
+
EventHandler.add(emojiBtnDiv, 'click', this.emojiBtnClick, this);
|
|
22651
|
+
const emojiButtons = this.parent.element.querySelectorAll('.e-rte-emojipicker-btn button');
|
|
22652
|
+
if (isNullOrUndefined(this.parent.element.querySelector('.e-rte-emoji-search')) && !isNullOrUndefined(args.args)) {
|
|
22653
|
+
emojiButtons[0].focus();
|
|
22654
|
+
addClass([emojiButtons[0]], 'e-focus');
|
|
22655
|
+
}
|
|
22656
|
+
const popup = this.parent.element.querySelector('.e-rte-emojipicker-btn');
|
|
22657
|
+
const toolbarName = this.parent.element.querySelectorAll('.e-rte-emojipicker-toolbar button');
|
|
22658
|
+
let scrollTop;
|
|
22659
|
+
if (!isNullOrUndefined(popup)) {
|
|
22660
|
+
scrollTop = Math.round(popup.scrollTop);
|
|
22661
|
+
}
|
|
22662
|
+
for (let i = 0; i < toolbarName.length; i++) {
|
|
22663
|
+
/* eslint-disable */
|
|
22664
|
+
if (toolbarName[i].classList.contains('e-selected')) {
|
|
22665
|
+
removeClass([toolbarName[i]], 'e-selected');
|
|
22666
|
+
}
|
|
22667
|
+
/* eslint-enable */
|
|
22668
|
+
}
|
|
22669
|
+
if (scrollTop < toolbarName[0].offsetHeight) {
|
|
22670
|
+
addClass([toolbarName[0]], 'e-selected');
|
|
22671
|
+
}
|
|
22672
|
+
if (this.popupObj) {
|
|
22673
|
+
addClass([this.divElement], 'e-active');
|
|
22674
|
+
}
|
|
22675
|
+
}
|
|
22676
|
+
buttoncode(value) {
|
|
22677
|
+
const valueLength = value.split('-');
|
|
22678
|
+
// eslint-disable-next-line
|
|
22679
|
+
const joinedEmoji = valueLength.map(cp => String.fromCodePoint(parseInt(cp, 16))).join('\u200D');
|
|
22680
|
+
return joinedEmoji;
|
|
22681
|
+
}
|
|
22682
|
+
docClick(e) {
|
|
22683
|
+
const target = e.args.target;
|
|
22684
|
+
if (target && target.classList && ((this.popupObj && !closest(target, '[id=' + '\'' + this.popupObj.element.id + '\'' + ']')))
|
|
22685
|
+
&& (!target.classList.contains('e-emoji') && !target.classList.contains('e-toolbar-item'))) {
|
|
22686
|
+
if (this.popupObj) {
|
|
22687
|
+
removeClass([this.divElement], 'e-active');
|
|
22688
|
+
this.popupObj.hide();
|
|
22689
|
+
}
|
|
22690
|
+
}
|
|
22691
|
+
}
|
|
22692
|
+
scrollEvent() {
|
|
22693
|
+
const popup = this.parent.element.querySelector('.e-rte-emojipicker-btn');
|
|
22694
|
+
const emojiSet = this.parent.element.querySelectorAll('.e-rte-emojipicker-group');
|
|
22695
|
+
const toolbarName = this.parent.element.querySelectorAll('.e-rte-emojipicker-toolbar button');
|
|
22696
|
+
let scrollTop;
|
|
22697
|
+
if (!isNullOrUndefined(popup)) {
|
|
22698
|
+
scrollTop = Math.round(popup.scrollTop);
|
|
22699
|
+
}
|
|
22700
|
+
let firstSetWidth = 0;
|
|
22701
|
+
for (let j = 0; j < toolbarName.length; j++) {
|
|
22702
|
+
if (scrollTop < toolbarName[0].offsetHeight) {
|
|
22703
|
+
if (!isNullOrUndefined(toolbarName[j + 1])) {
|
|
22704
|
+
removeClass([toolbarName[j + 1]], 'e-selected');
|
|
22705
|
+
}
|
|
22706
|
+
addClass([toolbarName[0]], 'e-selected');
|
|
22707
|
+
}
|
|
22708
|
+
}
|
|
22709
|
+
for (let i = 0; i < emojiSet.length; i++) {
|
|
22710
|
+
// eslint-disable-next-line
|
|
22711
|
+
firstSetWidth += Math.round(emojiSet[i].offsetHeight);
|
|
22712
|
+
if (scrollTop >= firstSetWidth) {
|
|
22713
|
+
for (let k = 0; k < toolbarName.length; k++) {
|
|
22714
|
+
/* eslint-disable */
|
|
22715
|
+
if (toolbarName[k].classList.contains('e-selected')) {
|
|
22716
|
+
removeClass([toolbarName[k]], 'e-selected');
|
|
22717
|
+
}
|
|
22718
|
+
/* eslint-enable */
|
|
22719
|
+
}
|
|
22720
|
+
if (!isNullOrUndefined(toolbarName[i + 1])) {
|
|
22721
|
+
addClass([toolbarName[i + 1]], 'e-selected');
|
|
22722
|
+
}
|
|
22723
|
+
}
|
|
22724
|
+
}
|
|
22725
|
+
}
|
|
22726
|
+
contentscroll() {
|
|
22727
|
+
if (isNullOrUndefined(this.clickEvent) && this.popupObj) {
|
|
22728
|
+
removeClass([this.divElement], 'e-active');
|
|
22729
|
+
this.popupObj.hide();
|
|
22730
|
+
return;
|
|
22731
|
+
}
|
|
22732
|
+
}
|
|
22733
|
+
emojiToolbarClick(e) {
|
|
22734
|
+
const args = {
|
|
22735
|
+
// eslint-disable-next-line
|
|
22736
|
+
text: e.item.htmlAttributes.title,
|
|
22737
|
+
};
|
|
22738
|
+
const currentEleName = args.text;
|
|
22739
|
+
const emojiGroups = this.parent.element.querySelectorAll('.e-rte-emojipicker-group');
|
|
22740
|
+
const emojiButtons = this.parent.element.querySelectorAll('.e-rte-emojipicker-btn button');
|
|
22741
|
+
const toolbarName = this.parent.element.querySelectorAll('.e-rte-emojipicker-toolbar button');
|
|
22742
|
+
for (let i = 0; i < toolbarName.length; i++) {
|
|
22743
|
+
/* eslint-disable */
|
|
22744
|
+
if (toolbarName[i].classList.contains('e-selected')) {
|
|
22745
|
+
removeClass([toolbarName[i]], 'e-selected');
|
|
22746
|
+
}
|
|
22747
|
+
/* eslint-enable */
|
|
22748
|
+
}
|
|
22749
|
+
for (let i = 0; i < emojiButtons.length; i++) {
|
|
22750
|
+
if (emojiButtons[i].classList.contains('e-focus')) {
|
|
22751
|
+
removeClass([emojiButtons[i]], 'e-focus');
|
|
22752
|
+
}
|
|
22753
|
+
}
|
|
22754
|
+
// Loop through the selected elements and perform the same operation on each element
|
|
22755
|
+
const emojiGroupsheight = this.parent.element.querySelector('.e-rte-emojipicker-btn');
|
|
22756
|
+
let emojiHeight = 0;
|
|
22757
|
+
// eslint-disable-next-line
|
|
22758
|
+
emojiGroups.forEach(group => {
|
|
22759
|
+
const childNodes = group.childNodes[0];
|
|
22760
|
+
const focusBtn = group.childNodes[1].childNodes[0];
|
|
22761
|
+
const ariaLabel = childNodes.getAttribute('aria-label');
|
|
22762
|
+
if (currentEleName === ariaLabel) {
|
|
22763
|
+
if (childNodes) {
|
|
22764
|
+
emojiGroupsheight.scrollTop = emojiHeight + 10;
|
|
22765
|
+
addClass([focusBtn], 'e-focus');
|
|
22766
|
+
focusBtn.focus();
|
|
22767
|
+
}
|
|
22768
|
+
}
|
|
22769
|
+
else {
|
|
22770
|
+
emojiHeight += group.scrollHeight;
|
|
22771
|
+
removeClass([focusBtn], 'e-focus');
|
|
22772
|
+
}
|
|
22773
|
+
});
|
|
22774
|
+
}
|
|
22775
|
+
onKeyDown(e) {
|
|
22776
|
+
// Select all emoji buttons
|
|
22777
|
+
const emojiButtons = this.parent.element.querySelectorAll('.e-rte-emojipicker-btn button');
|
|
22778
|
+
const emojiGroups = this.parent.element.querySelectorAll('.e-rte-emojipickerbtn-group');
|
|
22779
|
+
const searchKeyHandler = this.parent.element.querySelector('.e-rte-emojisearch-btn button');
|
|
22780
|
+
if (e.keyCode === 27) {
|
|
22781
|
+
if (this.popupObj) {
|
|
22782
|
+
removeClass([this.divElement], 'e-active');
|
|
22783
|
+
this.popupObj.hide();
|
|
22784
|
+
}
|
|
22785
|
+
}
|
|
22786
|
+
if (e.keyCode === 13) {
|
|
22787
|
+
const activeEle = document.activeElement;
|
|
22788
|
+
if (activeEle.classList.contains('e-btn')) {
|
|
22789
|
+
this.emojiBtnClick(e);
|
|
22790
|
+
e.preventDefault();
|
|
22791
|
+
}
|
|
22792
|
+
}
|
|
22793
|
+
const srcElement = e.srcElement;
|
|
22794
|
+
if (!isNullOrUndefined(srcElement)) {
|
|
22795
|
+
if (srcElement.classList.contains('e-rte-emoji-search') && e.keyCode === 40) {
|
|
22796
|
+
for (let i = 0; i < emojiButtons.length; i++) {
|
|
22797
|
+
if (emojiButtons[i].classList.contains('e-focus')) {
|
|
22798
|
+
removeClass([emojiButtons[i]], 'e-focus');
|
|
22799
|
+
}
|
|
22800
|
+
}
|
|
22801
|
+
}
|
|
22802
|
+
}
|
|
22803
|
+
if (!isNullOrUndefined(searchKeyHandler)) {
|
|
22804
|
+
this.filterKeyHandler(e);
|
|
22805
|
+
}
|
|
22806
|
+
else {
|
|
22807
|
+
for (let i = 0; i < emojiButtons.length; i++) {
|
|
22808
|
+
let focusIndex = i;
|
|
22809
|
+
if (emojiButtons[i].classList.contains('e-focus')) {
|
|
22810
|
+
if (e.keyCode === 40) {
|
|
22811
|
+
// Move focus to next row if there is one
|
|
22812
|
+
if (emojiButtons.length - 4 > i) {
|
|
22813
|
+
let count$$1 = 0;
|
|
22814
|
+
for (let j = 0; j < emojiGroups.length; j++) {
|
|
22815
|
+
for (let k = 0; k < emojiGroups[j].childNodes.length; k++) {
|
|
22816
|
+
// eslint-disable-next-line
|
|
22817
|
+
const childNodes = emojiGroups[j].childNodes[k];
|
|
22818
|
+
if (childNodes.classList.contains('e-focus') && count$$1 !== 1) {
|
|
22819
|
+
const currentIndex = k;
|
|
22820
|
+
const lastChild = emojiGroups[j].lastChild;
|
|
22821
|
+
const lastRowIndex = Math.floor((k) % 6);
|
|
22822
|
+
const lastEleLength = emojiGroups[j].childNodes.length - 1;
|
|
22823
|
+
const lastEleIndex = Math.floor((lastEleLength) % 6);
|
|
22824
|
+
if (currentIndex !== -1) {
|
|
22825
|
+
const nextRowIndex = currentIndex + 6;
|
|
22826
|
+
if (!isNullOrUndefined(emojiGroups[j].childNodes[nextRowIndex])) {
|
|
22827
|
+
// next row has six buttons
|
|
22828
|
+
// handle focus change here
|
|
22829
|
+
const firstFocusEle = emojiButtons[i];
|
|
22830
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22831
|
+
const focusEle = emojiButtons[focusIndex += 6];
|
|
22832
|
+
addClass([focusEle], 'e-focus');
|
|
22833
|
+
focusEle.focus();
|
|
22834
|
+
break;
|
|
22835
|
+
}
|
|
22836
|
+
else if (isNullOrUndefined(emojiGroups[j].childNodes[nextRowIndex]) && !lastChild.classList.contains('e-focus') && lastEleIndex < lastRowIndex) {
|
|
22837
|
+
const firstFocusEle = emojiButtons[i];
|
|
22838
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22839
|
+
const focusEle = emojiGroups[j].lastChild;
|
|
22840
|
+
addClass([focusEle], 'e-focus');
|
|
22841
|
+
focusEle.focus();
|
|
22842
|
+
count$$1 = 1;
|
|
22843
|
+
break;
|
|
22844
|
+
}
|
|
22845
|
+
else {
|
|
22846
|
+
const firstFocusEle = emojiButtons[i];
|
|
22847
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22848
|
+
const focusEle = emojiGroups[j + 1]
|
|
22849
|
+
.childNodes[lastRowIndex];
|
|
22850
|
+
addClass([focusEle], 'e-focus');
|
|
22851
|
+
focusEle.focus();
|
|
22852
|
+
count$$1 = 1;
|
|
22853
|
+
break;
|
|
22854
|
+
}
|
|
22855
|
+
}
|
|
22856
|
+
}
|
|
22857
|
+
}
|
|
22858
|
+
}
|
|
22859
|
+
break;
|
|
22860
|
+
}
|
|
22861
|
+
}
|
|
22862
|
+
else if (e.keyCode === 38) {
|
|
22863
|
+
// Move focus to previous row if there is one
|
|
22864
|
+
if (i >= 6) {
|
|
22865
|
+
let count$$1 = 0;
|
|
22866
|
+
for (let j = 0; j < emojiGroups.length; j++) {
|
|
22867
|
+
for (let k = 0; k < emojiGroups[j].childNodes.length; k++) {
|
|
22868
|
+
const childNodes = emojiGroups[j].childNodes[k];
|
|
22869
|
+
if (childNodes.classList.contains('e-focus') && count$$1 !== 1) {
|
|
22870
|
+
// eslint-disable-next-line
|
|
22871
|
+
const currentIndex = k;
|
|
22872
|
+
const previousRowLength = isNullOrUndefined(emojiGroups[j - 1]) ? null :
|
|
22873
|
+
emojiGroups[j - 1].childNodes.length % 6 || 6;
|
|
22874
|
+
if (currentIndex !== -1) {
|
|
22875
|
+
const previousRowIndex = currentIndex - 6;
|
|
22876
|
+
if (!isNullOrUndefined(emojiGroups[j].childNodes[previousRowIndex])) {
|
|
22877
|
+
// previous row has six buttons
|
|
22878
|
+
// handle focus change here
|
|
22879
|
+
const firstFocusEle = emojiButtons[i];
|
|
22880
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22881
|
+
const focusEle = emojiButtons[focusIndex -= 6];
|
|
22882
|
+
addClass([focusEle], 'e-focus');
|
|
22883
|
+
focusEle.focus();
|
|
22884
|
+
break;
|
|
22885
|
+
}
|
|
22886
|
+
else if (isNullOrUndefined(emojiGroups[j - 1].childNodes[emojiGroups[j - 1]
|
|
22887
|
+
.childNodes.length - (previousRowLength - k)])) {
|
|
22888
|
+
const firstFocusEle = emojiButtons[i];
|
|
22889
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22890
|
+
const focusEle = emojiGroups[j - 1].lastChild;
|
|
22891
|
+
addClass([focusEle], 'e-focus');
|
|
22892
|
+
focusEle.focus();
|
|
22893
|
+
count$$1 = 1;
|
|
22894
|
+
break;
|
|
22895
|
+
}
|
|
22896
|
+
else {
|
|
22897
|
+
// previous row has less than six buttons
|
|
22898
|
+
// handle focus change here
|
|
22899
|
+
const firstFocusEle = emojiButtons[i];
|
|
22900
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22901
|
+
const focusEle = emojiGroups[j - 1].childNodes[emojiGroups[j - 1].
|
|
22902
|
+
childNodes.length - (previousRowLength - k)];
|
|
22903
|
+
addClass([focusEle], 'e-focus');
|
|
22904
|
+
focusEle.focus();
|
|
22905
|
+
count$$1 = 1;
|
|
22906
|
+
break;
|
|
22907
|
+
}
|
|
22908
|
+
}
|
|
22909
|
+
}
|
|
22910
|
+
}
|
|
22911
|
+
}
|
|
22912
|
+
}
|
|
22913
|
+
else {
|
|
22914
|
+
const firstFocusEle = emojiButtons[i];
|
|
22915
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22916
|
+
const focusEle = emojiButtons[focusIndex -= 1];
|
|
22917
|
+
const inputELe = this.popupObj.element.querySelector('.e-rte-emoji-search');
|
|
22918
|
+
if (isNullOrUndefined(focusEle) && !isNullOrUndefined(inputELe)) {
|
|
22919
|
+
inputELe.focus();
|
|
22920
|
+
break;
|
|
22921
|
+
}
|
|
22922
|
+
addClass([focusEle], 'e-focus');
|
|
22923
|
+
focusEle.focus();
|
|
22924
|
+
}
|
|
22925
|
+
break;
|
|
22926
|
+
}
|
|
22927
|
+
else if (e.keyCode === 39) {
|
|
22928
|
+
// Move focus to next button in current row
|
|
22929
|
+
if (emojiButtons.length !== i + 1) {
|
|
22930
|
+
const firstFocusEle = emojiButtons[i];
|
|
22931
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22932
|
+
const focusEle = emojiButtons[focusIndex += 1];
|
|
22933
|
+
addClass([focusEle], 'e-focus');
|
|
22934
|
+
emojiButtons[focusIndex].focus();
|
|
22935
|
+
}
|
|
22936
|
+
break;
|
|
22937
|
+
}
|
|
22938
|
+
else if (e.keyCode === 37) {
|
|
22939
|
+
// Move focus to previous button in current row
|
|
22940
|
+
if (i > 0) {
|
|
22941
|
+
const firstFocusEle = emojiButtons[i];
|
|
22942
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22943
|
+
const focusEle = emojiButtons[focusIndex -= 1];
|
|
22944
|
+
addClass([focusEle], 'e-focus');
|
|
22945
|
+
emojiButtons[focusIndex].focus();
|
|
22946
|
+
}
|
|
22947
|
+
break;
|
|
22948
|
+
}
|
|
22949
|
+
}
|
|
22950
|
+
}
|
|
22951
|
+
}
|
|
22952
|
+
if (e.keyCode === 40) {
|
|
22953
|
+
const firstFocusEle = this.parent.element.querySelector('.e-focus');
|
|
22954
|
+
if (isNullOrUndefined(firstFocusEle)) {
|
|
22955
|
+
const focusEle = emojiButtons[0];
|
|
22956
|
+
addClass([focusEle], 'e-focus');
|
|
22957
|
+
emojiButtons[0].focus();
|
|
22958
|
+
}
|
|
22959
|
+
}
|
|
22960
|
+
}
|
|
22961
|
+
filterKeyHandler(e) {
|
|
22962
|
+
const emojiButtons = this.parent.element.querySelectorAll('.e-rte-emojisearch-btn button');
|
|
22963
|
+
const firstFocusEle = this.parent.element.querySelector('.e-focus');
|
|
22964
|
+
if (isNullOrUndefined(firstFocusEle) && e.keyCode === 40) {
|
|
22965
|
+
const focusEle = emojiButtons[0];
|
|
22966
|
+
addClass([focusEle], 'e-focus');
|
|
22967
|
+
emojiButtons[0].focus();
|
|
22968
|
+
}
|
|
22969
|
+
else {
|
|
22970
|
+
for (let i = 0; i < emojiButtons.length; i++) {
|
|
22971
|
+
let focusIndex = i;
|
|
22972
|
+
// eslint-disable-next-line
|
|
22973
|
+
const childNodes = emojiButtons[i];
|
|
22974
|
+
if (childNodes.classList.contains('e-focus')) {
|
|
22975
|
+
if (e.keyCode === 38) {
|
|
22976
|
+
if (i >= 6) {
|
|
22977
|
+
const firstFocusEle = emojiButtons[i];
|
|
22978
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22979
|
+
const focusEle = emojiButtons[focusIndex -= 6];
|
|
22980
|
+
addClass([focusEle], 'e-focus');
|
|
22981
|
+
focusEle.focus();
|
|
22982
|
+
break;
|
|
22983
|
+
}
|
|
22984
|
+
else {
|
|
22985
|
+
const firstFocusEle = emojiButtons[i];
|
|
22986
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
22987
|
+
const focusEle = emojiButtons[focusIndex -= 1];
|
|
22988
|
+
const inputELe = this.popupObj.element.querySelector('.e-rte-emoji-search');
|
|
22989
|
+
if (isNullOrUndefined(focusEle) && !isNullOrUndefined(inputELe)) {
|
|
22990
|
+
inputELe.focus();
|
|
22991
|
+
break;
|
|
22992
|
+
}
|
|
22993
|
+
addClass([focusEle], 'e-focus');
|
|
22994
|
+
focusEle.focus();
|
|
22995
|
+
}
|
|
22996
|
+
}
|
|
22997
|
+
else if (e.keyCode === 40) {
|
|
22998
|
+
if (emojiButtons.length - 6 > i) {
|
|
22999
|
+
const firstFocusEle = emojiButtons[i];
|
|
23000
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
23001
|
+
const focusEle = emojiButtons[focusIndex += 6];
|
|
23002
|
+
addClass([focusEle], 'e-focus');
|
|
23003
|
+
focusEle.focus();
|
|
23004
|
+
break;
|
|
23005
|
+
}
|
|
23006
|
+
}
|
|
23007
|
+
else if (e.keyCode === 39) {
|
|
23008
|
+
if (emojiButtons.length !== i + 1) {
|
|
23009
|
+
const firstFocusEle = emojiButtons[i];
|
|
23010
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
23011
|
+
const focusEle = emojiButtons[focusIndex += 1];
|
|
23012
|
+
addClass([focusEle], 'e-focus');
|
|
23013
|
+
emojiButtons[focusIndex].focus();
|
|
23014
|
+
}
|
|
23015
|
+
break;
|
|
23016
|
+
}
|
|
23017
|
+
else if (e.keyCode === 37) {
|
|
23018
|
+
if (i > 0) {
|
|
23019
|
+
const firstFocusEle = emojiButtons[i];
|
|
23020
|
+
removeClass([firstFocusEle], 'e-focus');
|
|
23021
|
+
const focusEle = emojiButtons[focusIndex -= 1];
|
|
23022
|
+
addClass([focusEle], 'e-focus');
|
|
23023
|
+
emojiButtons[focusIndex].focus();
|
|
23024
|
+
break;
|
|
23025
|
+
}
|
|
23026
|
+
}
|
|
23027
|
+
}
|
|
23028
|
+
}
|
|
23029
|
+
}
|
|
23030
|
+
}
|
|
23031
|
+
searchFilter(e, value) {
|
|
23032
|
+
const inputElement = this.parent.element.querySelector('.e-rte-emoji-search');
|
|
23033
|
+
const contentELe = this.parent.element.querySelector('.e-content');
|
|
23034
|
+
if (document.activeElement === inputElement || document.activeElement === contentELe) {
|
|
23035
|
+
let trimmedStr;
|
|
23036
|
+
if (value !== ':' && !isNullOrUndefined(value)) {
|
|
23037
|
+
trimmedStr = value.replace(/^:/, '');
|
|
23038
|
+
}
|
|
23039
|
+
else if (!isNullOrUndefined(value)) {
|
|
23040
|
+
trimmedStr = value;
|
|
23041
|
+
}
|
|
23042
|
+
const inputValue = isNullOrUndefined(inputElement) ? trimmedStr : inputElement.value;
|
|
23043
|
+
const emojiButtons = this.parent.element.querySelectorAll('.e-rte-emojipicker-btn button');
|
|
23044
|
+
const emojipickerAll = this.parent.element.querySelector('.e-rte-emojipicker-btn');
|
|
23045
|
+
const emojiGroups = this.parent.element.querySelectorAll('.e-rte-emojipicker-group');
|
|
23046
|
+
const toolbarGroup = this.parent.element.querySelector('.e-rte-emojipicker-toolbar');
|
|
23047
|
+
const excludedDiv = this.parent.element.querySelector('.e-rte-emojisearch-btn');
|
|
23048
|
+
const firstChild = this.popDiv.childNodes[0];
|
|
23049
|
+
const getComputedStyle = window.getComputedStyle(firstChild);
|
|
23050
|
+
const inputHeight = firstChild.nodeName === 'SPAN' ? (firstChild.getBoundingClientRect().height + parseFloat(getComputedStyle.marginTop) +
|
|
23051
|
+
parseFloat(getComputedStyle.marginBottom)) : 0;
|
|
23052
|
+
const popupBorder = window.getComputedStyle(this.popDiv);
|
|
23053
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
23054
|
+
const filteredButtons = isNullOrUndefined(excludedDiv) ? emojiButtons :
|
|
23055
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
23056
|
+
Array.from(emojiButtons).filter(button => !excludedDiv.contains(button));
|
|
23057
|
+
if (inputValue === '' || value === ':') {
|
|
23058
|
+
toolbarGroup.style.display = '';
|
|
23059
|
+
emojipickerAll.style.height = (this.popDiv.getBoundingClientRect().height - toolbarGroup.getBoundingClientRect().height - inputHeight - (2 * parseFloat(popupBorder.borderWidth))) + 'px';
|
|
23060
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
23061
|
+
emojiGroups.forEach(element => {
|
|
23062
|
+
element.style.display = '';
|
|
23063
|
+
});
|
|
23064
|
+
}
|
|
23065
|
+
else {
|
|
23066
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
23067
|
+
emojiGroups.forEach(element => {
|
|
23068
|
+
element.style.display = 'none';
|
|
23069
|
+
});
|
|
23070
|
+
toolbarGroup.style.display = 'none';
|
|
23071
|
+
emojipickerAll.style.height = (this.popDiv.getBoundingClientRect().height - inputHeight - (2 * parseFloat(popupBorder.borderWidth))) + 'px';
|
|
23072
|
+
}
|
|
23073
|
+
const emojiBtnDiv = this.parent.createElement('div', { className: 'e-rte-emojisearch-btn' });
|
|
23074
|
+
const emojis = this.parent.element.querySelector('.e-rte-emojisearch-btn');
|
|
23075
|
+
if (emojis) {
|
|
23076
|
+
emojis.remove();
|
|
23077
|
+
}
|
|
23078
|
+
const noEmojiObj = this.parent.createElement('div', { className: 'e-rte-emojiSearch-noEmoji' });
|
|
23079
|
+
let noEMoji = true;
|
|
23080
|
+
for (let i = 0; i < filteredButtons.length; i++) {
|
|
23081
|
+
if (!isNullOrUndefined(filteredButtons[i].getAttribute('title'))) {
|
|
23082
|
+
const title = filteredButtons[i].getAttribute('title').toLowerCase();
|
|
23083
|
+
const titleLength = title.split(' ');
|
|
23084
|
+
for (let j = 0; j < titleLength.length; j++) {
|
|
23085
|
+
if (titleLength[j].startsWith(inputValue.toLowerCase()) && inputValue !== '') {
|
|
23086
|
+
const emoji = filteredButtons[i].cloneNode(true);
|
|
23087
|
+
emojiBtnDiv.appendChild(emoji);
|
|
23088
|
+
noEMoji = false;
|
|
23089
|
+
break;
|
|
23090
|
+
}
|
|
23091
|
+
}
|
|
23092
|
+
}
|
|
23093
|
+
}
|
|
23094
|
+
if (noEMoji && !this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') && (inputValue !== '' && value !== ':')) {
|
|
23095
|
+
noEmojiObj.innerHTML = '<span style="color: rgba(0, 0, 0, 0.75); font-weight: 500; font-size: 16px;">' + this.i10n.getConstant('emojiPickerNoResultFound') + ' 😥 </span>' + '<br>' + '<span style="color: rgba(0, 0, 0, 0.75);"> ' + this.i10n.getConstant('emojiPickerTrySomethingElse') + ' ? </span>';
|
|
23096
|
+
noEmojiObj.style.margin = '55px';
|
|
23097
|
+
emojipickerAll.appendChild(noEmojiObj);
|
|
23098
|
+
}
|
|
23099
|
+
else if (!noEMoji && this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji') || (inputValue === '' && value === ':')) {
|
|
23100
|
+
emojipickerAll.removeChild(this.parent.element.querySelector('.e-rte-emojiSearch-noEmoji'));
|
|
23101
|
+
}
|
|
23102
|
+
emojipickerAll.appendChild(emojiBtnDiv);
|
|
23103
|
+
}
|
|
23104
|
+
else {
|
|
23105
|
+
return;
|
|
23106
|
+
}
|
|
23107
|
+
}
|
|
23108
|
+
emojiBtnClick(e) {
|
|
23109
|
+
const event = new MouseEvent('mouseleave', { bubbles: true, cancelable: true });
|
|
23110
|
+
// Includes the emote button element tooltip and toolbar tooltip
|
|
23111
|
+
const emotePickerTooltips = this.parent.element.querySelectorAll('.e-rte-emojipicker-popup [data-tooltip-id]');
|
|
23112
|
+
for (let i = 0; i < emotePickerTooltips.length; i++) {
|
|
23113
|
+
emotePickerTooltips[i].dispatchEvent(event);
|
|
23114
|
+
}
|
|
23115
|
+
const targetEle = e.target;
|
|
23116
|
+
if (targetEle.tagName !== 'BUTTON') {
|
|
23117
|
+
return;
|
|
23118
|
+
}
|
|
23119
|
+
targetEle.focus();
|
|
23120
|
+
if (!isNullOrUndefined(this.clickEvent)) {
|
|
23121
|
+
this.save.restore();
|
|
23122
|
+
}
|
|
23123
|
+
if (this.popupObj) {
|
|
23124
|
+
removeClass([this.divElement], 'e-active');
|
|
23125
|
+
this.popupObj.hide();
|
|
23126
|
+
}
|
|
23127
|
+
const originalEvent = e;
|
|
23128
|
+
this.parent.formatter.process(this.parent, {
|
|
23129
|
+
item: {
|
|
23130
|
+
'command': 'EmojiPicker',
|
|
23131
|
+
'subCommand': 'EmojiPicker',
|
|
23132
|
+
value: targetEle.innerHTML
|
|
23133
|
+
}
|
|
23134
|
+
}, e, originalEvent);
|
|
23135
|
+
}
|
|
23136
|
+
onkeyPress(e) {
|
|
23137
|
+
const originalEvent = e.args;
|
|
23138
|
+
const selection = window.getSelection();
|
|
23139
|
+
if (selection.rangeCount <= 0) {
|
|
23140
|
+
return;
|
|
23141
|
+
}
|
|
23142
|
+
const range = selection.getRangeAt(0);
|
|
23143
|
+
const cursorPos = range.startOffset;
|
|
23144
|
+
const prevChar = selection.focusNode.textContent.substring(cursorPos - 1, cursorPos);
|
|
23145
|
+
const isPrevSpace = /\s/.test(prevChar);
|
|
23146
|
+
const isPrevColon = selection.focusNode.textContent.substring(cursorPos - 1, cursorPos) === ':';
|
|
23147
|
+
const colon = selection.focusNode.textContent.charAt(cursorPos - 1) === ':';
|
|
23148
|
+
if (originalEvent.keyCode === 186 && originalEvent.shiftKey && (isPrevSpace || selection.focusOffset === 0)) {
|
|
23149
|
+
const coordinates = this.getCoordinates();
|
|
23150
|
+
this.parent.showEmojiPicker(coordinates.left, coordinates.top);
|
|
23151
|
+
}
|
|
23152
|
+
if (originalEvent.keyCode === 8 && colon && this.popupObj) {
|
|
23153
|
+
removeClass([this.divElement], 'e-active');
|
|
23154
|
+
this.popupObj.hide();
|
|
23155
|
+
}
|
|
23156
|
+
if (originalEvent.keyCode === 32 && isPrevColon && this.popupObj) {
|
|
23157
|
+
removeClass([this.divElement], 'e-active');
|
|
23158
|
+
this.popupObj.hide();
|
|
23159
|
+
}
|
|
23160
|
+
if (this.popupObj && (originalEvent.keyCode === 37 || originalEvent.keyCode === 38 || originalEvent.keyCode === 39
|
|
23161
|
+
|| originalEvent.keyCode === 27 || originalEvent.keyCode === 40)) {
|
|
23162
|
+
this.onKeyDown(originalEvent);
|
|
23163
|
+
originalEvent.preventDefault();
|
|
23164
|
+
}
|
|
23165
|
+
}
|
|
23166
|
+
onkeyUp(e) {
|
|
23167
|
+
const originalEvent = e.args;
|
|
23168
|
+
const selection = window.getSelection();
|
|
23169
|
+
const range = selection.getRangeAt(0);
|
|
23170
|
+
const cursorPos = range.startOffset;
|
|
23171
|
+
// eslint-disable-next-line
|
|
23172
|
+
let selectedValue;
|
|
23173
|
+
let count$$1 = 0;
|
|
23174
|
+
for (let i = cursorPos - 1; i >= cursorPos - 15; i--) {
|
|
23175
|
+
const prevChar = selection.focusNode.textContent.substring(i - 1, i);
|
|
23176
|
+
const isPrevSpace = /:$/.test(prevChar);
|
|
23177
|
+
if (isPrevSpace && !isNullOrUndefined(this.popDiv) && count$$1 === 0) {
|
|
23178
|
+
selectedValue = range.startContainer.textContent.substring(i - 1, cursorPos);
|
|
23179
|
+
this.searchFilter(originalEvent, selectedValue);
|
|
23180
|
+
count$$1 = 1;
|
|
23181
|
+
}
|
|
23182
|
+
}
|
|
23183
|
+
const colon = selection.focusNode.textContent.substring(cursorPos - 1, cursorPos);
|
|
23184
|
+
if (colon === ':' && !isNullOrUndefined(this.popupObj)) {
|
|
23185
|
+
selectedValue = colon;
|
|
23186
|
+
this.searchFilter(originalEvent, selectedValue);
|
|
23187
|
+
}
|
|
23188
|
+
}
|
|
23189
|
+
getCoordinates() {
|
|
23190
|
+
let coordinates;
|
|
23191
|
+
const selection = window.getSelection();
|
|
23192
|
+
const range = selection.getRangeAt(0);
|
|
23193
|
+
let firstChild;
|
|
23194
|
+
if (range.startContainer.nodeName === 'P' || range.startContainer.nodeName === 'DIV') {
|
|
23195
|
+
if (range.startContainer.childNodes[0].nodeName !== '#text') {
|
|
23196
|
+
firstChild = range.startContainer.childNodes[0];
|
|
23197
|
+
}
|
|
23198
|
+
}
|
|
23199
|
+
// eslint-disable-next-line
|
|
23200
|
+
const rect = isNullOrUndefined(firstChild) ? range.getBoundingClientRect() : firstChild.getBoundingClientRect();
|
|
23201
|
+
const rteContent = this.parent.element.querySelector('.e-rte-content');
|
|
23202
|
+
const rteEle = this.parent.element;
|
|
23203
|
+
const toolbarHeight = rteEle.offsetHeight - rteContent.offsetHeight;
|
|
23204
|
+
const cursorTop = rect.top - this.parent.inputElement.getBoundingClientRect().top;
|
|
23205
|
+
const cursorLeft = rect.left - this.parent.inputElement.getBoundingClientRect().left;
|
|
23206
|
+
const screenHeight = window.innerHeight;
|
|
23207
|
+
const popupHeight = 330;
|
|
23208
|
+
let popupTop = cursorTop;
|
|
23209
|
+
const popupLeft = cursorLeft + rect.width;
|
|
23210
|
+
if (rteEle.getBoundingClientRect().top < 0) {
|
|
23211
|
+
popupTop = popupTop + rteContent.getBoundingClientRect().top - toolbarHeight;
|
|
23212
|
+
}
|
|
23213
|
+
if (rect.top < popupHeight) {
|
|
23214
|
+
// eslint-disable-next-line
|
|
23215
|
+
popupTop = popupTop;
|
|
23216
|
+
}
|
|
23217
|
+
else if (rect.top + popupHeight > screenHeight) {
|
|
23218
|
+
popupTop -= popupHeight + 20;
|
|
23219
|
+
}
|
|
23220
|
+
if (this.parent.inputElement) {
|
|
23221
|
+
coordinates = {
|
|
23222
|
+
top: popupTop + 60,
|
|
23223
|
+
left: popupLeft + 8
|
|
23224
|
+
};
|
|
23225
|
+
}
|
|
23226
|
+
return coordinates;
|
|
23227
|
+
}
|
|
23228
|
+
removeEventListener() {
|
|
23229
|
+
if (this.parent.isDestroyed) {
|
|
23230
|
+
return;
|
|
23231
|
+
}
|
|
23232
|
+
this.parent.off(emojiPicker, this.toolbarClick);
|
|
23233
|
+
this.parent.off(docClick, this.docClick);
|
|
23234
|
+
this.parent.off(keyDown, this.onkeyPress);
|
|
23235
|
+
this.parent.off(keyUp, this.onkeyUp);
|
|
23236
|
+
this.parent.off(contentscroll, this.contentscroll);
|
|
23237
|
+
this.parent.off(scroll, this.contentscroll);
|
|
23238
|
+
}
|
|
23239
|
+
/**
|
|
23240
|
+
* For internal use only - Get the module name.
|
|
23241
|
+
*
|
|
23242
|
+
* @returns {string} - returns the string value
|
|
23243
|
+
*/
|
|
23244
|
+
getModuleName() {
|
|
23245
|
+
return 'emojiPicker';
|
|
23246
|
+
}
|
|
23247
|
+
}
|
|
23248
|
+
|
|
21928
23249
|
/**
|
|
21929
23250
|
* Action export
|
|
21930
23251
|
*/
|
|
@@ -22701,15 +24022,20 @@ class Image {
|
|
|
22701
24022
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
22702
24023
|
for (let i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
22703
24024
|
const temp = this.parent.createElement('div');
|
|
22704
|
-
const contentElem =
|
|
22705
|
-
temp.appendChild(contentElem);
|
|
24025
|
+
const contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
24026
|
+
temp.appendChild(contentElem.cloneNode(true));
|
|
22706
24027
|
const img = temp.querySelectorAll('img');
|
|
22707
24028
|
if (temp.querySelector('.e-img-resize') && img.length > 0) {
|
|
22708
24029
|
for (let j = 0; j < img.length; j++) {
|
|
22709
24030
|
img[j].style.outline = '';
|
|
22710
24031
|
}
|
|
22711
24032
|
detach(temp.querySelector('.e-img-resize'));
|
|
22712
|
-
|
|
24033
|
+
const clonedElement = temp.cloneNode(true);
|
|
24034
|
+
const fragment = document.createDocumentFragment();
|
|
24035
|
+
while (clonedElement.firstChild) {
|
|
24036
|
+
fragment.appendChild(clonedElement.firstChild);
|
|
24037
|
+
}
|
|
24038
|
+
this.parent.formatter.getUndoRedoStack()[i].text = fragment;
|
|
22713
24039
|
}
|
|
22714
24040
|
}
|
|
22715
24041
|
}
|
|
@@ -22901,7 +24227,7 @@ class Image {
|
|
|
22901
24227
|
if (isNullOrUndefined(img.width)) {
|
|
22902
24228
|
return;
|
|
22903
24229
|
}
|
|
22904
|
-
// eslint-disable-next-line
|
|
24230
|
+
// eslint-disable-next-line security/detect-unsafe-regex
|
|
22905
24231
|
const width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
|
|
22906
24232
|
parseInt(img.style.width, 10) : img.width;
|
|
22907
24233
|
const height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
|
|
@@ -23179,7 +24505,7 @@ class Image {
|
|
|
23179
24505
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
23180
24506
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
23181
24507
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
23182
|
-
(selectParentEle[0].tagName === 'IMG') && selectParentEle[0].parentElement) {
|
|
24508
|
+
(!isNullOrUndefined(selectParentEle[0]) && selectParentEle[0].tagName === 'IMG') && selectParentEle[0].parentElement) {
|
|
23183
24509
|
const prev = selectParentEle[0].parentElement.childNodes[0];
|
|
23184
24510
|
if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
23185
24511
|
this.removeResizeEle();
|
|
@@ -23824,7 +25150,7 @@ class Image {
|
|
|
23824
25150
|
const dialogContent = this.imgsizeInput(e);
|
|
23825
25151
|
const selectObj = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
|
|
23826
25152
|
this.dialogObj.setProperties({
|
|
23827
|
-
height: 'inherit', width: '290px', header: imgSizeHeader, content: dialogContent, position: { X: 'center', Y: 'center' },
|
|
25153
|
+
height: (Browser.isDevice) ? '300px' : 'inherit', width: '290px', header: imgSizeHeader, content: dialogContent, position: { X: 'center', Y: 'center' },
|
|
23828
25154
|
buttons: [{
|
|
23829
25155
|
// eslint-disable-next-line
|
|
23830
25156
|
click: (e) => {
|
|
@@ -24958,8 +26284,8 @@ class Audio {
|
|
|
24958
26284
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
24959
26285
|
for (let i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
24960
26286
|
const temp = this.parent.createElement('div');
|
|
24961
|
-
const contentElem =
|
|
24962
|
-
temp.appendChild(contentElem);
|
|
26287
|
+
const contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
26288
|
+
temp.appendChild(contentElem.cloneNode(true));
|
|
24963
26289
|
}
|
|
24964
26290
|
}
|
|
24965
26291
|
}
|
|
@@ -25840,15 +27166,20 @@ class Video {
|
|
|
25840
27166
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
25841
27167
|
for (let i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
25842
27168
|
const temp = this.parent.createElement('div');
|
|
25843
|
-
const contentElem =
|
|
25844
|
-
temp.appendChild(contentElem);
|
|
27169
|
+
const contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
27170
|
+
temp.appendChild(contentElem.cloneNode(true));
|
|
25845
27171
|
const vid = temp.querySelectorAll('video');
|
|
25846
27172
|
if (temp.querySelector('.e-vid-resize') && vid.length > 0) {
|
|
25847
27173
|
for (let j = 0; j < vid.length; j++) {
|
|
25848
27174
|
vid[j].style.outline = '';
|
|
25849
27175
|
}
|
|
25850
27176
|
detach(temp.querySelector('.e-vid-resize'));
|
|
25851
|
-
|
|
27177
|
+
const clonedElement = temp.cloneNode(true);
|
|
27178
|
+
const fragment = document.createDocumentFragment();
|
|
27179
|
+
while (clonedElement.firstChild) {
|
|
27180
|
+
fragment.appendChild(clonedElement.firstChild);
|
|
27181
|
+
}
|
|
27182
|
+
this.parent.formatter.getUndoRedoStack()[i].text = fragment;
|
|
25852
27183
|
}
|
|
25853
27184
|
}
|
|
25854
27185
|
}
|
|
@@ -26141,8 +27472,8 @@ class Video {
|
|
|
26141
27472
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
26142
27473
|
const height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
26143
27474
|
if (width > height) {
|
|
26144
|
-
vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '
|
|
26145
|
-
vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '
|
|
27475
|
+
vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '200px' : formatUnit(this.parent.insertVideoSettings.minWidth);
|
|
27476
|
+
vid.style.minHeight = this.parent.insertVideoSettings.minHeight === 0 ? '90px' : formatUnit(this.parent.insertVideoSettings.minHeight);
|
|
26146
27477
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
26147
27478
|
if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
|
|
26148
27479
|
const percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
|
|
@@ -26337,7 +27668,7 @@ class Video {
|
|
|
26337
27668
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
26338
27669
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
26339
27670
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
26340
|
-
((selectParentEle[0].tagName === 'VIDEO' || this.isEmbedVidElem(selectParentEle[0]))) &&
|
|
27671
|
+
((!isNullOrUndefined(selectParentEle[0]) && selectParentEle[0].tagName === 'VIDEO' || this.isEmbedVidElem(selectParentEle[0]))) &&
|
|
26341
27672
|
selectParentEle[0].parentElement) {
|
|
26342
27673
|
const prev = selectParentEle[0].parentElement.childNodes[0];
|
|
26343
27674
|
if (this.contentModule.getEditPanel().querySelector('.e-vid-resize')) {
|
|
@@ -26850,7 +28181,7 @@ class Video {
|
|
|
26850
28181
|
videoUrl.appendChild(urlContent);
|
|
26851
28182
|
this.embedInputUrl = this.parent.createElement('textarea', {
|
|
26852
28183
|
className: 'e-input e-embed-video-url',
|
|
26853
|
-
attrs: { placeholder: '
|
|
28184
|
+
attrs: { placeholder: this.i10n.getConstant('pasteEmbeddedCodeHere'), type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
|
|
26854
28185
|
});
|
|
26855
28186
|
this.embedInputUrl.addEventListener('keyup', () => {
|
|
26856
28187
|
if (!isNullOrUndefined(this.embedInputUrl)) {
|
|
@@ -26877,7 +28208,7 @@ class Video {
|
|
|
26877
28208
|
}
|
|
26878
28209
|
});
|
|
26879
28210
|
const embedUrlBtn = new RadioButton({
|
|
26880
|
-
label: '
|
|
28211
|
+
label: this.i10n.getConstant('embeddedCode'),
|
|
26881
28212
|
checked: true,
|
|
26882
28213
|
name: 'URL',
|
|
26883
28214
|
created: () => {
|
|
@@ -26891,7 +28222,7 @@ class Video {
|
|
|
26891
28222
|
});
|
|
26892
28223
|
embedUrlBtn.appendTo(videoUrl.querySelector('#embedURL'));
|
|
26893
28224
|
const webUrlBtn = new RadioButton({
|
|
26894
|
-
label: '
|
|
28225
|
+
label: this.i10n.getConstant('webUrl'),
|
|
26895
28226
|
name: 'URL',
|
|
26896
28227
|
change: () => {
|
|
26897
28228
|
urlContent.innerHTML = '';
|
|
@@ -29278,6 +30609,9 @@ __decorate$2([
|
|
|
29278
30609
|
*/
|
|
29279
30610
|
class FileManagerSettings extends ChildProperty {
|
|
29280
30611
|
}
|
|
30612
|
+
__decorate$2([
|
|
30613
|
+
Event()
|
|
30614
|
+
], FileManagerSettings.prototype, "beforeSend", void 0);
|
|
29281
30615
|
__decorate$2([
|
|
29282
30616
|
Complex({ getImageUrl: null, url: null, uploadUrl: null }, AjaxSettings)
|
|
29283
30617
|
], FileManagerSettings.prototype, "ajaxSettings", void 0);
|
|
@@ -29384,14 +30718,22 @@ __decorate$2([
|
|
|
29384
30718
|
class FormatPainterSettings extends ChildProperty {
|
|
29385
30719
|
}
|
|
29386
30720
|
__decorate$2([
|
|
29387
|
-
Property(
|
|
29388
|
-
], FormatPainterSettings.prototype, "allowedContext", void 0);
|
|
29389
|
-
__decorate$2([
|
|
29390
|
-
Property('b; em; font; sub; sup; kbd; i; s; u; code; strong; span; p; div; h1; h2; h3; h4; h5; h6; blockquote; table; thead; tbody; tr; td; th; ol; ul; li; pre;')
|
|
30721
|
+
Property('b; em; font; sub; sup; kbd; i; s; u; code; strong; span; p; div; h1; h2; h3; h4; h5; h6; blockquote; ol; ul; li; pre;')
|
|
29391
30722
|
], FormatPainterSettings.prototype, "allowedFormats", void 0);
|
|
29392
30723
|
__decorate$2([
|
|
29393
30724
|
Property(null)
|
|
29394
30725
|
], FormatPainterSettings.prototype, "deniedFormats", void 0);
|
|
30726
|
+
/**
|
|
30727
|
+
* Specifies the emoji picker options in Rich Text Editor with the following properties.
|
|
30728
|
+
*/
|
|
30729
|
+
class EmojiSettings extends ChildProperty {
|
|
30730
|
+
}
|
|
30731
|
+
__decorate$2([
|
|
30732
|
+
Property(defaultEmojiIcons)
|
|
30733
|
+
], EmojiSettings.prototype, "iconsSet", void 0);
|
|
30734
|
+
__decorate$2([
|
|
30735
|
+
Property(true)
|
|
30736
|
+
], EmojiSettings.prototype, "showSearchBox", void 0);
|
|
29395
30737
|
/**
|
|
29396
30738
|
* Configures the Paste Cleanup settings of the RichTextEditor.
|
|
29397
30739
|
*/
|
|
@@ -29609,7 +30951,7 @@ class EnterKeyAction {
|
|
|
29609
30951
|
}
|
|
29610
30952
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
29611
30953
|
}
|
|
29612
|
-
if (e.args.which === 13 && e.args.code === 'Enter') {
|
|
30954
|
+
if (e.args.which === 13 && (!Browser.isDevice ? e.args.code === 'Enter' : e.args.key === 'Enter')) {
|
|
29613
30955
|
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
|
|
29614
30956
|
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
29615
30957
|
const shiftKey = e.args.shiftKey;
|
|
@@ -29715,7 +31057,7 @@ class EnterKeyAction {
|
|
|
29715
31057
|
let isFocusedFirst = false;
|
|
29716
31058
|
if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
|
|
29717
31059
|
this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
29718
|
-
&& nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
31060
|
+
&& (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
29719
31061
|
const startNodeText = this.range.startContainer.textContent;
|
|
29720
31062
|
const splitFirstText = startNodeText.substring(0, this.range.startOffset);
|
|
29721
31063
|
// eslint-disable-next-line max-len
|
|
@@ -30110,6 +31452,10 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30110
31452
|
member: 'formatPainter',
|
|
30111
31453
|
args: [this]
|
|
30112
31454
|
});
|
|
31455
|
+
modules.push({
|
|
31456
|
+
member: 'emojiPicker',
|
|
31457
|
+
args: [this, this.serviceLocator]
|
|
31458
|
+
});
|
|
30113
31459
|
}
|
|
30114
31460
|
if (this.fileManagerSettings.enable) {
|
|
30115
31461
|
modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
|
|
@@ -30309,6 +31655,20 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30309
31655
|
});
|
|
30310
31656
|
return str;
|
|
30311
31657
|
}
|
|
31658
|
+
/**
|
|
31659
|
+
* Shows the emoji picker
|
|
31660
|
+
*
|
|
31661
|
+
* @param {number} x - specifies the number value.
|
|
31662
|
+
* @param {number} y - specifies the number value.
|
|
31663
|
+
* @returns {void}
|
|
31664
|
+
* @public
|
|
31665
|
+
*/
|
|
31666
|
+
showEmojiPicker(x, y) {
|
|
31667
|
+
if (this.readonly) {
|
|
31668
|
+
return;
|
|
31669
|
+
}
|
|
31670
|
+
this.notify(emojiPicker, { x, y });
|
|
31671
|
+
}
|
|
30312
31672
|
/**
|
|
30313
31673
|
* Executes the commands
|
|
30314
31674
|
*
|
|
@@ -30544,7 +31904,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30544
31904
|
this.valueContainer.defaultValue = this.value;
|
|
30545
31905
|
}
|
|
30546
31906
|
// eslint-disable-next-line
|
|
30547
|
-
(!this.
|
|
31907
|
+
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
30548
31908
|
this.notify(bindCssClass, { cssClass: this.cssClass });
|
|
30549
31909
|
this.addAudioVideoWrapper();
|
|
30550
31910
|
this.notify(tableclass, {});
|
|
@@ -30629,6 +31989,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30629
31989
|
const currentEndContainer = range.endContainer;
|
|
30630
31990
|
const currentStartOffset = range.startOffset;
|
|
30631
31991
|
const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
|
|
31992
|
+
// eslint-disable-next-line
|
|
30632
31993
|
const currentEndOffset = currentEndContainer.textContent.length;
|
|
30633
31994
|
const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
30634
31995
|
range.endContainer;
|
|
@@ -30711,7 +32072,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30711
32072
|
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), range.startContainer, range.startOffset);
|
|
30712
32073
|
}
|
|
30713
32074
|
}
|
|
30714
|
-
|
|
32075
|
+
const notFormatPainterCopy = !isNullOrUndefined(e.action) && e.action !== 'format-copy';
|
|
32076
|
+
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy) {
|
|
30715
32077
|
this.formatter.saveData();
|
|
30716
32078
|
}
|
|
30717
32079
|
if (e.action !== 'insert-link' &&
|
|
@@ -30743,8 +32105,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30743
32105
|
if ((!isNullOrUndefined(this.placeHolderWrapper)) && (this.inputElement.textContent.length !== 1)) {
|
|
30744
32106
|
this.placeHolderWrapper.style.display = 'none';
|
|
30745
32107
|
}
|
|
30746
|
-
else if (this.iframeSettings.enable && this.inputElement.classList.contains(
|
|
30747
|
-
removeClass([this.inputElement],
|
|
32108
|
+
else if (this.iframeSettings.enable && this.inputElement.classList.contains('e-rte-placeholder')) {
|
|
32109
|
+
removeClass([this.inputElement], 'e-rte-placeholder');
|
|
30748
32110
|
}
|
|
30749
32111
|
else {
|
|
30750
32112
|
this.setPlaceHolder();
|
|
@@ -30773,7 +32135,9 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30773
32135
|
this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
|
|
30774
32136
|
}
|
|
30775
32137
|
const allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
|
|
30776
|
-
|
|
32138
|
+
const formatPainterCopy = e.key === 'C' && e.altKey && e.shiftKey;
|
|
32139
|
+
const formatPainterPaste = e.key === 'V' && e.altKey && e.shiftKey;
|
|
32140
|
+
if ((!formatPainterCopy && !formatPainterPaste) && ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys) || (this.editorMode === 'Markdown'
|
|
30777
32141
|
&& ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) && !this.inlineMode.enable) {
|
|
30778
32142
|
this.formatter.onKeyHandler(this, e);
|
|
30779
32143
|
}
|
|
@@ -31322,6 +32686,9 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
31322
32686
|
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
31323
32687
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
31324
32688
|
break;
|
|
32689
|
+
case 'formatPainterSettings':
|
|
32690
|
+
this.formatter.editorManager.observer.notify(MODEL_CHANGED, { module: 'formatPainter', newProp: newProp });
|
|
32691
|
+
break;
|
|
31325
32692
|
default:
|
|
31326
32693
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
31327
32694
|
break;
|
|
@@ -31451,11 +32818,11 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
31451
32818
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
31452
32819
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
31453
32820
|
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
31454
|
-
addClass([this.inputElement],
|
|
32821
|
+
addClass([this.inputElement], 'e-rte-placeholder');
|
|
31455
32822
|
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
31456
32823
|
}
|
|
31457
32824
|
else {
|
|
31458
|
-
removeClass([this.inputElement],
|
|
32825
|
+
removeClass([this.inputElement], 'e-rte-placeholder');
|
|
31459
32826
|
}
|
|
31460
32827
|
}
|
|
31461
32828
|
}
|
|
@@ -31683,7 +33050,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
31683
33050
|
setValue(isPropertyChange) {
|
|
31684
33051
|
if (this.valueTemplate) {
|
|
31685
33052
|
const regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
31686
|
-
if (regEx.test(this.valueTemplate)) {
|
|
33053
|
+
if (typeof this.valueTemplate === 'string' && regEx.test(this.valueTemplate)) {
|
|
31687
33054
|
this.setProperties({ value: this.valueTemplate });
|
|
31688
33055
|
}
|
|
31689
33056
|
else {
|
|
@@ -32182,7 +33549,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
32182
33549
|
this.timeInterval = null;
|
|
32183
33550
|
}
|
|
32184
33551
|
if (!isNullOrUndefined(this.placeHolderWrapper) && this.element.querySelector('[title = Preview]')) {
|
|
32185
|
-
this.placeHolderWrapper.style.display =
|
|
33552
|
+
this.placeHolderWrapper.style.display = 'none';
|
|
32186
33553
|
}
|
|
32187
33554
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
32188
33555
|
}
|
|
@@ -32240,7 +33607,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
32240
33607
|
EventHandler.add(element, 'scroll', this.scrollHandler, this);
|
|
32241
33608
|
}
|
|
32242
33609
|
if (!this.iframeSettings.enable) {
|
|
32243
|
-
|
|
33610
|
+
// Add the scroll event handler from the inputElement
|
|
33611
|
+
EventHandler.add(this.inputElement, 'scroll', this.contentScrollHandler, this);
|
|
32244
33612
|
}
|
|
32245
33613
|
}
|
|
32246
33614
|
wireContextEvent() {
|
|
@@ -32268,7 +33636,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
32268
33636
|
EventHandler.remove(element, 'scroll', this.scrollHandler);
|
|
32269
33637
|
}
|
|
32270
33638
|
if (!this.iframeSettings.enable) {
|
|
32271
|
-
|
|
33639
|
+
// Remove the scroll event handler from the inputElement
|
|
33640
|
+
EventHandler.remove(this.inputElement, 'scroll', this.contentScrollHandler);
|
|
32272
33641
|
}
|
|
32273
33642
|
}
|
|
32274
33643
|
touchHandler(e) {
|
|
@@ -32451,6 +33820,9 @@ __decorate$1([
|
|
|
32451
33820
|
__decorate$1([
|
|
32452
33821
|
Complex({}, FormatPainterSettings)
|
|
32453
33822
|
], RichTextEditor.prototype, "formatPainterSettings", void 0);
|
|
33823
|
+
__decorate$1([
|
|
33824
|
+
Complex({}, EmojiSettings)
|
|
33825
|
+
], RichTextEditor.prototype, "emojiPickerSettings", void 0);
|
|
32454
33826
|
__decorate$1([
|
|
32455
33827
|
Complex({}, IFrameSettings)
|
|
32456
33828
|
], RichTextEditor.prototype, "iframeSettings", void 0);
|
|
@@ -32738,5 +34110,5 @@ RichTextEditor = __decorate$1([
|
|
|
32738
34110
|
* Rich Text Editor component exported items
|
|
32739
34111
|
*/
|
|
32740
34112
|
|
|
32741
|
-
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS };
|
|
34113
|
+
export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, FormatPainter, EmojiPicker, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image, Audio, Video, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, tableclass, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, tableModulekeyUp, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, audioToolbarAction, videoToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertAudio, insertVideo, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, audioDelete, videoDelete, imageCaption, imageSize, videoSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, fileSelected, fileUploading, fileUploadSuccess, fileUploadFailed, fileRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeFileUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, showAudioDialog, showVideoDialog, closeImageDialog, closeAudioDialog, closeVideoDialog, showTableDialog, closeTableDialog, bindCssClass, formatPainterClick, formatPainterDoubleClick, emojiPicker, maximizeMinimizeClick, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_AUDIOBREAK, CLS_CLICKELEM, CLS_VID_CLICK_ELEM, CLS_AUDIOWRAP, CLS_VIDEOWRAP, CLS_VIDEOBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_AUDIOINLINE, CLS_VIDEOINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_AUD_FOCUS, CLS_VID_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, AUDIO, VIDEO, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_VIDEO_RIGHT, CLASS_VIDEO_LEFT, CLASS_VIDEO_CENTER, CLASS_IMAGE_BREAK, CLASS_AUDIO_BREAK, CLASS_VIDEO_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, CLASS_AUDIO_INLINE, CLASS_CLICK_ELEM, CLASS_VIDEO_CLICK_ELEM, CLASS_AUDIO, CLASS_VIDEO, CLASS_AUDIO_WRAP, CLASS_VIDEO_WRAP, CLASS_EMBED_VIDEO_WRAP, CLASS_AUDIO_FOCUS, CLASS_VIDEO_FOCUS, CLASS_VIDEO_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, AudioCommand, VideoCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, FormatPainterActions, EmojiPickerAction, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION, FORMAT_PAINTER_ACTIONS, EMOJI_PICKER_ACTIONS };
|
|
32742
34114
|
//# sourceMappingURL=ej2-richtexteditor.es2015.js.map
|