jodit 4.15.18 → 4.16.1
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 +18 -0
- package/es2015/jodit.css +11 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +10 -9
- package/es2015/jodit.js +116 -50
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +10 -9
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +10 -9
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +10 -9
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +11 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +11 -10
- package/es2021/jodit.js +116 -50
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +11 -10
- 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 +11 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +11 -10
- package/es2021.en/jodit.js +116 -50
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +11 -10
- 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 +15 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +131 -56
- package/es5/jodit.min.css +3 -3
- 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/core/constants.js +1 -1
- package/esm/core/ui/button/button/button.js +10 -4
- package/esm/core/ui/form/inputs/file/file.js +1 -0
- package/esm/core/ui/group/group.d.ts +4 -0
- package/esm/core/ui/group/group.js +5 -1
- package/esm/core/ui/group/list.js +2 -2
- package/esm/modules/dialog/dialog.js +7 -0
- package/esm/modules/toolbar/button/content.d.ts +7 -0
- package/esm/modules/toolbar/button/content.js +9 -1
- package/esm/plugins/iframe/config.js +4 -0
- package/esm/plugins/image-processor/image-processor.d.ts +5 -0
- package/esm/plugins/image-processor/image-processor.js +29 -2
- package/esm/plugins/source/editor/engines/ace.js +13 -6
- package/esm/plugins/source/source.js +16 -1
- package/package.json +1 -1
- package/types/core/ui/group/group.d.ts +4 -0
- package/types/modules/toolbar/button/content.d.ts +7 -0
- package/types/plugins/image-processor/image-processor.d.ts +5 -0
package/es2021/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.
|
|
4
|
+
* Version: v4.16.1
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1799,7 +1799,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1799
1799
|
* ```
|
|
1800
1800
|
* @packageDocumentation
|
|
1801
1801
|
* @module constants
|
|
1802
|
-
*/ const APP_VERSION = "4.
|
|
1802
|
+
*/ const APP_VERSION = "4.16.1";
|
|
1803
1803
|
// prettier-ignore
|
|
1804
1804
|
const ES = "es2021";
|
|
1805
1805
|
const IS_ES_MODERN = true;
|
|
@@ -14332,6 +14332,7 @@ class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIEle
|
|
|
14332
14332
|
this.name = this.state.name;
|
|
14333
14333
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'data-ref', this.state.name);
|
|
14334
14334
|
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'ref', this.state.name);
|
|
14335
|
+
this.updateAriaLabel();
|
|
14335
14336
|
}
|
|
14336
14337
|
onChangeTooltip() {
|
|
14337
14338
|
const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
|
|
@@ -14343,9 +14344,12 @@ class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIEle
|
|
|
14343
14344
|
}
|
|
14344
14345
|
updateAriaLabel() {
|
|
14345
14346
|
const hasText = this.state.text.trim().length > 0;
|
|
14346
|
-
|
|
14347
|
-
(
|
|
14348
|
-
|
|
14347
|
+
// An icon-only button without a tooltip would have no accessible
|
|
14348
|
+
// name at all — fall back to its raw name (not translated: control
|
|
14349
|
+
// names are identifiers, not i18n keys).
|
|
14350
|
+
const label = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : !hasText && this.state.name ? this.state.name : null;
|
|
14351
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', label);
|
|
14352
|
+
(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', !hasText ? label : null);
|
|
14349
14353
|
}
|
|
14350
14354
|
onChangeTabIndex() {
|
|
14351
14355
|
;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'tabindex', this.state.tabIndex);
|
|
@@ -15361,6 +15365,7 @@ class UIFileInput extends jodit_core_ui_form_inputs_input_input__WEBPACK_IMPORTE
|
|
|
15361
15365
|
return this.j.create.fromHTML(`<input
|
|
15362
15366
|
type="file"
|
|
15363
15367
|
accept="${options.onlyImages ? 'image/*' : '*'}"
|
|
15368
|
+
aria-label="${this.j.i18n(options.tooltip || 'Upload')}"
|
|
15364
15369
|
tabindex="-1"
|
|
15365
15370
|
dir="auto"
|
|
15366
15371
|
multiple=""
|
|
@@ -15859,8 +15864,11 @@ class UIGroup extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_6__.UIEleme
|
|
|
15859
15864
|
className() {
|
|
15860
15865
|
return 'UIGroup';
|
|
15861
15866
|
}
|
|
15862
|
-
|
|
15863
|
-
|
|
15867
|
+
/**
|
|
15868
|
+
* A generic container: `group` allows any children. Toolbar button groups
|
|
15869
|
+
* are lists of `listitem`s and get `role="list"` explicitly from `UIList`.
|
|
15870
|
+
*/ getRole() {
|
|
15871
|
+
return this.options?.role || 'group';
|
|
15864
15872
|
}
|
|
15865
15873
|
/**
|
|
15866
15874
|
* All group children
|
|
@@ -16063,10 +16071,10 @@ class UIList extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGr
|
|
|
16063
16071
|
}
|
|
16064
16072
|
/**
|
|
16065
16073
|
* Make new group and append it in list of elements
|
|
16066
|
-
*/ makeGroup(role) {
|
|
16067
|
-
return new jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGroup(this.jodit, [],
|
|
16074
|
+
*/ makeGroup(role = 'list') {
|
|
16075
|
+
return new jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGroup(this.jodit, [], {
|
|
16068
16076
|
role
|
|
16069
|
-
}
|
|
16077
|
+
});
|
|
16070
16078
|
}
|
|
16071
16079
|
/**
|
|
16072
16080
|
* All buttons from list
|
|
@@ -19133,13 +19141,14 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
|
|
|
19133
19141
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
|
|
19134
19142
|
/* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(45664);
|
|
19135
19143
|
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28686);
|
|
19136
|
-
/* harmony import */ var
|
|
19137
|
-
/* harmony import */ var
|
|
19138
|
-
/* harmony import */ var
|
|
19139
|
-
/* harmony import */ var
|
|
19140
|
-
/* harmony import */ var
|
|
19141
|
-
/* harmony import */ var
|
|
19142
|
-
/* harmony import */ var
|
|
19144
|
+
/* harmony import */ var jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22852);
|
|
19145
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93640);
|
|
19146
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(28712);
|
|
19147
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__);
|
|
19148
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4099);
|
|
19149
|
+
/* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(35099);
|
|
19150
|
+
/* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2222);
|
|
19151
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5266);
|
|
19143
19152
|
/*!
|
|
19144
19153
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
19145
19154
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -19162,7 +19171,8 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
|
|
|
19162
19171
|
|
|
19163
19172
|
|
|
19164
19173
|
|
|
19165
|
-
|
|
19174
|
+
|
|
19175
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.dialog = {
|
|
19166
19176
|
namespace: '',
|
|
19167
19177
|
extraButtons: [],
|
|
19168
19178
|
/**
|
|
@@ -19178,7 +19188,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog = {
|
|
|
19178
19188
|
toolbarButtonSize: 'middle',
|
|
19179
19189
|
zIndex: 'inherit'
|
|
19180
19190
|
};
|
|
19181
|
-
|
|
19191
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.controls.dialog = {
|
|
19182
19192
|
close: {
|
|
19183
19193
|
icon: 'cancel',
|
|
19184
19194
|
exec: (dialog)=>{
|
|
@@ -19186,7 +19196,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.dialog = {
|
|
|
19186
19196
|
}
|
|
19187
19197
|
}
|
|
19188
19198
|
};
|
|
19189
|
-
class Dialog extends
|
|
19199
|
+
class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__.ViewWithToolbar {
|
|
19190
19200
|
/** @override */ className() {
|
|
19191
19201
|
return 'Dialog';
|
|
19192
19202
|
}
|
|
@@ -19250,8 +19260,8 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19250
19260
|
this.draggable = true;
|
|
19251
19261
|
this.startX = e.clientX;
|
|
19252
19262
|
this.startY = e.clientY;
|
|
19253
|
-
this.startPoint.x = (0,
|
|
19254
|
-
this.startPoint.y = (0,
|
|
19263
|
+
this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'left');
|
|
19264
|
+
this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'top');
|
|
19255
19265
|
this.setMaxZIndex();
|
|
19256
19266
|
if (e.cancelable) {
|
|
19257
19267
|
e.preventDefault();
|
|
@@ -19340,7 +19350,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19340
19350
|
if (h == null) {
|
|
19341
19351
|
h = this.dialog.offsetHeight;
|
|
19342
19352
|
}
|
|
19343
|
-
;(0,
|
|
19353
|
+
;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
|
|
19344
19354
|
width: w,
|
|
19345
19355
|
height: h
|
|
19346
19356
|
});
|
|
@@ -19374,7 +19384,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19374
19384
|
this.moved = Math.abs(x - left) > 100 || Math.abs(y - top) > 100;
|
|
19375
19385
|
}
|
|
19376
19386
|
// strings on purpose: `css()` would truncate fractional pixels
|
|
19377
|
-
;(0,
|
|
19387
|
+
;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
|
|
19378
19388
|
left: (x || left) + 'px',
|
|
19379
19389
|
top: (y || top) + 'px'
|
|
19380
19390
|
});
|
|
@@ -19394,6 +19404,12 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19394
19404
|
* ```
|
|
19395
19405
|
*/ setHeader(content) {
|
|
19396
19406
|
this.setElements(this.dialogbox_header, content);
|
|
19407
|
+
// `role="dialog"` needs an accessible name; a text title is the
|
|
19408
|
+
// natural one (element titles are left to the caller).
|
|
19409
|
+
if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isString)(content)) {
|
|
19410
|
+
const name = (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__.stripTags)(content, this.od).trim();
|
|
19411
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', name || null);
|
|
19412
|
+
}
|
|
19397
19413
|
return this;
|
|
19398
19414
|
}
|
|
19399
19415
|
/**
|
|
@@ -19447,7 +19463,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19447
19463
|
/**
|
|
19448
19464
|
* Get zIndex from dialog
|
|
19449
19465
|
*/ getZIndex() {
|
|
19450
|
-
return parseInt((0,
|
|
19466
|
+
return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex'), 10) || 0;
|
|
19451
19467
|
}
|
|
19452
19468
|
/**
|
|
19453
19469
|
* Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
|
|
@@ -19470,7 +19486,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19470
19486
|
this.__openedSiblings().forEach((dialog)=>{
|
|
19471
19487
|
maxZIndex = Math.max(dialog.getZIndex(), maxZIndex);
|
|
19472
19488
|
});
|
|
19473
|
-
(0,
|
|
19489
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
|
|
19474
19490
|
}
|
|
19475
19491
|
/**
|
|
19476
19492
|
* Expands the dialog on full browser window
|
|
@@ -19520,7 +19536,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19520
19536
|
this.setPosition(this.offsetX, this.offsetY);
|
|
19521
19537
|
this.setMaxZIndex();
|
|
19522
19538
|
} else {
|
|
19523
|
-
(0,
|
|
19539
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', null);
|
|
19524
19540
|
}
|
|
19525
19541
|
if (this.o.fullsize) {
|
|
19526
19542
|
this.toggleFullSize(true);
|
|
@@ -19634,7 +19650,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19634
19650
|
* True, if dialog was opened
|
|
19635
19651
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isOpened", false);
|
|
19636
19652
|
const self1 = this;
|
|
19637
|
-
self1.options = (0,
|
|
19653
|
+
self1.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.dialog, Dialog.defaultOptions));
|
|
19638
19654
|
// Attach event handlers passed via `options.events` to the dialog's own
|
|
19639
19655
|
// emitter (as FileBrowser already does), so a consumer — e.g. a plugin
|
|
19640
19656
|
// forwarding the editor's `events` config — can observe `afterOpen` /
|
|
@@ -19652,40 +19668,40 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19652
19668
|
</div>
|
|
19653
19669
|
<div class="${n('content')}"></div>
|
|
19654
19670
|
<div class="${n('footer')}"></div>
|
|
19655
|
-
<div class="${n('resizer')}">${
|
|
19671
|
+
<div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__.Icon.get('resize_handler')}</div>
|
|
19656
19672
|
</div>
|
|
19657
19673
|
</div>`);
|
|
19658
19674
|
if (self1.options.direction === 'rtl') {
|
|
19659
|
-
(0,
|
|
19660
|
-
(0,
|
|
19675
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.container, 'direction', 'rtl');
|
|
19676
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'dir', 'rtl');
|
|
19661
19677
|
}
|
|
19662
19678
|
if (this.o.zIndex) {
|
|
19663
|
-
(0,
|
|
19679
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', this.o.zIndex.toString());
|
|
19664
19680
|
}
|
|
19665
|
-
;(0,
|
|
19681
|
+
;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'role', 'dialog');
|
|
19666
19682
|
Object.defineProperty(self1.container, 'component', {
|
|
19667
19683
|
value: this
|
|
19668
19684
|
});
|
|
19669
19685
|
self1.setMod('theme', self1.o.theme || 'default').setMod('resizable', Boolean(self1.o.resizable));
|
|
19670
19686
|
const dialog = self1.getElm('panel');
|
|
19671
|
-
(0,
|
|
19687
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialog != null, 'Panel element does not exist');
|
|
19672
19688
|
const resizer = self1.getElm('resizer');
|
|
19673
|
-
(0,
|
|
19689
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(resizer != null, 'Resizer element does not exist');
|
|
19674
19690
|
const dialogbox_header = self1.getElm('header-title');
|
|
19675
|
-
(0,
|
|
19691
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_header != null, 'header-title element does not exist');
|
|
19676
19692
|
const dialogbox_content = self1.getElm('content');
|
|
19677
|
-
(0,
|
|
19693
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_content != null, 'Content element does not exist');
|
|
19678
19694
|
const dialogbox_footer = self1.getElm('footer');
|
|
19679
|
-
(0,
|
|
19695
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_footer != null, 'Footer element does not exist');
|
|
19680
19696
|
const dialogbox_toolbar = self1.getElm('header-toolbar');
|
|
19681
|
-
(0,
|
|
19697
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
|
|
19682
19698
|
this.dialog = dialog;
|
|
19683
19699
|
this.resizer = resizer;
|
|
19684
19700
|
this.dialogbox_header = dialogbox_header;
|
|
19685
19701
|
this.dialogbox_content = dialogbox_content;
|
|
19686
19702
|
this.dialogbox_footer = dialogbox_footer;
|
|
19687
19703
|
this.dialogbox_toolbar = dialogbox_toolbar;
|
|
19688
|
-
(0,
|
|
19704
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.dialog, {
|
|
19689
19705
|
maxWidth: self1.options.maxWidth,
|
|
19690
19706
|
minHeight: self1.options.minHeight,
|
|
19691
19707
|
minWidth: self1.options.minWidth
|
|
@@ -19698,7 +19714,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19698
19714
|
this.e.on(self1.container, 'close_dialog', self1.close).on(this.ow, 'keydown', this.__onEsc).on(this.ow, 'resize', this.__onResize);
|
|
19699
19715
|
if (this.o.closeOnClickOverlay) {
|
|
19700
19716
|
const overlay = self1.getElm('overlay');
|
|
19701
|
-
(0,
|
|
19717
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(overlay != null, 'Overlay element does not exist');
|
|
19702
19718
|
this.e.on(overlay, 'click', self1.close);
|
|
19703
19719
|
}
|
|
19704
19720
|
}
|
|
@@ -19708,7 +19724,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19708
19724
|
* whole `destination` (usually `document.body`) for every z-index update.
|
|
19709
19725
|
*/ ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "__opened", new Set());
|
|
19710
19726
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "defaultOptions", {
|
|
19711
|
-
...
|
|
19727
|
+
...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__.View.defaultOptions,
|
|
19712
19728
|
closeOnClickOverlay: false,
|
|
19713
19729
|
closeOnEsc: true
|
|
19714
19730
|
});
|
|
@@ -24836,6 +24852,13 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
|
|
|
24836
24852
|
/** @override */ className() {
|
|
24837
24853
|
return 'ToolbarContent';
|
|
24838
24854
|
}
|
|
24855
|
+
/** A toolbar item like `ToolbarButton`: the parent group is a `list`. */ getRole() {
|
|
24856
|
+
return 'listitem';
|
|
24857
|
+
}
|
|
24858
|
+
/**
|
|
24859
|
+
* Arbitrary content is not a toggle button — `aria-pressed` is not
|
|
24860
|
+
* allowed on a `listitem`.
|
|
24861
|
+
*/ onChangeActivated() {}
|
|
24839
24862
|
/** @override */ update() {
|
|
24840
24863
|
const { control } = this;
|
|
24841
24864
|
const content = control.getContent(this.j, this);
|
|
@@ -24875,7 +24898,6 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
|
|
|
24875
24898
|
constructor(jodit, control, target = null){
|
|
24876
24899
|
super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "control", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "target", void 0), this.control = control, this.target = target;
|
|
24877
24900
|
this.container.classList.add(`${this.componentName}_${this.clearName(control.name)}`);
|
|
24878
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.container, 'role', 'content');
|
|
24879
24901
|
}
|
|
24880
24902
|
}
|
|
24881
24903
|
ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
@@ -32879,7 +32901,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
|
|
|
32879
32901
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
|
|
32880
32902
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
|
|
32881
32903
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
|
|
32882
|
-
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
|
|
32904
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit-wysiwyg_image-selected::selection,' + '.jodit-wysiwyg_image-selected *:not(img)::selection{' + 'background:transparent' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
|
|
32883
32905
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
|
|
32884
32906
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
32885
32907
|
|
|
@@ -33121,13 +33143,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
33121
33143
|
|
|
33122
33144
|
|
|
33123
33145
|
|
|
33146
|
+
|
|
33124
33147
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
33125
33148
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
33149
|
+
const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
33126
33150
|
/**
|
|
33127
33151
|
* Change editor's size after load all images
|
|
33128
33152
|
*/ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
33129
|
-
afterInit(jodit) {
|
|
33153
|
+
afterInit(jodit) {
|
|
33154
|
+
jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
33155
|
+
}
|
|
33130
33156
|
beforeDestruct(jodit) {
|
|
33157
|
+
jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
33158
|
+
jodit.editor.classList.remove(IMAGE_SELECTED);
|
|
33131
33159
|
const buffer = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(jodit, 'buffer');
|
|
33132
33160
|
const list = buffer?.get(JODIT_IMAGE_BLOB_ID);
|
|
33133
33161
|
if (buffer && list) {
|
|
@@ -33158,6 +33186,13 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
33158
33186
|
}
|
|
33159
33187
|
}
|
|
33160
33188
|
}
|
|
33189
|
+
/**
|
|
33190
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
33191
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
33192
|
+
*/ onSelectionChange() {
|
|
33193
|
+
const { jodit } = this;
|
|
33194
|
+
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
33195
|
+
}
|
|
33161
33196
|
async afterChange(data) {
|
|
33162
33197
|
const { jodit: editor } = this;
|
|
33163
33198
|
if (!editor.editor) {
|
|
@@ -33189,6 +33224,9 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
33189
33224
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
33190
33225
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeSetElementValue')
|
|
33191
33226
|
], imageProcessor.prototype, "onBeforeSetElementValue", null);
|
|
33227
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
33228
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
|
|
33229
|
+
], imageProcessor.prototype, "onSelectionChange", null);
|
|
33192
33230
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
33193
33231
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
|
|
33194
33232
|
':change',
|
|
@@ -33197,6 +33235,14 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
33197
33235
|
]),
|
|
33198
33236
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.debounce)()
|
|
33199
33237
|
], imageProcessor.prototype, "afterChange", null);
|
|
33238
|
+
function isImageSelected(jodit) {
|
|
33239
|
+
const { sel } = jodit.s;
|
|
33240
|
+
if (!sel || !sel.rangeCount) {
|
|
33241
|
+
return false;
|
|
33242
|
+
}
|
|
33243
|
+
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
33244
|
+
return startContainer === endContainer && endOffset === startOffset + 1 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(startContainer.childNodes[startOffset], 'img') && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(jodit.editor, startContainer);
|
|
33245
|
+
}
|
|
33200
33246
|
/**
|
|
33201
33247
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
33202
33248
|
* Selecting the image replaces the caret, and with the text still after a
|
|
@@ -42037,19 +42083,26 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
|
|
|
42037
42083
|
onResize();
|
|
42038
42084
|
this.onReady();
|
|
42039
42085
|
};
|
|
42086
|
+
let loading = false;
|
|
42040
42087
|
const initAceEditor = ()=>{
|
|
42041
42088
|
if (editor.isInDestruct || editor.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.MODE_SPLIT) {
|
|
42042
42089
|
return;
|
|
42043
42090
|
}
|
|
42091
|
+
// ACE (~400 KiB from the CDN) is only needed once the source view
|
|
42092
|
+
// is actually shown — a page that stays in WYSIWYG must not
|
|
42093
|
+
// download it.
|
|
42094
|
+
if (!this.aceExists()) {
|
|
42095
|
+
if (!loading) {
|
|
42096
|
+
loading = true;
|
|
42097
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
|
|
42098
|
+
}
|
|
42099
|
+
return;
|
|
42100
|
+
}
|
|
42044
42101
|
this.fromWYSIWYG();
|
|
42045
42102
|
tryInitAceEditor();
|
|
42046
42103
|
};
|
|
42047
42104
|
editor.e.on('afterSetMode', initAceEditor);
|
|
42048
42105
|
initAceEditor();
|
|
42049
|
-
// global add ace editor in browser
|
|
42050
|
-
if (!this.aceExists()) {
|
|
42051
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
|
|
42052
|
-
}
|
|
42053
42106
|
}
|
|
42054
42107
|
destruct() {
|
|
42055
42108
|
this.instance.off('change', this.toWYSIWYG);
|
|
@@ -42587,7 +42640,20 @@ class SourceEditor {
|
|
|
42587
42640
|
return false;
|
|
42588
42641
|
};
|
|
42589
42642
|
if (!addEventListener()) {
|
|
42590
|
-
|
|
42643
|
+
// js-beautify is only needed once the source view is shown —
|
|
42644
|
+
// do not download it for a page that stays in WYSIWYG.
|
|
42645
|
+
let loading = false;
|
|
42646
|
+
const loadBeautify = ()=>{
|
|
42647
|
+
if (loading || editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SPLIT) {
|
|
42648
|
+
return;
|
|
42649
|
+
}
|
|
42650
|
+
loading = true;
|
|
42651
|
+
// It formats the source view from the next time it opens:
|
|
42652
|
+
// filling it again now would replace what was typed there
|
|
42653
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
|
|
42654
|
+
};
|
|
42655
|
+
editor.e.on('afterSetMode.source', loadBeautify);
|
|
42656
|
+
loadBeautify();
|
|
42591
42657
|
}
|
|
42592
42658
|
}
|
|
42593
42659
|
this.syncValueFromWYSIWYG(true);
|