@syncfusion/ej2-richtexteditor 21.2.9 → 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 +30 -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 +1592 -196
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +1605 -199
- 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 +66 -14
- 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 +10 -3
- 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 +17 -3
- 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 +48 -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,12 +6101,13 @@ 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);
|
|
5891
6108
|
}
|
|
5892
|
-
this.popupObj.position.X =
|
|
5893
|
-
this.popupObj.position.Y =
|
|
6109
|
+
this.popupObj.position.X = beforeQuickToolbarArgs.positionX + 20;
|
|
6110
|
+
this.popupObj.position.Y = beforeQuickToolbarArgs.positionY + 20;
|
|
5894
6111
|
this.popupObj.dataBind();
|
|
5895
6112
|
this.popupObj.element.classList.add('e-popup-open');
|
|
5896
6113
|
this.dropDownButtons.renderDropDowns({
|
|
@@ -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
|
}
|
|
@@ -17143,7 +17461,7 @@ class MsWordPaste {
|
|
|
17143
17461
|
imgElem[i].getAttribute('v:shapes').indexOf('Picture') < 0 &&
|
|
17144
17462
|
imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
|
|
17145
17463
|
imgElem[i].getAttribute('v:shapes').indexOf('Grafik') < 0 &&
|
|
17146
|
-
imgElem[i].getAttribute('v:shapes').indexOf('
|
|
17464
|
+
imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
|
|
17147
17465
|
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0) {
|
|
17148
17466
|
detach(imgElem[i]);
|
|
17149
17467
|
}
|
|
@@ -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;
|
|
@@ -17726,12 +18048,31 @@ class MsWordPaste {
|
|
|
17726
18048
|
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
17727
18049
|
}
|
|
17728
18050
|
else {
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
18051
|
+
if (collection[index].nestedLevel > pLevel && isNormalList) {
|
|
18052
|
+
let initialNode;
|
|
18053
|
+
initialNode = createElement(collection[index].listType);
|
|
18054
|
+
prevList = createElement('li');
|
|
18055
|
+
initialNode.appendChild(prevList);
|
|
18056
|
+
initialNode.style.listStyleType = 'none';
|
|
18057
|
+
for (let j = 0; j < collection[index].nestedLevel - 1; j++) {
|
|
18058
|
+
prevList.appendChild(temp = createElement(collection[index].listType));
|
|
18059
|
+
prevList = createElement('li');
|
|
18060
|
+
temp.appendChild(prevList);
|
|
18061
|
+
temp.style.listStyleType = 'none';
|
|
18062
|
+
}
|
|
18063
|
+
prevList.appendChild(pElement);
|
|
18064
|
+
root.appendChild(initialNode);
|
|
18065
|
+
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
18066
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
18067
|
+
}
|
|
18068
|
+
else {
|
|
18069
|
+
root.appendChild(temp = createElement(collection[index].listType));
|
|
18070
|
+
prevList = createElement('li');
|
|
18071
|
+
prevList.appendChild(pElement);
|
|
18072
|
+
temp.appendChild(prevList);
|
|
18073
|
+
temp.setAttribute('level', collection[index].nestedLevel.toString());
|
|
18074
|
+
temp.style.listStyleType = collection[index].listStyleTypeName;
|
|
18075
|
+
}
|
|
17735
18076
|
}
|
|
17736
18077
|
}
|
|
17737
18078
|
else if (collection[index].nestedLevel === 1) {
|
|
@@ -17796,7 +18137,7 @@ class MsWordPaste {
|
|
|
17796
18137
|
else {
|
|
17797
18138
|
//Add to support separate list which looks like same list and also to add all tags as it is inside list
|
|
17798
18139
|
if (firstChild.childNodes.length > 0) {
|
|
17799
|
-
|
|
18140
|
+
const listOrder = firstChild.querySelector('span[style="mso-list:Ignore"]');
|
|
17800
18141
|
if (!isNullOrUndefined(listOrder)) {
|
|
17801
18142
|
this.listContents.push(listOrder.textContent.trim());
|
|
17802
18143
|
detach(listOrder);
|
|
@@ -18174,6 +18515,9 @@ class ToolbarStatus {
|
|
|
18174
18515
|
else if (list === 'none') {
|
|
18175
18516
|
return 'None';
|
|
18176
18517
|
}
|
|
18518
|
+
else if (this.isOrderedList(node)) {
|
|
18519
|
+
return true;
|
|
18520
|
+
}
|
|
18177
18521
|
else {
|
|
18178
18522
|
return null;
|
|
18179
18523
|
}
|
|
@@ -18192,18 +18536,81 @@ class ToolbarStatus {
|
|
|
18192
18536
|
else if (list === 'disc') {
|
|
18193
18537
|
return 'Disc';
|
|
18194
18538
|
}
|
|
18539
|
+
else if (this.isUnorderedList(node)) {
|
|
18540
|
+
return true;
|
|
18541
|
+
}
|
|
18195
18542
|
else {
|
|
18196
18543
|
return null;
|
|
18197
18544
|
}
|
|
18198
18545
|
}
|
|
18199
18546
|
}
|
|
18200
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
|
+
|
|
18201
18607
|
/**
|
|
18202
18608
|
* Base export
|
|
18203
18609
|
*/
|
|
18204
18610
|
|
|
18205
18611
|
class FormatPainterActions {
|
|
18206
18612
|
constructor(parent, options) {
|
|
18613
|
+
this.INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
18207
18614
|
this.parent = parent;
|
|
18208
18615
|
this.settings = options;
|
|
18209
18616
|
this.addEventListener();
|
|
@@ -18211,8 +18618,43 @@ class FormatPainterActions {
|
|
|
18211
18618
|
}
|
|
18212
18619
|
addEventListener() {
|
|
18213
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;
|
|
18214
18655
|
}
|
|
18215
18656
|
actionHandler(args) {
|
|
18657
|
+
this.settings.allowedContext = ['Text', 'List', 'Table'];
|
|
18216
18658
|
if (!isNullOrUndefined(args) && !isNullOrUndefined(args.item) && !isNullOrUndefined(args.item.formatPainterAction)) {
|
|
18217
18659
|
switch (args.item.formatPainterAction) {
|
|
18218
18660
|
case 'format-copy':
|
|
@@ -18225,6 +18667,19 @@ class FormatPainterActions {
|
|
|
18225
18667
|
this.escapeAction();
|
|
18226
18668
|
break;
|
|
18227
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
|
+
});
|
|
18228
18683
|
}
|
|
18229
18684
|
}
|
|
18230
18685
|
generateElement() {
|
|
@@ -18279,7 +18734,6 @@ class FormatPainterActions {
|
|
|
18279
18734
|
return;
|
|
18280
18735
|
}
|
|
18281
18736
|
this.insertFormatNode(this.newElem, this.newElemLastChild);
|
|
18282
|
-
this.parent.undoRedoManager.saveData();
|
|
18283
18737
|
}
|
|
18284
18738
|
removeDeniedFormats(parentElement) {
|
|
18285
18739
|
if (!isNullOrUndefined(this.deniedFormatsCollection) && this.deniedFormatsCollection.length > 0) {
|
|
@@ -18328,13 +18782,23 @@ class FormatPainterActions {
|
|
|
18328
18782
|
copyAction() {
|
|
18329
18783
|
const copyCollection = [];
|
|
18330
18784
|
const range = this.parent.nodeSelection.getRange(document);
|
|
18331
|
-
|
|
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;
|
|
18332
18795
|
let currentContext = this.findCurrentContext(parentElem);
|
|
18333
|
-
const allowedRulesArray = this.settings.allowedFormats.split(';')
|
|
18796
|
+
const allowedRulesArray = this.settings.allowedFormats.indexOf(';') > -1 ? this.settings.allowedFormats.split(';') :
|
|
18797
|
+
[this.settings.allowedFormats];
|
|
18334
18798
|
for (let i = 0; i < allowedRulesArray.length; i++) {
|
|
18335
18799
|
allowedRulesArray[i] = allowedRulesArray[i].trim();
|
|
18336
18800
|
}
|
|
18337
|
-
const [rangeParentElem, context] = this.getRangeParentElem(currentContext,
|
|
18801
|
+
const [rangeParentElem, context] = this.getRangeParentElem(currentContext, parentElem);
|
|
18338
18802
|
if (currentContext === null) {
|
|
18339
18803
|
currentContext = context;
|
|
18340
18804
|
}
|
|
@@ -18379,8 +18843,8 @@ class FormatPainterActions {
|
|
|
18379
18843
|
}
|
|
18380
18844
|
this.generateElement();
|
|
18381
18845
|
}
|
|
18382
|
-
getRangeParentElem(currentContext,
|
|
18383
|
-
let startContainer =
|
|
18846
|
+
getRangeParentElem(currentContext, rangeParent) {
|
|
18847
|
+
let startContainer = rangeParent;
|
|
18384
18848
|
let rangeParentELem;
|
|
18385
18849
|
if (startContainer.nodeType === 3) {
|
|
18386
18850
|
startContainer = startContainer.parentElement;
|
|
@@ -18400,7 +18864,7 @@ class FormatPainterActions {
|
|
|
18400
18864
|
break;
|
|
18401
18865
|
}
|
|
18402
18866
|
if (isNullOrUndefined(rangeParentELem)) {
|
|
18403
|
-
const nearBlockParentName = this.getNearestBlockParentElement(
|
|
18867
|
+
const nearBlockParentName = this.getNearestBlockParentElement(rangeParent);
|
|
18404
18868
|
if (!isNullOrUndefined(nearBlockParentName) && nearBlockParentName !== 'UL' &&
|
|
18405
18869
|
nearBlockParentName !== 'OL' && nearBlockParentName !== 'LI') {
|
|
18406
18870
|
rangeParentELem = closest(startContainer, nearBlockParentName);
|
|
@@ -18412,8 +18876,8 @@ class FormatPainterActions {
|
|
|
18412
18876
|
}
|
|
18413
18877
|
return [rangeParentELem, currentContext];
|
|
18414
18878
|
}
|
|
18415
|
-
getNearestBlockParentElement(
|
|
18416
|
-
let node =
|
|
18879
|
+
getNearestBlockParentElement(rangeParent) {
|
|
18880
|
+
let node = rangeParent;
|
|
18417
18881
|
if (node.nodeType === 3) {
|
|
18418
18882
|
node = node.parentNode;
|
|
18419
18883
|
}
|
|
@@ -18456,29 +18920,32 @@ class FormatPainterActions {
|
|
|
18456
18920
|
}
|
|
18457
18921
|
}
|
|
18458
18922
|
validateELementTag(node) {
|
|
18459
|
-
const INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
18460
18923
|
if (node.nodeType === 3) {
|
|
18461
18924
|
node = node.parentElement;
|
|
18462
18925
|
}
|
|
18463
|
-
return INVALID_TAGS.indexOf(node.tagName) > -1;
|
|
18926
|
+
return this.INVALID_TAGS.indexOf(node.tagName) > -1;
|
|
18464
18927
|
}
|
|
18465
18928
|
findCurrentContext(parentElem) {
|
|
18466
|
-
if (closest(parentElem, '
|
|
18467
|
-
return '
|
|
18929
|
+
if (closest(parentElem, 'p')) {
|
|
18930
|
+
return 'Text';
|
|
18468
18931
|
}
|
|
18469
18932
|
else if (closest(parentElem, 'li')) {
|
|
18470
18933
|
return 'List';
|
|
18471
18934
|
}
|
|
18472
|
-
else if (closest(parentElem, '
|
|
18473
|
-
return '
|
|
18935
|
+
else if (closest(parentElem, 'td') || closest(parentElem, 'tr') || closest(parentElem, 'th')) {
|
|
18936
|
+
return 'Table';
|
|
18474
18937
|
}
|
|
18475
18938
|
return null;
|
|
18476
18939
|
}
|
|
18477
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
|
+
}
|
|
18478
18947
|
const endNode = this.parent.editableElement;
|
|
18479
18948
|
const docElement = this.parent.currentDocument;
|
|
18480
|
-
const domSelection = this.parent.nodeSelection;
|
|
18481
|
-
const clonedElem = elem.cloneNode(true);
|
|
18482
18949
|
let childElem = clonedElem.firstChild;
|
|
18483
18950
|
let inlineElement;
|
|
18484
18951
|
while (childElem) {
|
|
@@ -18495,80 +18962,70 @@ class FormatPainterActions {
|
|
|
18495
18962
|
lastChild: lastChild
|
|
18496
18963
|
};
|
|
18497
18964
|
SelectionCommands.applyFormat(docElement, null, endNode, 'P', 'formatPainter', null, formatValues);
|
|
18498
|
-
let isFullNodeSelected;
|
|
18499
18965
|
const range = this.parent.nodeSelection.getRange(docElement);
|
|
18500
18966
|
const isCollapsed = range.collapsed;
|
|
18501
|
-
const
|
|
18502
|
-
|
|
18503
|
-
if (
|
|
18504
|
-
|
|
18505
|
-
nodes[0] = nodes[0].parentElement;
|
|
18506
|
-
}
|
|
18507
|
-
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();
|
|
18508
18971
|
}
|
|
18509
|
-
if (this.isBlockElement(
|
|
18510
|
-
this.insertBlockNode(
|
|
18972
|
+
if (this.isBlockElement(clonedElem) && isCollapsed || blockNodes.length > 1 || isFullNodeSelected) {
|
|
18973
|
+
this.insertBlockNode(clonedElem, range, docElement, blockNodes);
|
|
18511
18974
|
}
|
|
18512
18975
|
}
|
|
18513
|
-
insertBlockNode(element, range, docElement,
|
|
18976
|
+
insertBlockNode(element, range, docElement, nodes) {
|
|
18514
18977
|
const domSelection = this.parent.nodeSelection;
|
|
18978
|
+
const saveSelection = domSelection.save(range, docElement);
|
|
18979
|
+
this.parent.domNode.setMarker(saveSelection);
|
|
18515
18980
|
let listElement; // To clone to multiple list elements
|
|
18516
18981
|
let cloneListParentNode;
|
|
18982
|
+
let sameListType = false;
|
|
18517
18983
|
if (element.nodeName === 'UL' || element.nodeName === 'OL') {
|
|
18518
18984
|
cloneListParentNode = element.cloneNode(true);
|
|
18519
18985
|
listElement = cloneListParentNode.firstChild;
|
|
18520
18986
|
}
|
|
18521
|
-
const
|
|
18987
|
+
const cloneElementNode = isNullOrUndefined(cloneListParentNode) ? element : element.firstChild;
|
|
18522
18988
|
for (let index = 0; index < nodes.length; index++) {
|
|
18523
|
-
|
|
18524
|
-
|
|
18525
|
-
|
|
18526
|
-
}
|
|
18527
|
-
while (!this.isBlockElement(nodes[index])) {
|
|
18528
|
-
nodes[index] = nodes[index].parentElement;
|
|
18529
|
-
}
|
|
18530
|
-
let cloneParentNode;
|
|
18531
|
-
if (!isNullOrUndefined(cloneListParentNode)) {
|
|
18532
|
-
cloneParentNode = listElement.cloneNode(true);
|
|
18533
|
-
}
|
|
18534
|
-
else {
|
|
18535
|
-
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;
|
|
18536
18992
|
}
|
|
18993
|
+
const cloneParentNode = cloneElementNode.cloneNode(false);
|
|
18537
18994
|
// Appending all the child elements
|
|
18538
18995
|
while (nodes[index].firstChild) {
|
|
18539
|
-
if (
|
|
18996
|
+
if (nodes[index].textContent.trim().length !== 0) {
|
|
18540
18997
|
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
18541
18998
|
}
|
|
18542
18999
|
else {
|
|
18543
|
-
|
|
18544
|
-
if (nodes[index].nodeType === 3) {
|
|
18545
|
-
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
18546
|
-
}
|
|
18547
|
-
else {
|
|
18548
|
-
cloneParentNode.innerHTML = nodes[index].innerHTML;
|
|
18549
|
-
nodes[index].innerHTML = '';
|
|
18550
|
-
}
|
|
18551
|
-
nodes[index] = nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
|
|
19000
|
+
nodes[index].removeChild(nodes[index].firstChild);
|
|
18552
19001
|
}
|
|
18553
19002
|
}
|
|
18554
|
-
if (
|
|
18555
|
-
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
const nodeName = nodes[index].nodeName;
|
|
18559
|
-
nodes[index] = nodes[index].parentNode.replaceChild(cloneListParentNode, nodes[index]);
|
|
18560
|
-
const parent = nodeName === 'LI' ? cloneListParentNode.parentElement
|
|
18561
|
-
: cloneListParentNode;
|
|
18562
|
-
// Splicing and then inserting the node to previous element sibling of the Listparent.parent
|
|
18563
|
-
this.parent.nodeCutter.SplitNode(range, parent, true);
|
|
18564
|
-
if (!isNullOrUndefined(parent.previousElementSibling)) {
|
|
18565
|
-
parent.parentNode.insertBefore(cloneListParentNode, parent.nextElementSibling);
|
|
18566
|
-
}
|
|
18567
|
-
else {
|
|
18568
|
-
parent.parentElement.insertBefore(cloneListParentNode, parent);
|
|
18569
|
-
}
|
|
19003
|
+
if (nodes[index].nodeName === 'TD' || nodes[index].nodeName === 'TH') {
|
|
19004
|
+
if (isNullOrUndefined(cloneListParentNode)) {
|
|
19005
|
+
nodes[index].appendChild(cloneParentNode);
|
|
19006
|
+
continue;
|
|
18570
19007
|
}
|
|
18571
|
-
|
|
19008
|
+
else if (index === 0 && !isNullOrUndefined(cloneListParentNode)) {
|
|
19009
|
+
nodes[index].appendChild(cloneListParentNode);
|
|
19010
|
+
cloneListParentNode.appendChild(cloneParentNode);
|
|
19011
|
+
continue;
|
|
19012
|
+
}
|
|
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]);
|
|
18572
19029
|
}
|
|
18573
19030
|
/**Removing the inserted block node in list and appending to previous element sibling */
|
|
18574
19031
|
if (cloneParentNode.nodeName !== 'LI' && (cloneParentNode.parentElement.nodeName === 'OL' ||
|
|
@@ -18578,24 +19035,110 @@ class FormatPainterActions {
|
|
|
18578
19035
|
this.parent.nodeCutter.SplitNode(range, parent, true);
|
|
18579
19036
|
if (!isNullOrUndefined(parent.previousElementSibling)) {
|
|
18580
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
|
+
}
|
|
18581
19047
|
}
|
|
18582
19048
|
else {
|
|
18583
19049
|
parent.parentElement.prepend(cloneParentNode);
|
|
18584
19050
|
}
|
|
18585
19051
|
}
|
|
18586
|
-
nodes[index] = lastTextNode;
|
|
18587
19052
|
}
|
|
18588
19053
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18589
19054
|
!isNullOrUndefined(listElement) ? detach(listElement) : false;
|
|
18590
19055
|
this.cleanEmptyLists();
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
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
|
+
}
|
|
18595
19124
|
}
|
|
18596
19125
|
else {
|
|
18597
|
-
|
|
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
|
+
}
|
|
18598
19140
|
}
|
|
19141
|
+
return isSameListType;
|
|
18599
19142
|
}
|
|
18600
19143
|
cleanEmptyLists() {
|
|
18601
19144
|
const listElem = this.parent.editableElement.querySelectorAll('ol, ul');
|
|
@@ -18610,7 +19153,8 @@ class FormatPainterActions {
|
|
|
18610
19153
|
if (isNullOrUndefined(this.settings) || isNullOrUndefined(this.settings.deniedFormats)) {
|
|
18611
19154
|
return;
|
|
18612
19155
|
}
|
|
18613
|
-
const deniedFormats = this.settings.deniedFormats.split(';')
|
|
19156
|
+
const deniedFormats = this.settings.deniedFormats.indexOf(';') > -1 ? this.settings.deniedFormats.split(';') :
|
|
19157
|
+
[this.settings.deniedFormats];
|
|
18614
19158
|
const length = deniedFormats.length;
|
|
18615
19159
|
for (let i = 0; i < length; i++) {
|
|
18616
19160
|
const formatString = deniedFormats[i];
|
|
@@ -18624,6 +19168,11 @@ class FormatPainterActions {
|
|
|
18624
19168
|
}
|
|
18625
19169
|
this.deniedFormatsCollection = deniedFormatsCollection;
|
|
18626
19170
|
}
|
|
19171
|
+
detachEmptyBlockNodes(node) {
|
|
19172
|
+
if (!isNullOrUndefined(node) && node.textContent.trim() === '') {
|
|
19173
|
+
detach(node);
|
|
19174
|
+
}
|
|
19175
|
+
}
|
|
18627
19176
|
makeDeniedFormatsCollection(value) {
|
|
18628
19177
|
const openParenIndex = value.indexOf('(');
|
|
18629
19178
|
const closeParenIndex = value.indexOf(')');
|
|
@@ -18708,7 +19257,8 @@ class EditorManager {
|
|
|
18708
19257
|
this.tableObj = new TableCommand(this);
|
|
18709
19258
|
this.undoRedoManager = new UndoRedoManager(this, options.options);
|
|
18710
19259
|
this.msWordPaste = new MsWordPaste(this);
|
|
18711
|
-
this.
|
|
19260
|
+
this.formatPainterEditor = new FormatPainterActions(this, options.formatPainterSettings);
|
|
19261
|
+
this.emojiPickerObj = new EmojiPickerAction(this);
|
|
18712
19262
|
this.wireEvents();
|
|
18713
19263
|
}
|
|
18714
19264
|
wireEvents() {
|
|
@@ -18856,6 +19406,9 @@ class EditorManager {
|
|
|
18856
19406
|
case 'formatpainter':
|
|
18857
19407
|
this.observer.notify(FORMAT_PAINTER_ACTIONS, { item: exeValue, subCommand: value, event: event, callBack: callBack });
|
|
18858
19408
|
break;
|
|
19409
|
+
case 'emojipicker':
|
|
19410
|
+
this.observer.notify(EMOJI_PICKER_ACTIONS, { item: exeValue, subCommand: value, value: text,
|
|
19411
|
+
event: event, callBack: callBack });
|
|
18859
19412
|
}
|
|
18860
19413
|
}
|
|
18861
19414
|
}
|
|
@@ -19132,8 +19685,7 @@ const IFRAMEHEADER = `
|
|
|
19132
19685
|
span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
|
|
19133
19686
|
.e-table-rhelper { background-color: #4a90e2;}
|
|
19134
19687
|
.e-rtl { direction: rtl; }
|
|
19135
|
-
.e-rte-placeholder::before { content: attr(placeholder); opacity: 0.54; overflow: hidden;
|
|
19136
|
-
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; }
|
|
19137
19689
|
</style>
|
|
19138
19690
|
</head>`;
|
|
19139
19691
|
/**
|
|
@@ -19654,9 +20206,15 @@ class HtmlEditor {
|
|
|
19654
20206
|
}
|
|
19655
20207
|
backSpaceCleanup(e, currentRange) {
|
|
19656
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
|
+
}
|
|
19657
20214
|
if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
|
|
19658
20215
|
currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
|
|
19659
|
-
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH'
|
|
20216
|
+
currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH' &&
|
|
20217
|
+
isPreviousNotContentEditable) {
|
|
19660
20218
|
const checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
|
|
19661
20219
|
if (!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
|
|
19662
20220
|
!isNullOrUndefined(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') {
|
|
@@ -19693,9 +20251,14 @@ class HtmlEditor {
|
|
|
19693
20251
|
? this.oldRangeElement.lastElementChild.lastElementChild :
|
|
19694
20252
|
this.oldRangeElement.lastElementChild;
|
|
19695
20253
|
}
|
|
20254
|
+
let lastNode = this.oldRangeElement.lastChild;
|
|
20255
|
+
while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
|
|
20256
|
+
lastNode.nodeName !== 'BR') {
|
|
20257
|
+
lastNode = lastNode.lastChild;
|
|
20258
|
+
}
|
|
19696
20259
|
this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(),
|
|
19697
20260
|
// eslint-disable-next-line
|
|
19698
|
-
|
|
20261
|
+
lastNode, lastNode.textContent.length);
|
|
19699
20262
|
if (this.oldRangeElement.querySelectorAll('BR').length === 1) {
|
|
19700
20263
|
detach(this.oldRangeElement.querySelector('BR'));
|
|
19701
20264
|
}
|
|
@@ -19879,7 +20442,7 @@ class HtmlEditor {
|
|
|
19879
20442
|
let resultSplitContent = '';
|
|
19880
20443
|
for (let j = 0; j < splitTextContent.length; j++) {
|
|
19881
20444
|
if (splitTextContent[j].match(httpRegex) || splitTextContent[j].match(wwwRegex)) {
|
|
19882
|
-
resultSplitContent += '<a
|
|
20445
|
+
resultSplitContent += '<a class="e-rte-anchor" href="' + splitTextContent[j] +
|
|
19883
20446
|
'" title="' + splitTextContent[j] + '"target="_blank">' + splitTextContent[j] + ' </a>';
|
|
19884
20447
|
}
|
|
19885
20448
|
else {
|
|
@@ -20035,6 +20598,9 @@ class HtmlEditor {
|
|
|
20035
20598
|
member: 'fileManager', args: args, selectNode: selectNodeEle, selection: save, selectParent: selectParentEle
|
|
20036
20599
|
});
|
|
20037
20600
|
break;
|
|
20601
|
+
case 'EmojiPicker':
|
|
20602
|
+
this.parent.notify(emojiPicker, { member: 'emojiPicker', args: args });
|
|
20603
|
+
break;
|
|
20038
20604
|
default:
|
|
20039
20605
|
this.parent.formatter.process(this.parent, args, args.originalEvent, null);
|
|
20040
20606
|
break;
|
|
@@ -20324,6 +20890,7 @@ class PasteCleanup {
|
|
|
20324
20890
|
if (Browser.userAgent.indexOf('Firefox') !== -1) {
|
|
20325
20891
|
let currentFocusNode = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()).startContainer;
|
|
20326
20892
|
if (currentFocusNode.nodeName !== '#text') {
|
|
20893
|
+
// eslint-disable-next-line
|
|
20327
20894
|
currentFocusNode = currentFocusNode.childNodes[this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()).startOffset];
|
|
20328
20895
|
}
|
|
20329
20896
|
if (currentFocusNode.previousSibling.nodeName === 'IMG') {
|
|
@@ -21231,7 +21798,7 @@ class Resize {
|
|
|
21231
21798
|
else {
|
|
21232
21799
|
const eventType = Browser.info.name !== 'msie' ? e.touches[0] : e;
|
|
21233
21800
|
this.parent.element.style.height = eventType.clientY - boundRect.top + 'px';
|
|
21234
|
-
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';
|
|
21235
21802
|
}
|
|
21236
21803
|
if (!this.parent.toolbarSettings.enable) {
|
|
21237
21804
|
this.parent.setContentHeight('', false);
|
|
@@ -21405,6 +21972,7 @@ class FileManager$1 {
|
|
|
21405
21972
|
detailsViewSettings: this.parent.fileManagerSettings.detailsViewSettings,
|
|
21406
21973
|
contextMenuSettings: this.parent.fileManagerSettings.contextMenuSettings,
|
|
21407
21974
|
navigationPaneSettings: this.parent.fileManagerSettings.navigationPaneSettings,
|
|
21975
|
+
beforeSend: this.parent.fileManagerSettings.beforeSend,
|
|
21408
21976
|
fileSelect: (e) => {
|
|
21409
21977
|
const selectedFile = e.fileDetails;
|
|
21410
21978
|
if (selectedFile.isFile && proxy.parent.insertImageSettings.allowedTypes.indexOf(selectedFile.type) > -1) {
|
|
@@ -21563,6 +22131,9 @@ class FullScreen {
|
|
|
21563
22131
|
&& !isNullOrUndefined(this.parent.quickToolbarModule)) {
|
|
21564
22132
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
21565
22133
|
}
|
|
22134
|
+
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22135
|
+
this.parent.notify(maximizeMinimizeClick, { args: event });
|
|
22136
|
+
}
|
|
21566
22137
|
this.scrollableParent = getScrollableParent(this.parent.element);
|
|
21567
22138
|
if (!this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
21568
22139
|
const evenArgs = {
|
|
@@ -21614,6 +22185,9 @@ class FullScreen {
|
|
|
21614
22185
|
&& !isNullOrUndefined(this.parent.quickToolbarModule)) {
|
|
21615
22186
|
this.parent.quickToolbarModule.hideQuickToolbars();
|
|
21616
22187
|
}
|
|
22188
|
+
if (this.parent.showTooltip && !isNullOrUndefined(document.querySelector('.e-tooltip-wrap'))) {
|
|
22189
|
+
this.parent.notify(maximizeMinimizeClick, { args: event });
|
|
22190
|
+
}
|
|
21617
22191
|
if (this.parent.element.classList.contains(CLS_FULL_SCREEN)) {
|
|
21618
22192
|
const evenArgs = {
|
|
21619
22193
|
cancel: false,
|
|
@@ -21789,14 +22363,10 @@ class FormatPainter {
|
|
|
21789
22363
|
}
|
|
21790
22364
|
onKeyDown(event) {
|
|
21791
22365
|
const originalEvent = event.args;
|
|
21792
|
-
if ((originalEvent.
|
|
22366
|
+
if ((originalEvent.altKey && originalEvent.shiftKey && (originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste'))
|
|
21793
22367
|
|| (originalEvent.action === 'escape' && (this.previousAction === 'format-copy' || this.previousAction === 'format-paste'))) {
|
|
21794
|
-
if (
|
|
21795
|
-
originalEvent.
|
|
21796
|
-
}
|
|
21797
|
-
if (!isNullOrUndefined(originalEvent.key) && originalEvent.key.toLowerCase() === 'v' &&
|
|
21798
|
-
this.previousAction === 'format-copy' || this.previousAction === 'format-paste' || this.isSticky) {
|
|
21799
|
-
originalEvent.preventDefault();
|
|
22368
|
+
if ((originalEvent.action === 'format-copy' || originalEvent.action === 'format-paste')) {
|
|
22369
|
+
originalEvent.stopPropagation();
|
|
21800
22370
|
}
|
|
21801
22371
|
this.actionHandler(event, 'keyBoard');
|
|
21802
22372
|
}
|
|
@@ -21880,8 +22450,7 @@ class FormatPainter {
|
|
|
21880
22450
|
}
|
|
21881
22451
|
}
|
|
21882
22452
|
destroy() {
|
|
21883
|
-
|
|
21884
|
-
if (this.parent.isDestroyed) {
|
|
22453
|
+
if (isNullOrUndefined(this.parent) || this.parent.isDestroyed) {
|
|
21885
22454
|
return;
|
|
21886
22455
|
}
|
|
21887
22456
|
this.parent.off(formatPainterClick, this.toolbarClick);
|
|
@@ -21889,6 +22458,13 @@ class FormatPainter {
|
|
|
21889
22458
|
this.parent.off(formatPainterDoubleClick, this.toolbarDoubleClick);
|
|
21890
22459
|
this.parent.off(keyDown, this.onKeyDown);
|
|
21891
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;
|
|
21892
22468
|
}
|
|
21893
22469
|
/**
|
|
21894
22470
|
* For internal use only - Get the module name.
|
|
@@ -21901,6 +22477,775 @@ class FormatPainter {
|
|
|
21901
22477
|
}
|
|
21902
22478
|
}
|
|
21903
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
|
+
|
|
21904
23249
|
/**
|
|
21905
23250
|
* Action export
|
|
21906
23251
|
*/
|
|
@@ -22677,15 +24022,20 @@ class Image {
|
|
|
22677
24022
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
22678
24023
|
for (let i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
22679
24024
|
const temp = this.parent.createElement('div');
|
|
22680
|
-
const contentElem =
|
|
22681
|
-
temp.appendChild(contentElem);
|
|
24025
|
+
const contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
24026
|
+
temp.appendChild(contentElem.cloneNode(true));
|
|
22682
24027
|
const img = temp.querySelectorAll('img');
|
|
22683
24028
|
if (temp.querySelector('.e-img-resize') && img.length > 0) {
|
|
22684
24029
|
for (let j = 0; j < img.length; j++) {
|
|
22685
24030
|
img[j].style.outline = '';
|
|
22686
24031
|
}
|
|
22687
24032
|
detach(temp.querySelector('.e-img-resize'));
|
|
22688
|
-
|
|
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;
|
|
22689
24039
|
}
|
|
22690
24040
|
}
|
|
22691
24041
|
}
|
|
@@ -22877,7 +24227,7 @@ class Image {
|
|
|
22877
24227
|
if (isNullOrUndefined(img.width)) {
|
|
22878
24228
|
return;
|
|
22879
24229
|
}
|
|
22880
|
-
// eslint-disable-next-line
|
|
24230
|
+
// eslint-disable-next-line security/detect-unsafe-regex
|
|
22881
24231
|
const width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
|
|
22882
24232
|
parseInt(img.style.width, 10) : img.width;
|
|
22883
24233
|
const height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
|
|
@@ -23155,7 +24505,7 @@ class Image {
|
|
|
23155
24505
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
23156
24506
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
23157
24507
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
23158
|
-
(selectParentEle[0].tagName === 'IMG') && selectParentEle[0].parentElement) {
|
|
24508
|
+
(!isNullOrUndefined(selectParentEle[0]) && selectParentEle[0].tagName === 'IMG') && selectParentEle[0].parentElement) {
|
|
23159
24509
|
const prev = selectParentEle[0].parentElement.childNodes[0];
|
|
23160
24510
|
if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
|
|
23161
24511
|
this.removeResizeEle();
|
|
@@ -23800,7 +25150,7 @@ class Image {
|
|
|
23800
25150
|
const dialogContent = this.imgsizeInput(e);
|
|
23801
25151
|
const selectObj = { args: e.args, selfImage: this, selection: e.selection, selectNode: e.selectNode };
|
|
23802
25152
|
this.dialogObj.setProperties({
|
|
23803
|
-
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' },
|
|
23804
25154
|
buttons: [{
|
|
23805
25155
|
// eslint-disable-next-line
|
|
23806
25156
|
click: (e) => {
|
|
@@ -24934,8 +26284,8 @@ class Audio {
|
|
|
24934
26284
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
24935
26285
|
for (let i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
24936
26286
|
const temp = this.parent.createElement('div');
|
|
24937
|
-
const contentElem =
|
|
24938
|
-
temp.appendChild(contentElem);
|
|
26287
|
+
const contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
26288
|
+
temp.appendChild(contentElem.cloneNode(true));
|
|
24939
26289
|
}
|
|
24940
26290
|
}
|
|
24941
26291
|
}
|
|
@@ -25816,15 +27166,20 @@ class Video {
|
|
|
25816
27166
|
if (args.subCommand.toLowerCase() === 'undo' || args.subCommand.toLowerCase() === 'redo') {
|
|
25817
27167
|
for (let i = 0; i < this.parent.formatter.getUndoRedoStack().length; i++) {
|
|
25818
27168
|
const temp = this.parent.createElement('div');
|
|
25819
|
-
const contentElem =
|
|
25820
|
-
temp.appendChild(contentElem);
|
|
27169
|
+
const contentElem = this.parent.formatter.getUndoRedoStack()[i].text;
|
|
27170
|
+
temp.appendChild(contentElem.cloneNode(true));
|
|
25821
27171
|
const vid = temp.querySelectorAll('video');
|
|
25822
27172
|
if (temp.querySelector('.e-vid-resize') && vid.length > 0) {
|
|
25823
27173
|
for (let j = 0; j < vid.length; j++) {
|
|
25824
27174
|
vid[j].style.outline = '';
|
|
25825
27175
|
}
|
|
25826
27176
|
detach(temp.querySelector('.e-vid-resize'));
|
|
25827
|
-
|
|
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;
|
|
25828
27183
|
}
|
|
25829
27184
|
}
|
|
25830
27185
|
}
|
|
@@ -26117,8 +27472,8 @@ class Video {
|
|
|
26117
27472
|
parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
|
|
26118
27473
|
const height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
|
|
26119
27474
|
if (width > height) {
|
|
26120
|
-
vid.style.minWidth = this.parent.insertVideoSettings.minWidth === 0 ? '
|
|
26121
|
-
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);
|
|
26122
27477
|
if (this.parent.insertVideoSettings.resizeByPercent) {
|
|
26123
27478
|
if (parseInt('' + vid.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
|
|
26124
27479
|
const percentageValue = this.pixToPerc((parseInt(width.toString(), 10) / parseInt(height.toString(), 10) * expectedY), (vid.previousElementSibling || vid.parentElement));
|
|
@@ -26313,7 +27668,7 @@ class Video {
|
|
|
26313
27668
|
selectNodeEle = this.parent.formatter.editorManager.nodeSelection.getNodeCollection(range);
|
|
26314
27669
|
selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
|
|
26315
27670
|
if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
|
|
26316
|
-
((selectParentEle[0].tagName === 'VIDEO' || this.isEmbedVidElem(selectParentEle[0]))) &&
|
|
27671
|
+
((!isNullOrUndefined(selectParentEle[0]) && selectParentEle[0].tagName === 'VIDEO' || this.isEmbedVidElem(selectParentEle[0]))) &&
|
|
26317
27672
|
selectParentEle[0].parentElement) {
|
|
26318
27673
|
const prev = selectParentEle[0].parentElement.childNodes[0];
|
|
26319
27674
|
if (this.contentModule.getEditPanel().querySelector('.e-vid-resize')) {
|
|
@@ -26826,7 +28181,7 @@ class Video {
|
|
|
26826
28181
|
videoUrl.appendChild(urlContent);
|
|
26827
28182
|
this.embedInputUrl = this.parent.createElement('textarea', {
|
|
26828
28183
|
className: 'e-input e-embed-video-url',
|
|
26829
|
-
attrs: { placeholder: '
|
|
28184
|
+
attrs: { placeholder: this.i10n.getConstant('pasteEmbeddedCodeHere'), type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
|
|
26830
28185
|
});
|
|
26831
28186
|
this.embedInputUrl.addEventListener('keyup', () => {
|
|
26832
28187
|
if (!isNullOrUndefined(this.embedInputUrl)) {
|
|
@@ -26853,7 +28208,7 @@ class Video {
|
|
|
26853
28208
|
}
|
|
26854
28209
|
});
|
|
26855
28210
|
const embedUrlBtn = new RadioButton({
|
|
26856
|
-
label: '
|
|
28211
|
+
label: this.i10n.getConstant('embeddedCode'),
|
|
26857
28212
|
checked: true,
|
|
26858
28213
|
name: 'URL',
|
|
26859
28214
|
created: () => {
|
|
@@ -26867,7 +28222,7 @@ class Video {
|
|
|
26867
28222
|
});
|
|
26868
28223
|
embedUrlBtn.appendTo(videoUrl.querySelector('#embedURL'));
|
|
26869
28224
|
const webUrlBtn = new RadioButton({
|
|
26870
|
-
label: '
|
|
28225
|
+
label: this.i10n.getConstant('webUrl'),
|
|
26871
28226
|
name: 'URL',
|
|
26872
28227
|
change: () => {
|
|
26873
28228
|
urlContent.innerHTML = '';
|
|
@@ -29254,6 +30609,9 @@ __decorate$2([
|
|
|
29254
30609
|
*/
|
|
29255
30610
|
class FileManagerSettings extends ChildProperty {
|
|
29256
30611
|
}
|
|
30612
|
+
__decorate$2([
|
|
30613
|
+
Event()
|
|
30614
|
+
], FileManagerSettings.prototype, "beforeSend", void 0);
|
|
29257
30615
|
__decorate$2([
|
|
29258
30616
|
Complex({ getImageUrl: null, url: null, uploadUrl: null }, AjaxSettings)
|
|
29259
30617
|
], FileManagerSettings.prototype, "ajaxSettings", void 0);
|
|
@@ -29360,14 +30718,22 @@ __decorate$2([
|
|
|
29360
30718
|
class FormatPainterSettings extends ChildProperty {
|
|
29361
30719
|
}
|
|
29362
30720
|
__decorate$2([
|
|
29363
|
-
Property(
|
|
29364
|
-
], FormatPainterSettings.prototype, "allowedContext", void 0);
|
|
29365
|
-
__decorate$2([
|
|
29366
|
-
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;')
|
|
29367
30722
|
], FormatPainterSettings.prototype, "allowedFormats", void 0);
|
|
29368
30723
|
__decorate$2([
|
|
29369
30724
|
Property(null)
|
|
29370
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);
|
|
29371
30737
|
/**
|
|
29372
30738
|
* Configures the Paste Cleanup settings of the RichTextEditor.
|
|
29373
30739
|
*/
|
|
@@ -29585,7 +30951,7 @@ class EnterKeyAction {
|
|
|
29585
30951
|
}
|
|
29586
30952
|
isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
|
|
29587
30953
|
}
|
|
29588
|
-
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')) {
|
|
29589
30955
|
if (isNullOrUndefined(this.startNode.closest('LI, UL, OL')) && isNullOrUndefined(this.endNode.closest('LI, UL, OL')) && isTableEnter &&
|
|
29590
30956
|
isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
|
|
29591
30957
|
const shiftKey = e.args.shiftKey;
|
|
@@ -29691,7 +31057,7 @@ class EnterKeyAction {
|
|
|
29691
31057
|
let isFocusedFirst = false;
|
|
29692
31058
|
if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
|
|
29693
31059
|
this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
|
|
29694
|
-
&& nearBlockNode.childNodes[0].nodeName === 'IMG'
|
|
31060
|
+
&& (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
|
|
29695
31061
|
const startNodeText = this.range.startContainer.textContent;
|
|
29696
31062
|
const splitFirstText = startNodeText.substring(0, this.range.startOffset);
|
|
29697
31063
|
// eslint-disable-next-line max-len
|
|
@@ -30086,6 +31452,10 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30086
31452
|
member: 'formatPainter',
|
|
30087
31453
|
args: [this]
|
|
30088
31454
|
});
|
|
31455
|
+
modules.push({
|
|
31456
|
+
member: 'emojiPicker',
|
|
31457
|
+
args: [this, this.serviceLocator]
|
|
31458
|
+
});
|
|
30089
31459
|
}
|
|
30090
31460
|
if (this.fileManagerSettings.enable) {
|
|
30091
31461
|
modules.push({ member: 'fileManager', args: [this, this.serviceLocator] });
|
|
@@ -30285,6 +31655,20 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30285
31655
|
});
|
|
30286
31656
|
return str;
|
|
30287
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
|
+
}
|
|
30288
31672
|
/**
|
|
30289
31673
|
* Executes the commands
|
|
30290
31674
|
*
|
|
@@ -30520,7 +31904,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30520
31904
|
this.valueContainer.defaultValue = this.value;
|
|
30521
31905
|
}
|
|
30522
31906
|
// eslint-disable-next-line
|
|
30523
|
-
(!this.
|
|
31907
|
+
(this.enabled && !this.readonly) ? this.eventInitializer() : this.unWireEvents();
|
|
30524
31908
|
this.notify(bindCssClass, { cssClass: this.cssClass });
|
|
30525
31909
|
this.addAudioVideoWrapper();
|
|
30526
31910
|
this.notify(tableclass, {});
|
|
@@ -30605,6 +31989,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30605
31989
|
const currentEndContainer = range.endContainer;
|
|
30606
31990
|
const currentStartOffset = range.startOffset;
|
|
30607
31991
|
const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
|
|
31992
|
+
// eslint-disable-next-line
|
|
30608
31993
|
const currentEndOffset = currentEndContainer.textContent.length;
|
|
30609
31994
|
const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
|
|
30610
31995
|
range.endContainer;
|
|
@@ -30687,7 +32072,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30687
32072
|
this.formatter.editorManager.nodeSelection.setCursorPoint(this.contentModule.getDocument(), range.startContainer, range.startOffset);
|
|
30688
32073
|
}
|
|
30689
32074
|
}
|
|
30690
|
-
|
|
32075
|
+
const notFormatPainterCopy = !isNullOrUndefined(e.action) && e.action !== 'format-copy';
|
|
32076
|
+
if (this.formatter.getUndoRedoStack().length === 0 && notFormatPainterCopy) {
|
|
30691
32077
|
this.formatter.saveData();
|
|
30692
32078
|
}
|
|
30693
32079
|
if (e.action !== 'insert-link' &&
|
|
@@ -30719,8 +32105,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30719
32105
|
if ((!isNullOrUndefined(this.placeHolderWrapper)) && (this.inputElement.textContent.length !== 1)) {
|
|
30720
32106
|
this.placeHolderWrapper.style.display = 'none';
|
|
30721
32107
|
}
|
|
30722
|
-
else if (this.iframeSettings.enable && this.inputElement.classList.contains(
|
|
30723
|
-
removeClass([this.inputElement],
|
|
32108
|
+
else if (this.iframeSettings.enable && this.inputElement.classList.contains('e-rte-placeholder')) {
|
|
32109
|
+
removeClass([this.inputElement], 'e-rte-placeholder');
|
|
30724
32110
|
}
|
|
30725
32111
|
else {
|
|
30726
32112
|
this.setPlaceHolder();
|
|
@@ -30749,7 +32135,9 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
30749
32135
|
this.inputElement.innerHTML = getEditValue(getDefaultValue(this), this);
|
|
30750
32136
|
}
|
|
30751
32137
|
const allowedKeys = e.which === 32 || e.which === 13 || e.which === 8 || e.which === 46;
|
|
30752
|
-
|
|
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'
|
|
30753
32141
|
&& ((e.key !== 'shift' && !e.ctrlKey) && e.key && e.key.length === 1 || allowedKeys)) && !this.inlineMode.enable) {
|
|
30754
32142
|
this.formatter.onKeyHandler(this, e);
|
|
30755
32143
|
}
|
|
@@ -31298,6 +32686,9 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
31298
32686
|
newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
|
|
31299
32687
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
31300
32688
|
break;
|
|
32689
|
+
case 'formatPainterSettings':
|
|
32690
|
+
this.formatter.editorManager.observer.notify(MODEL_CHANGED, { module: 'formatPainter', newProp: newProp });
|
|
32691
|
+
break;
|
|
31301
32692
|
default:
|
|
31302
32693
|
this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
|
|
31303
32694
|
break;
|
|
@@ -31427,11 +32818,11 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
31427
32818
|
if (this.inputElement.textContent.length === 0 && this.inputElement.childNodes.length < 2 && !isNullOrUndefined(this.inputElement.firstChild) && (this.inputElement.firstChild.nodeName === 'BR' ||
|
|
31428
32819
|
((this.inputElement.firstChild.nodeName === 'P' || this.inputElement.firstChild.nodeName === 'DIV') && !isNullOrUndefined(this.inputElement.firstChild.firstChild) &&
|
|
31429
32820
|
this.inputElement.firstChild.firstChild.nodeName === 'BR'))) {
|
|
31430
|
-
addClass([this.inputElement],
|
|
32821
|
+
addClass([this.inputElement], 'e-rte-placeholder');
|
|
31431
32822
|
this.inputElement.setAttribute('placeholder', this.placeholder);
|
|
31432
32823
|
}
|
|
31433
32824
|
else {
|
|
31434
|
-
removeClass([this.inputElement],
|
|
32825
|
+
removeClass([this.inputElement], 'e-rte-placeholder');
|
|
31435
32826
|
}
|
|
31436
32827
|
}
|
|
31437
32828
|
}
|
|
@@ -31659,7 +33050,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
31659
33050
|
setValue(isPropertyChange) {
|
|
31660
33051
|
if (this.valueTemplate) {
|
|
31661
33052
|
const regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
|
|
31662
|
-
if (regEx.test(this.valueTemplate)) {
|
|
33053
|
+
if (typeof this.valueTemplate === 'string' && regEx.test(this.valueTemplate)) {
|
|
31663
33054
|
this.setProperties({ value: this.valueTemplate });
|
|
31664
33055
|
}
|
|
31665
33056
|
else {
|
|
@@ -32158,7 +33549,7 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
32158
33549
|
this.timeInterval = null;
|
|
32159
33550
|
}
|
|
32160
33551
|
if (!isNullOrUndefined(this.placeHolderWrapper) && this.element.querySelector('[title = Preview]')) {
|
|
32161
|
-
this.placeHolderWrapper.style.display =
|
|
33552
|
+
this.placeHolderWrapper.style.display = 'none';
|
|
32162
33553
|
}
|
|
32163
33554
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
32164
33555
|
}
|
|
@@ -32216,7 +33607,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
32216
33607
|
EventHandler.add(element, 'scroll', this.scrollHandler, this);
|
|
32217
33608
|
}
|
|
32218
33609
|
if (!this.iframeSettings.enable) {
|
|
32219
|
-
|
|
33610
|
+
// Add the scroll event handler from the inputElement
|
|
33611
|
+
EventHandler.add(this.inputElement, 'scroll', this.contentScrollHandler, this);
|
|
32220
33612
|
}
|
|
32221
33613
|
}
|
|
32222
33614
|
wireContextEvent() {
|
|
@@ -32244,7 +33636,8 @@ let RichTextEditor = class RichTextEditor extends Component {
|
|
|
32244
33636
|
EventHandler.remove(element, 'scroll', this.scrollHandler);
|
|
32245
33637
|
}
|
|
32246
33638
|
if (!this.iframeSettings.enable) {
|
|
32247
|
-
|
|
33639
|
+
// Remove the scroll event handler from the inputElement
|
|
33640
|
+
EventHandler.remove(this.inputElement, 'scroll', this.contentScrollHandler);
|
|
32248
33641
|
}
|
|
32249
33642
|
}
|
|
32250
33643
|
touchHandler(e) {
|
|
@@ -32427,6 +33820,9 @@ __decorate$1([
|
|
|
32427
33820
|
__decorate$1([
|
|
32428
33821
|
Complex({}, FormatPainterSettings)
|
|
32429
33822
|
], RichTextEditor.prototype, "formatPainterSettings", void 0);
|
|
33823
|
+
__decorate$1([
|
|
33824
|
+
Complex({}, EmojiSettings)
|
|
33825
|
+
], RichTextEditor.prototype, "emojiPickerSettings", void 0);
|
|
32430
33826
|
__decorate$1([
|
|
32431
33827
|
Complex({}, IFrameSettings)
|
|
32432
33828
|
], RichTextEditor.prototype, "iframeSettings", void 0);
|
|
@@ -32714,5 +34110,5 @@ RichTextEditor = __decorate$1([
|
|
|
32714
34110
|
* Rich Text Editor component exported items
|
|
32715
34111
|
*/
|
|
32716
34112
|
|
|
32717
|
-
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 };
|
|
32718
34114
|
//# sourceMappingURL=ej2-richtexteditor.es2015.js.map
|