jodit 4.19.4 → 4.19.6
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/CHANGELOG.md +16 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +20 -7
- package/es2015/jodit.js +393 -56
- package/es2015/jodit.min.js +17 -4
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +17 -4
- package/es2018/jodit.min.js +17 -4
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +18 -5
- package/es2021/jodit.js +390 -56
- package/es2021/jodit.min.js +18 -5
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +20 -7
- package/es2021.en/jodit.js +390 -56
- package/es2021.en/jodit.min.js +20 -7
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +410 -62
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +31 -0
- package/esm/core/constants.js +1 -1
- package/esm/core/selection/helpers/move-node-inside-start.js +5 -2
- package/esm/plugins/file/file.js +39 -3
- package/esm/plugins/link/config.d.ts +31 -0
- package/esm/plugins/link/config.js +3 -0
- package/esm/plugins/link/link.d.ts +27 -0
- package/esm/plugins/link/link.js +144 -2
- package/esm/plugins/link/tlds.d.ts +18 -0
- package/esm/plugins/link/tlds.js +33 -0
- package/esm/plugins/link/typed-link.d.ts +23 -0
- package/esm/plugins/link/typed-link.js +92 -0
- package/package.json +1 -1
- package/types/config.d.ts +31 -0
- package/types/plugins/link/config.d.ts +31 -0
- package/types/plugins/link/link.d.ts +27 -0
- package/types/plugins/link/tlds.d.ts +18 -0
- package/types/plugins/link/typed-link.d.ts +23 -0
package/es5/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.19.
|
|
4
|
+
* Version: v4.19.6
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -2154,7 +2154,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2154
2154
|
* @packageDocumentation
|
|
2155
2155
|
* @module constants
|
|
2156
2156
|
*/
|
|
2157
|
-
var APP_VERSION = "4.19.
|
|
2157
|
+
var APP_VERSION = "4.19.6";
|
|
2158
2158
|
// prettier-ignore
|
|
2159
2159
|
var ES = "es5";
|
|
2160
2160
|
var IS_ES_MODERN = false;
|
|
@@ -12725,7 +12725,13 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
|
|
|
12725
12725
|
* When the cursor is positioned in its place, it must be inside the element and not outside its border.
|
|
12726
12726
|
* @private
|
|
12727
12727
|
*/ function moveNodeInsideStart(j, node, start) {
|
|
12728
|
-
|
|
12728
|
+
// A text node of non-breaking spaces trims to nothing, but it's text the
|
|
12729
|
+
// node mustn't move past
|
|
12730
|
+
var isContent = function isContent(n) {
|
|
12731
|
+
var _n_nodeValue;
|
|
12732
|
+
return !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(n) || Boolean((_n_nodeValue = n.nodeValue) === null || _n_nodeValue === void 0 ? void 0 : _n_nodeValue.includes(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE));
|
|
12733
|
+
};
|
|
12734
|
+
var sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, start, isContent), anotherSibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, !start, isContent);
|
|
12729
12735
|
while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(sibling) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(sibling, j.editor) && (!anotherSibling || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(node, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement, j.editor))){
|
|
12730
12736
|
if (start || !sibling.firstChild) {
|
|
12731
12737
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(sibling, node);
|
|
@@ -40474,12 +40480,37 @@ function brBefore(start) {
|
|
|
40474
40480
|
|
|
40475
40481
|
|
|
40476
40482
|
|
|
40483
|
+
/**
|
|
40484
|
+
* Selected text becomes the link's text, as the Link button does, instead
|
|
40485
|
+
* of being replaced by the file's name. Returns false with nothing selected
|
|
40486
|
+
*/ function wrapSelectionInLink(editor, href) {
|
|
40487
|
+
var title = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : '';
|
|
40488
|
+
if (editor.s.isCollapsed()) {
|
|
40489
|
+
return false;
|
|
40490
|
+
}
|
|
40491
|
+
var links = editor.s.wrapInTag('a');
|
|
40492
|
+
if (!links.length) {
|
|
40493
|
+
return false;
|
|
40494
|
+
}
|
|
40495
|
+
links.forEach(function(link) {
|
|
40496
|
+
;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'href', href);
|
|
40497
|
+
if (title) {
|
|
40498
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(link, 'title', title);
|
|
40499
|
+
}
|
|
40500
|
+
});
|
|
40501
|
+
editor.s.setCursorAfter(links[links.length - 1]);
|
|
40502
|
+
return true;
|
|
40503
|
+
}
|
|
40477
40504
|
function insertLinks(data) {
|
|
40478
40505
|
var _this = this;
|
|
40479
40506
|
var _data_files;
|
|
40480
40507
|
(_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach(function(file) {
|
|
40508
|
+
var href = data.baseurl + file;
|
|
40509
|
+
if (wrapSelectionInLink(_this, href)) {
|
|
40510
|
+
return;
|
|
40511
|
+
}
|
|
40481
40512
|
var link = _this.createInside.element('a', {
|
|
40482
|
-
href:
|
|
40513
|
+
href: href
|
|
40483
40514
|
});
|
|
40484
40515
|
link.textContent = _this.o.uploader.getDisplayName.call(_this.uploader, data.baseurl, file);
|
|
40485
40516
|
_this.s.insertNode(link);
|
|
@@ -40490,8 +40521,20 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.file = {
|
|
|
40490
40521
|
};
|
|
40491
40522
|
jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.file = {
|
|
40492
40523
|
popup: function popup(editor, current, close) {
|
|
40524
|
+
// The popup's first field takes the focus, so the selection the
|
|
40525
|
+
// popup was opened for is kept and put back before the link goes in
|
|
40526
|
+
var selected = editor.s.isCollapsed() ? null : editor.s.range;
|
|
40527
|
+
var restoreSelection = function restoreSelection() {
|
|
40528
|
+
if (selected) {
|
|
40529
|
+
editor.s.selectRange(selected);
|
|
40530
|
+
}
|
|
40531
|
+
};
|
|
40493
40532
|
var insert = function insert(url) {
|
|
40494
40533
|
var title = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
40534
|
+
restoreSelection();
|
|
40535
|
+
if (wrapSelectionInLink(editor, url, title)) {
|
|
40536
|
+
return;
|
|
40537
|
+
}
|
|
40495
40538
|
editor.s.insertNode(editor.createInside.fromHTML('<a href="'.concat(url, '" title="').concat(title, '">').concat(title || url, "</a>")));
|
|
40496
40539
|
};
|
|
40497
40540
|
var sourceAnchor = null;
|
|
@@ -40508,6 +40551,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.file = {
|
|
|
40508
40551
|
upload: function upload(data) {
|
|
40509
40552
|
var _ref;
|
|
40510
40553
|
var _editor_o_file;
|
|
40554
|
+
restoreSelection();
|
|
40511
40555
|
((_ref = (_editor_o_file = editor.o.file) === null || _editor_o_file === void 0 ? void 0 : _editor_o_file.defaultHandlerSuccess) !== null && _ref !== void 0 ? _ref : insertLinks).call(editor, data);
|
|
40512
40556
|
},
|
|
40513
40557
|
url: function url(url, text) {
|
|
@@ -48279,6 +48323,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
|
|
|
48279
48323
|
followOnDblClick: false,
|
|
48280
48324
|
processVideoLink: true,
|
|
48281
48325
|
processPastedLink: true,
|
|
48326
|
+
processTypedLink: false,
|
|
48327
|
+
typedLinkTlds: [],
|
|
48328
|
+
typedLinkFileEndings: [
|
|
48329
|
+
'zip',
|
|
48330
|
+
'mov',
|
|
48331
|
+
'md',
|
|
48332
|
+
'py',
|
|
48333
|
+
'sh',
|
|
48334
|
+
'pub'
|
|
48335
|
+
],
|
|
48282
48336
|
deriveUrlFromText: false,
|
|
48283
48337
|
noFollowCheckbox: true,
|
|
48284
48338
|
openInNewTabCheckbox: true,
|
|
@@ -48333,14 +48387,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48333
48387
|
/* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
|
|
48334
48388
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
|
|
48335
48389
|
/* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
|
|
48336
|
-
/* harmony import */ var
|
|
48337
|
-
/* harmony import */ var
|
|
48338
|
-
/* harmony import */ var
|
|
48339
|
-
/* harmony import */ var
|
|
48340
|
-
/* harmony import */ var
|
|
48341
|
-
/* harmony import */ var
|
|
48342
|
-
/* harmony import */ var
|
|
48343
|
-
/* harmony import */ var
|
|
48390
|
+
/* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50684);
|
|
48391
|
+
/* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42395);
|
|
48392
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
|
|
48393
|
+
/* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38574);
|
|
48394
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(81937);
|
|
48395
|
+
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(84839);
|
|
48396
|
+
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(27795);
|
|
48397
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(28077);
|
|
48398
|
+
/* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65946);
|
|
48399
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(91206);
|
|
48400
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(65230);
|
|
48401
|
+
/* harmony import */ var _typed_link__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(99763);
|
|
48344
48402
|
/*!
|
|
48345
48403
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
48346
48404
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -48362,6 +48420,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48362
48420
|
|
|
48363
48421
|
|
|
48364
48422
|
|
|
48423
|
+
|
|
48424
|
+
|
|
48425
|
+
|
|
48426
|
+
|
|
48365
48427
|
/**
|
|
48366
48428
|
* Process link. Insert, dblclick or remove format
|
|
48367
48429
|
*/ var link = /*#__PURE__*/ function(Plugin) {
|
|
@@ -48375,7 +48437,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48375
48437
|
name: 'link',
|
|
48376
48438
|
group: 'insert'
|
|
48377
48439
|
}
|
|
48378
|
-
])
|
|
48440
|
+
]), /**
|
|
48441
|
+
* Where the caret was when Enter was pressed. Enter splits the line in a
|
|
48442
|
+
* history transaction, so the link waits until it's over
|
|
48443
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__enteredAt", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__linkAfterEnter", function() {}), /**
|
|
48444
|
+
* The link just made, which Backspace straight after takes off again, as
|
|
48445
|
+
* in CKEditor 5. Any other key but a modifier, a click or a command
|
|
48446
|
+
* forgets it
|
|
48447
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__justLinked", null);
|
|
48379
48448
|
return _this;
|
|
48380
48449
|
}
|
|
48381
48450
|
;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(link, [
|
|
@@ -48390,6 +48459,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48390
48459
|
if (jodit.o.link.processPastedLink) {
|
|
48391
48460
|
jodit.e.on('processPaste.link', this.onProcessPasteLink);
|
|
48392
48461
|
}
|
|
48462
|
+
if (jodit.o.link.processTypedLink) {
|
|
48463
|
+
this.__linkAfterEnter = jodit.async.microDebounce(this.__linkTyped);
|
|
48464
|
+
jodit.e.on('input.link', this.__onTypedSpace).on('beforeEnter.link', this.__onBeforeEnter).on('afterEnter.link', this.__onAfterEnter).on('mousedown.link blur.link beforeCommand.link', this.__forgetLink)// Without a namespace it runs ahead of table navigation,
|
|
48465
|
+
// which moves the caret on Tab, and of the backspace plugin
|
|
48466
|
+
.on('keydown', this.__onKeyDown, {
|
|
48467
|
+
top: true
|
|
48468
|
+
});
|
|
48469
|
+
}
|
|
48393
48470
|
jodit.e.on('generateLinkForm.link', this.__generateForm);
|
|
48394
48471
|
jodit.registerCommand('openLinkDialog', {
|
|
48395
48472
|
exec: function exec() {
|
|
@@ -48403,7 +48480,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48403
48480
|
dialog.setContent(htmlForm);
|
|
48404
48481
|
dialog.open();
|
|
48405
48482
|
jodit.async.requestIdleCallback(function() {
|
|
48406
|
-
var url_input = (0,
|
|
48483
|
+
var url_input = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.refs)(htmlForm.container).url_input;
|
|
48407
48484
|
url_input === null || url_input === void 0 ? void 0 : url_input.focus();
|
|
48408
48485
|
});
|
|
48409
48486
|
},
|
|
@@ -48414,10 +48491,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48414
48491
|
{
|
|
48415
48492
|
key: "__onDblClickOnLink",
|
|
48416
48493
|
value: function __onDblClickOnLink(e) {
|
|
48417
|
-
if (!
|
|
48494
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(e.target, 'a')) {
|
|
48418
48495
|
return;
|
|
48419
48496
|
}
|
|
48420
|
-
var href = (0,
|
|
48497
|
+
var href = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(e.target, 'href');
|
|
48421
48498
|
if (href) {
|
|
48422
48499
|
location.href = href;
|
|
48423
48500
|
e.preventDefault();
|
|
@@ -48428,25 +48505,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48428
48505
|
key: "onProcessPasteLink",
|
|
48429
48506
|
value: function onProcessPasteLink(ignore, html) {
|
|
48430
48507
|
var jodit = this.jodit;
|
|
48431
|
-
if (!(0,
|
|
48508
|
+
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isURL)(html) || !jodit.o.link.processPastedLink) {
|
|
48432
48509
|
return;
|
|
48433
48510
|
}
|
|
48434
48511
|
jodit.e.stopPropagation('processPaste');
|
|
48435
48512
|
if (jodit.o.link.processVideoLink) {
|
|
48436
48513
|
var _ref;
|
|
48437
48514
|
var _jodit_o_video, _jodit_o_video1, _jodit_o_video2;
|
|
48438
|
-
var embed = (0,
|
|
48515
|
+
var embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.call)((_ref = (_jodit_o_video = jodit.o.video) === null || _jodit_o_video === void 0 ? void 0 : _jodit_o_video.parseUrlToVideoEmbed) !== null && _ref !== void 0 ? _ref : jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.convertMediaUrlToVideoEmbed, html, {
|
|
48439
48516
|
width: (_jodit_o_video1 = jodit.o.video) === null || _jodit_o_video1 === void 0 ? void 0 : _jodit_o_video1.defaultWidth,
|
|
48440
48517
|
height: (_jodit_o_video2 = jodit.o.video) === null || _jodit_o_video2 === void 0 ? void 0 : _jodit_o_video2.defaultHeight
|
|
48441
48518
|
});
|
|
48442
48519
|
if (embed !== html) {
|
|
48443
|
-
var media = (0,
|
|
48444
|
-
return (0,
|
|
48520
|
+
var media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.prepareEmbedCode)(jodit, embed);
|
|
48521
|
+
return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
|
|
48445
48522
|
}
|
|
48446
48523
|
}
|
|
48447
48524
|
if (jodit.s.isCollapsed()) {
|
|
48448
48525
|
var a = jodit.createInside.element('a');
|
|
48449
|
-
(0,
|
|
48526
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'href', html);
|
|
48450
48527
|
a.textContent = html;
|
|
48451
48528
|
jodit.e.fire('applyLink', jodit, a, null);
|
|
48452
48529
|
return a;
|
|
@@ -48467,16 +48544,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48467
48544
|
var i18n = jodit.i18n.bind(jodit);
|
|
48468
48545
|
var _jodit_o_link = jodit.o.link, openInNewTabCheckbox = _jodit_o_link.openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked = _jodit_o_link.openInNewTabCheckboxDefaultChecked, noFollowCheckbox = _jodit_o_link.noFollowCheckbox, formTemplate = _jodit_o_link.formTemplate, formClassName = _jodit_o_link.formClassName, modeClassName = _jodit_o_link.modeClassName;
|
|
48469
48546
|
var html = formTemplate(jodit);
|
|
48470
|
-
var form = (0,
|
|
48547
|
+
var form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(html) ? jodit.c.fromHTML(html, {
|
|
48471
48548
|
target_checkbox_box: openInNewTabCheckbox,
|
|
48472
48549
|
nofollow_checkbox_box: noFollowCheckbox
|
|
48473
48550
|
}) : html;
|
|
48474
|
-
var htmlForm =
|
|
48475
|
-
var elements = (0,
|
|
48551
|
+
var htmlForm = jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isElement(form) ? form : form.container;
|
|
48552
|
+
var elements = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.refs)(htmlForm);
|
|
48476
48553
|
var insert = elements.insert, unlink = elements.unlink, content_input_box = elements.content_input_box;
|
|
48477
48554
|
var target_checkbox = elements.target_checkbox, nofollow_checkbox = elements.nofollow_checkbox, url_input = elements.url_input;
|
|
48478
48555
|
var currentElement = current;
|
|
48479
|
-
var isImageContent =
|
|
48556
|
+
var isImageContent = jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isImage(currentElement);
|
|
48480
48557
|
var content_input = elements.content_input;
|
|
48481
48558
|
var className_input = elements.className_input, className_select = elements.className_select, aria_label_input = elements.aria_label_input;
|
|
48482
48559
|
if (!content_input) {
|
|
@@ -48489,14 +48566,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48489
48566
|
htmlForm.classList.add(formClassName);
|
|
48490
48567
|
}
|
|
48491
48568
|
if (isImageContent) {
|
|
48492
|
-
|
|
48569
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.hide(content_input_box);
|
|
48493
48570
|
}
|
|
48494
48571
|
var _$link;
|
|
48495
48572
|
var getSelectionText = function getSelectionText() {
|
|
48496
|
-
return _$link ? _$link.innerText : (0,
|
|
48573
|
+
return _$link ? _$link.innerText : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.stripTags)(jodit.s.range.cloneContents(), jodit.ed);
|
|
48497
48574
|
};
|
|
48498
|
-
if (current &&
|
|
48499
|
-
_$link =
|
|
48575
|
+
if (current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(current, 'a', jodit.editor)) {
|
|
48576
|
+
_$link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(current, 'a', jodit.editor);
|
|
48500
48577
|
} else {
|
|
48501
48578
|
_$link = false;
|
|
48502
48579
|
}
|
|
@@ -48504,22 +48581,22 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48504
48581
|
content_input.value = getSelectionText();
|
|
48505
48582
|
}
|
|
48506
48583
|
if (aria_label_input) {
|
|
48507
|
-
aria_label_input.value = _$link ? (0,
|
|
48584
|
+
aria_label_input.value = _$link ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'aria-label') || '' : '';
|
|
48508
48585
|
}
|
|
48509
48586
|
if (_$link) {
|
|
48510
|
-
url_input.value = (0,
|
|
48587
|
+
url_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'href') || '';
|
|
48511
48588
|
if (modeClassName) {
|
|
48512
48589
|
readClassnames(modeClassName, className_input, _$link, className_select);
|
|
48513
48590
|
}
|
|
48514
48591
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
48515
|
-
target_checkbox.checked = (0,
|
|
48592
|
+
target_checkbox.checked = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'target') === '_blank';
|
|
48516
48593
|
}
|
|
48517
48594
|
if (noFollowCheckbox && nofollow_checkbox) {
|
|
48518
|
-
nofollow_checkbox.checked = ((0,
|
|
48595
|
+
nofollow_checkbox.checked = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'rel') || '').split(/\s+/).includes('nofollow');
|
|
48519
48596
|
}
|
|
48520
48597
|
insert.textContent = i18n('Update');
|
|
48521
48598
|
} else {
|
|
48522
|
-
|
|
48599
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.hide(unlink);
|
|
48523
48600
|
if (jodit.o.link.deriveUrlFromText && url_input && !isImageContent && !url_input.value.trim()) {
|
|
48524
48601
|
url_input.value = guessUrlFromText(content_input.value);
|
|
48525
48602
|
}
|
|
@@ -48534,7 +48611,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48534
48611
|
jodit.s.restore();
|
|
48535
48612
|
jodit.history.snapshot.restore(snapshot);
|
|
48536
48613
|
if (_$link) {
|
|
48537
|
-
|
|
48614
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.unwrap(_$link);
|
|
48538
48615
|
}
|
|
48539
48616
|
jodit.synchronizeValues();
|
|
48540
48617
|
close();
|
|
@@ -48555,12 +48632,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48555
48632
|
var textWasChanged = getSelectionText() !== content_input.value.trim();
|
|
48556
48633
|
var ci = jodit.createInside;
|
|
48557
48634
|
var caretAfter = null;
|
|
48558
|
-
if (!_$link || !
|
|
48635
|
+
if (!_$link || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(jodit.editor, _$link)) {
|
|
48559
48636
|
if (!jodit.s.isCollapsed()) {
|
|
48560
48637
|
var node = jodit.s.current();
|
|
48561
|
-
if (
|
|
48638
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(node, 'img')) {
|
|
48562
48639
|
links = [
|
|
48563
|
-
|
|
48640
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.wrap(node, 'a', ci)
|
|
48564
48641
|
];
|
|
48565
48642
|
} else {
|
|
48566
48643
|
links = jodit.s.wrapInTag('a');
|
|
@@ -48582,27 +48659,27 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48582
48659
|
];
|
|
48583
48660
|
}
|
|
48584
48661
|
links.forEach(function(a) {
|
|
48585
|
-
;(0,
|
|
48662
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'href', url_input.value);
|
|
48586
48663
|
writeClasses(modeClassName, className_input, className_select, a);
|
|
48587
48664
|
if (!isImageContent) {
|
|
48588
48665
|
writeImage(a, content_input, textWasChanged, url_input);
|
|
48589
48666
|
}
|
|
48590
48667
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
48591
|
-
(0,
|
|
48668
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'target', target_checkbox.checked ? '_blank' : null);
|
|
48592
48669
|
}
|
|
48593
48670
|
if (noFollowCheckbox && nofollow_checkbox) {
|
|
48594
|
-
var relParts = ((0,
|
|
48671
|
+
var relParts = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'rel') || '').split(/\s+/).filter(Boolean);
|
|
48595
48672
|
var hasNofollow = relParts.includes('nofollow');
|
|
48596
48673
|
if (nofollow_checkbox.checked && !hasNofollow) {
|
|
48597
48674
|
relParts.push('nofollow');
|
|
48598
48675
|
} else if (!nofollow_checkbox.checked && hasNofollow) {
|
|
48599
48676
|
relParts.splice(relParts.indexOf('nofollow'), 1);
|
|
48600
48677
|
}
|
|
48601
|
-
;(0,
|
|
48678
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'rel', relParts.length ? relParts.join(' ') : null);
|
|
48602
48679
|
}
|
|
48603
48680
|
if (aria_label_input) {
|
|
48604
48681
|
var ariaLabel = aria_label_input.value.trim();
|
|
48605
|
-
(0,
|
|
48682
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'aria-label', ariaLabel || null);
|
|
48606
48683
|
}
|
|
48607
48684
|
jodit.e.fire('applyLink', jodit, a, form);
|
|
48608
48685
|
});
|
|
@@ -48617,7 +48694,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48617
48694
|
close();
|
|
48618
48695
|
return false;
|
|
48619
48696
|
};
|
|
48620
|
-
if (
|
|
48697
|
+
if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isElement(form)) {
|
|
48621
48698
|
jodit.e.on(form, 'submit', function(event) {
|
|
48622
48699
|
event.preventDefault();
|
|
48623
48700
|
event.stopImmediatePropagation();
|
|
@@ -48633,34 +48710,170 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48633
48710
|
{
|
|
48634
48711
|
key: "beforeDestruct",
|
|
48635
48712
|
value: /** @override */ function beforeDestruct(jodit) {
|
|
48636
|
-
jodit.e.off('generateLinkForm.link', this.__generateForm).off('dblclick.link', this.__onDblClickOnLink).off(jodit.editor, 'click.link', this.__onClickReadOnlyLink).off('processPaste.link', this.onProcessPasteLink);
|
|
48713
|
+
jodit.e.off('generateLinkForm.link', this.__generateForm).off('dblclick.link', this.__onDblClickOnLink).off(jodit.editor, 'click.link', this.__onClickReadOnlyLink).off('processPaste.link', this.onProcessPasteLink).off('input.link', this.__onTypedSpace).off('beforeEnter.link', this.__onBeforeEnter).off('afterEnter.link', this.__onAfterEnter).off('mousedown.link blur.link beforeCommand.link', this.__forgetLink).off('keydown', this.__onKeyDown);
|
|
48714
|
+
}
|
|
48715
|
+
},
|
|
48716
|
+
{
|
|
48717
|
+
key: "__onTypedSpace",
|
|
48718
|
+
value: function __onTypedSpace(event) {
|
|
48719
|
+
if (event.inputType !== 'insertText' || !event.data || /\S/.test(event.data)) {
|
|
48720
|
+
return;
|
|
48721
|
+
}
|
|
48722
|
+
var range = this.j.s.range;
|
|
48723
|
+
if (range.collapsed) {
|
|
48724
|
+
this.__linkTyped(range.startContainer, range.startOffset - event.data.length);
|
|
48725
|
+
}
|
|
48726
|
+
}
|
|
48727
|
+
},
|
|
48728
|
+
{
|
|
48729
|
+
key: "__onBeforeEnter",
|
|
48730
|
+
value: function __onBeforeEnter() {
|
|
48731
|
+
var range = this.j.s.range;
|
|
48732
|
+
this.__enteredAt = range.collapsed ? [
|
|
48733
|
+
range.startContainer,
|
|
48734
|
+
range.startOffset
|
|
48735
|
+
] : null;
|
|
48736
|
+
}
|
|
48737
|
+
},
|
|
48738
|
+
{
|
|
48739
|
+
key: "__onAfterEnter",
|
|
48740
|
+
value: function __onAfterEnter() {
|
|
48741
|
+
if (this.__enteredAt) {
|
|
48742
|
+
this.__linkAfterEnter.apply(this, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_6__._)(this.__enteredAt));
|
|
48743
|
+
this.__enteredAt = null;
|
|
48744
|
+
}
|
|
48745
|
+
}
|
|
48746
|
+
},
|
|
48747
|
+
{
|
|
48748
|
+
key: "__forgetLink",
|
|
48749
|
+
value: function __forgetLink() {
|
|
48750
|
+
this.__justLinked = null;
|
|
48751
|
+
}
|
|
48752
|
+
},
|
|
48753
|
+
{
|
|
48754
|
+
key: "__onKeyDown",
|
|
48755
|
+
value: function __onKeyDown(event) {
|
|
48756
|
+
var jodit = this.jodit;
|
|
48757
|
+
if (jodit.o.readonly) {
|
|
48758
|
+
return;
|
|
48759
|
+
}
|
|
48760
|
+
var _$link = this.__justLinked;
|
|
48761
|
+
var modified = event.ctrlKey || event.metaKey || event.altKey;
|
|
48762
|
+
if (!MODIFIER_KEYS.has(event.key)) {
|
|
48763
|
+
this.__justLinked = null;
|
|
48764
|
+
}
|
|
48765
|
+
if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.KEY_BACKSPACE && !modified && (_$link === null || _$link === void 0 ? void 0 : _$link.isConnected)) {
|
|
48766
|
+
this.__recordStep();
|
|
48767
|
+
jodit.s.save();
|
|
48768
|
+
jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.unwrap(_$link);
|
|
48769
|
+
jodit.s.restore();
|
|
48770
|
+
this.__recordStep();
|
|
48771
|
+
// Or the backspace plugin takes a character too
|
|
48772
|
+
jodit.e.stopPropagation('keydown');
|
|
48773
|
+
return false;
|
|
48774
|
+
}
|
|
48775
|
+
var range = jodit.s.range;
|
|
48776
|
+
if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.KEY_TAB && !modified && range.collapsed) {
|
|
48777
|
+
this.__linkTyped(range.startContainer, range.startOffset);
|
|
48778
|
+
}
|
|
48779
|
+
}
|
|
48780
|
+
},
|
|
48781
|
+
{
|
|
48782
|
+
key: "__linkTyped",
|
|
48783
|
+
value: /**
|
|
48784
|
+
* Links the address that ends at `end` in a text node, as a step of its
|
|
48785
|
+
* own in the history, so Undo straight after takes the link off and
|
|
48786
|
+
* leaves the text
|
|
48787
|
+
*/ function __linkTyped(node, end) {
|
|
48788
|
+
var jodit = this.jodit;
|
|
48789
|
+
if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isText(node) || !node.isConnected || end < 0 || end > node.length || jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(node, NO_TYPED_LINKS, jodit.editor)) {
|
|
48790
|
+
return;
|
|
48791
|
+
}
|
|
48792
|
+
var found = (0,_typed_link__WEBPACK_IMPORTED_MODULE_16__.findTypedLink)(node.data, end, jodit.o.link.typedLinkTlds, jodit.o.link.typedLinkFileEndings);
|
|
48793
|
+
if (!found) {
|
|
48794
|
+
return;
|
|
48795
|
+
}
|
|
48796
|
+
var _found = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(found, 3), start = _found[0], stop = _found[1], href = _found[2];
|
|
48797
|
+
this.__recordStep();
|
|
48798
|
+
// The text round the caret splits, and WebKit doesn't keep the caret
|
|
48799
|
+
// where it was
|
|
48800
|
+
jodit.s.save();
|
|
48801
|
+
var range = jodit.ed.createRange();
|
|
48802
|
+
range.setStart(node, start);
|
|
48803
|
+
range.setEnd(node, stop);
|
|
48804
|
+
var a = jodit.createInside.element('a');
|
|
48805
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'href', href);
|
|
48806
|
+
range.surroundContents(a);
|
|
48807
|
+
jodit.s.restore();
|
|
48808
|
+
jodit.e.fire('applyLink', jodit, a, null);
|
|
48809
|
+
this.__recordStep();
|
|
48810
|
+
this.__justLinked = a;
|
|
48811
|
+
}
|
|
48812
|
+
},
|
|
48813
|
+
{
|
|
48814
|
+
key: "__recordStep",
|
|
48815
|
+
value: /**
|
|
48816
|
+
* Reports what's changed and makes it a history step of its own
|
|
48817
|
+
*/ function __recordStep() {
|
|
48818
|
+
this.j.setEditorValue();
|
|
48819
|
+
this.j.e.fire('internalChange');
|
|
48637
48820
|
}
|
|
48638
48821
|
},
|
|
48639
48822
|
{
|
|
48640
48823
|
key: "__onClickReadOnlyLink",
|
|
48641
48824
|
value: function __onClickReadOnlyLink(e) {
|
|
48642
48825
|
var jodit = this.jodit;
|
|
48643
|
-
if (jodit.o.readonly && jodit.o.link.preventReadOnlyNavigation &&
|
|
48826
|
+
if (jodit.o.readonly && jodit.o.link.preventReadOnlyNavigation && jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(e.target, 'a')) {
|
|
48644
48827
|
e.preventDefault();
|
|
48645
48828
|
}
|
|
48646
48829
|
}
|
|
48647
48830
|
}
|
|
48648
48831
|
]);
|
|
48649
48832
|
return link;
|
|
48650
|
-
}((0,
|
|
48651
|
-
(0,
|
|
48652
|
-
|
|
48833
|
+
}((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_8__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_14__.Plugin));
|
|
48834
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48835
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48653
48836
|
], link.prototype, "__onDblClickOnLink", null);
|
|
48654
|
-
(0,
|
|
48655
|
-
|
|
48837
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48838
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48656
48839
|
], link.prototype, "onProcessPasteLink", null);
|
|
48657
|
-
(0,
|
|
48658
|
-
|
|
48840
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48841
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48659
48842
|
], link.prototype, "__generateForm", null);
|
|
48660
|
-
(0,
|
|
48661
|
-
|
|
48843
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48844
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48845
|
+
], link.prototype, "__onTypedSpace", null);
|
|
48846
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48847
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48848
|
+
], link.prototype, "__onBeforeEnter", null);
|
|
48849
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48850
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48851
|
+
], link.prototype, "__onAfterEnter", null);
|
|
48852
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48853
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48854
|
+
], link.prototype, "__forgetLink", null);
|
|
48855
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48856
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48857
|
+
], link.prototype, "__onKeyDown", null);
|
|
48858
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48859
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48860
|
+
], link.prototype, "__linkTyped", null);
|
|
48861
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
|
|
48862
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
|
|
48662
48863
|
], link.prototype, "__onClickReadOnlyLink", null);
|
|
48663
|
-
|
|
48864
|
+
var NO_TYPED_LINKS = new Set([
|
|
48865
|
+
'a',
|
|
48866
|
+
'pre',
|
|
48867
|
+
'code'
|
|
48868
|
+
]);
|
|
48869
|
+
var MODIFIER_KEYS = new Set([
|
|
48870
|
+
'Shift',
|
|
48871
|
+
'Control',
|
|
48872
|
+
'Alt',
|
|
48873
|
+
'Meta',
|
|
48874
|
+
'CapsLock'
|
|
48875
|
+
]);
|
|
48876
|
+
jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('link', link);
|
|
48664
48877
|
/**
|
|
48665
48878
|
* Guess a usable `href` from the selected text for the link dialog.
|
|
48666
48879
|
* Returns an empty string when the text is not a plausible URL/email,
|
|
@@ -48675,7 +48888,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('link', link);
|
|
|
48675
48888
|
return value;
|
|
48676
48889
|
}
|
|
48677
48890
|
// email address -> mailto:
|
|
48678
|
-
if (
|
|
48891
|
+
if (_typed_link__WEBPACK_IMPORTED_MODULE_16__.EMAIL.test(value)) {
|
|
48679
48892
|
return "mailto:".concat(value);
|
|
48680
48893
|
}
|
|
48681
48894
|
// bare domain like example.com or www.example.com/path -> https://
|
|
@@ -48688,14 +48901,14 @@ function writeClasses(modeClassName, className_input, className_select, a) {
|
|
|
48688
48901
|
if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
|
|
48689
48902
|
if (modeClassName === 'input') {
|
|
48690
48903
|
if (className_input.value === '' && a.hasAttribute('class')) {
|
|
48691
|
-
(0,
|
|
48904
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'class', null);
|
|
48692
48905
|
}
|
|
48693
48906
|
if (className_input.value !== '') {
|
|
48694
|
-
(0,
|
|
48907
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'class', className_input.value);
|
|
48695
48908
|
}
|
|
48696
48909
|
} else if (modeClassName === 'select') {
|
|
48697
48910
|
if (a.hasAttribute('class')) {
|
|
48698
|
-
(0,
|
|
48911
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'class', null);
|
|
48699
48912
|
}
|
|
48700
48913
|
for(var i = 0; i < className_select.selectedOptions.length; i++){
|
|
48701
48914
|
var _className_select_selectedOptions_item;
|
|
@@ -48715,7 +48928,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
|
|
|
48715
48928
|
switch(modeClassName){
|
|
48716
48929
|
case 'input':
|
|
48717
48930
|
if (className_input) {
|
|
48718
|
-
className_input.value = (0,
|
|
48931
|
+
className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(link, 'class') || '';
|
|
48719
48932
|
}
|
|
48720
48933
|
break;
|
|
48721
48934
|
case 'select':
|
|
@@ -48726,7 +48939,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
|
|
|
48726
48939
|
option.selected = false;
|
|
48727
48940
|
}
|
|
48728
48941
|
}
|
|
48729
|
-
var classNames = (0,
|
|
48942
|
+
var classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(link, 'class') || '';
|
|
48730
48943
|
classNames.split(/\s+/).filter(function(cn) {
|
|
48731
48944
|
return cn.trim().length > 0;
|
|
48732
48945
|
}).forEach(function(className) {
|
|
@@ -48860,6 +49073,141 @@ var formTemplate = function formTemplate(editor) {
|
|
|
48860
49073
|
};
|
|
48861
49074
|
|
|
48862
49075
|
|
|
49076
|
+
/***/ }),
|
|
49077
|
+
|
|
49078
|
+
/***/ 4441:
|
|
49079
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
49080
|
+
|
|
49081
|
+
"use strict";
|
|
49082
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
49083
|
+
/* harmony export */ TLDS: function() { return /* binding */ TLDS; }
|
|
49084
|
+
/* harmony export */ });
|
|
49085
|
+
/*!
|
|
49086
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
49087
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
49088
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
49089
|
+
*/ /**
|
|
49090
|
+
* @module plugins/link
|
|
49091
|
+
*/ /**
|
|
49092
|
+
* The endings a bare domain links with, besides those `link.typedLinkTlds`
|
|
49093
|
+
* adds: the generic ones of at least 1 in 1,000 of the sites in Tranco's top
|
|
49094
|
+
* million (list GQ38K, https://tranco-list.eu/list/GQ38K), then every
|
|
49095
|
+
* two-letter one in IANA's list (version 2026102900,
|
|
49096
|
+
* https://data.iana.org/TLD/tlds-alpha-by-domain.txt). Together they're the
|
|
49097
|
+
* endings of 96% of those sites
|
|
49098
|
+
* @private
|
|
49099
|
+
*/ var TLDS = new Set("\n app biz casino click cloud club com dev edu gov info live net online org pro\n shop site space store tech top vip xyz\n ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi\n bj bm bn bo br bs bt bv bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu\n cv cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga\n gb gd ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id\n ie il im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la\n lb lc li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms\n mt mu mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph\n pk pl pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sj sk\n sl sm sn so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt\n tv tw tz ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw\n".trim().split(/\s+/));
|
|
49100
|
+
|
|
49101
|
+
|
|
49102
|
+
/***/ }),
|
|
49103
|
+
|
|
49104
|
+
/***/ 99763:
|
|
49105
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
49106
|
+
|
|
49107
|
+
"use strict";
|
|
49108
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
49109
|
+
/* harmony export */ EMAIL: function() { return /* binding */ EMAIL; },
|
|
49110
|
+
/* harmony export */ findTypedLink: function() { return /* binding */ findTypedLink; }
|
|
49111
|
+
/* harmony export */ });
|
|
49112
|
+
/* harmony import */ var jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91764);
|
|
49113
|
+
/* harmony import */ var _tlds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4441);
|
|
49114
|
+
/*!
|
|
49115
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
49116
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
49117
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
49118
|
+
*/ /**
|
|
49119
|
+
* @module plugins/link
|
|
49120
|
+
*/
|
|
49121
|
+
|
|
49122
|
+
/**
|
|
49123
|
+
* An email address, for `mailto:`
|
|
49124
|
+
* @private
|
|
49125
|
+
*/ var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
49126
|
+
var OPENING = new Set([
|
|
49127
|
+
'(',
|
|
49128
|
+
'[',
|
|
49129
|
+
'"',
|
|
49130
|
+
"'",
|
|
49131
|
+
'“',
|
|
49132
|
+
'‘',
|
|
49133
|
+
'<'
|
|
49134
|
+
]);
|
|
49135
|
+
var CLOSING = new Set([
|
|
49136
|
+
'.',
|
|
49137
|
+
',',
|
|
49138
|
+
';',
|
|
49139
|
+
':',
|
|
49140
|
+
'!',
|
|
49141
|
+
'?',
|
|
49142
|
+
'"',
|
|
49143
|
+
"'",
|
|
49144
|
+
'”',
|
|
49145
|
+
'’',
|
|
49146
|
+
'>'
|
|
49147
|
+
]);
|
|
49148
|
+
var BRACKETS = {
|
|
49149
|
+
')': '(',
|
|
49150
|
+
']': '['
|
|
49151
|
+
};
|
|
49152
|
+
var LABEL = /^[a-z\d][a-z\d-]{0,62}$/i;
|
|
49153
|
+
/**
|
|
49154
|
+
* The address that ends at `end` in a line of text typed, back to the
|
|
49155
|
+
* whitespace before it, as `[start, end, href]`. Punctuation round it, such as
|
|
49156
|
+
* a sentence's full stop or a bracket the address doesn't open, stays out.
|
|
49157
|
+
* An address counts with a scheme, with `www.`, as an email address, or as a
|
|
49158
|
+
* bare domain that `isBareDomain` accepts, so `Node.js` or `e.g.` don't
|
|
49159
|
+
* @private
|
|
49160
|
+
*/ function findTypedLink(text, end, tlds, fileEndings) {
|
|
49161
|
+
var start = end;
|
|
49162
|
+
while(start > 0 && !/\s/.test(text[start - 1])){
|
|
49163
|
+
start -= 1;
|
|
49164
|
+
}
|
|
49165
|
+
while(start < end && OPENING.has(text[start])){
|
|
49166
|
+
start += 1;
|
|
49167
|
+
}
|
|
49168
|
+
while(end > start){
|
|
49169
|
+
var char = text[end - 1];
|
|
49170
|
+
var opening = BRACKETS[char];
|
|
49171
|
+
if (CLOSING.has(char) || opening && !text.slice(start, end - 1).includes(opening)) {
|
|
49172
|
+
end -= 1;
|
|
49173
|
+
} else {
|
|
49174
|
+
break;
|
|
49175
|
+
}
|
|
49176
|
+
}
|
|
49177
|
+
var href = typedLinkHref(text.slice(start, end), tlds, fileEndings);
|
|
49178
|
+
return href ? [
|
|
49179
|
+
start,
|
|
49180
|
+
end,
|
|
49181
|
+
href
|
|
49182
|
+
] : null;
|
|
49183
|
+
}
|
|
49184
|
+
function typedLinkHref(address, tlds, fileEndings) {
|
|
49185
|
+
var email = address.replace(/^mailto:/i, '');
|
|
49186
|
+
if (EMAIL.test(email)) {
|
|
49187
|
+
return "mailto:".concat(email);
|
|
49188
|
+
}
|
|
49189
|
+
if (/^www\.[^\s.]+\.\S+$/i.test(address) || isBareDomain(address, tlds, fileEndings)) {
|
|
49190
|
+
return "https://".concat(address);
|
|
49191
|
+
}
|
|
49192
|
+
return /^[a-z][a-z\d+.-]*:\/\//i.test(address) && (0,jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_0__.isURL)(address) ? address : '';
|
|
49193
|
+
}
|
|
49194
|
+
/**
|
|
49195
|
+
* A domain typed without a scheme or `www.`, as `example.com`, `elections.nz`
|
|
49196
|
+
* or `bit.ly/enrol`. Its ending has to be in `TLDS` or `tlds`, typed in lower
|
|
49197
|
+
* case, so `Node.js` and a sentence run on, as in `home.It`, don't count, and
|
|
49198
|
+
* not in `fileEndings`, as in `photos.zip`. The first part has a letter,
|
|
49199
|
+
* which leaves out a time or a numbered step such as `11.am`
|
|
49200
|
+
*/ function isBareDomain(address, tlds, fileEndings) {
|
|
49201
|
+
var cut = address.search(/[/?#]/);
|
|
49202
|
+
var host = cut < 0 ? address : address.slice(0, cut);
|
|
49203
|
+
var labels = host.split('.');
|
|
49204
|
+
var ending = labels[labels.length - 1];
|
|
49205
|
+
return labels.length > 1 && labels.every(function(label) {
|
|
49206
|
+
return LABEL.test(label) && !label.endsWith('-');
|
|
49207
|
+
}) && (_tlds__WEBPACK_IMPORTED_MODULE_1__.TLDS.has(ending) || tlds.includes(ending)) && !fileEndings.includes(ending) && /[a-z]/i.test(labels[0]);
|
|
49208
|
+
}
|
|
49209
|
+
|
|
49210
|
+
|
|
48863
49211
|
/***/ }),
|
|
48864
49212
|
|
|
48865
49213
|
/***/ 51730:
|