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.en/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
|
|
@@ -19109,13 +19117,14 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
|
|
|
19109
19117
|
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
|
|
19110
19118
|
/* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(45664);
|
|
19111
19119
|
/* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28686);
|
|
19112
|
-
/* harmony import */ var
|
|
19113
|
-
/* harmony import */ var
|
|
19114
|
-
/* harmony import */ var
|
|
19115
|
-
/* harmony import */ var
|
|
19116
|
-
/* harmony import */ var
|
|
19117
|
-
/* harmony import */ var
|
|
19118
|
-
/* harmony import */ var
|
|
19120
|
+
/* harmony import */ var jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22852);
|
|
19121
|
+
/* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93640);
|
|
19122
|
+
/* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(28712);
|
|
19123
|
+
/* 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__);
|
|
19124
|
+
/* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4099);
|
|
19125
|
+
/* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(35099);
|
|
19126
|
+
/* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2222);
|
|
19127
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5266);
|
|
19119
19128
|
/*!
|
|
19120
19129
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
19121
19130
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -19138,7 +19147,8 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
|
|
|
19138
19147
|
|
|
19139
19148
|
|
|
19140
19149
|
|
|
19141
|
-
|
|
19150
|
+
|
|
19151
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.dialog = {
|
|
19142
19152
|
namespace: '',
|
|
19143
19153
|
extraButtons: [],
|
|
19144
19154
|
/**
|
|
@@ -19154,7 +19164,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog = {
|
|
|
19154
19164
|
toolbarButtonSize: 'middle',
|
|
19155
19165
|
zIndex: 'inherit'
|
|
19156
19166
|
};
|
|
19157
|
-
|
|
19167
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.controls.dialog = {
|
|
19158
19168
|
close: {
|
|
19159
19169
|
icon: 'cancel',
|
|
19160
19170
|
exec: (dialog)=>{
|
|
@@ -19162,7 +19172,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.dialog = {
|
|
|
19162
19172
|
}
|
|
19163
19173
|
}
|
|
19164
19174
|
};
|
|
19165
|
-
class Dialog extends
|
|
19175
|
+
class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__.ViewWithToolbar {
|
|
19166
19176
|
/** @override */ className() {
|
|
19167
19177
|
return 'Dialog';
|
|
19168
19178
|
}
|
|
@@ -19226,8 +19236,8 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19226
19236
|
this.draggable = true;
|
|
19227
19237
|
this.startX = e.clientX;
|
|
19228
19238
|
this.startY = e.clientY;
|
|
19229
|
-
this.startPoint.x = (0,
|
|
19230
|
-
this.startPoint.y = (0,
|
|
19239
|
+
this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'left');
|
|
19240
|
+
this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'top');
|
|
19231
19241
|
this.setMaxZIndex();
|
|
19232
19242
|
if (e.cancelable) {
|
|
19233
19243
|
e.preventDefault();
|
|
@@ -19316,7 +19326,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19316
19326
|
if (h == null) {
|
|
19317
19327
|
h = this.dialog.offsetHeight;
|
|
19318
19328
|
}
|
|
19319
|
-
;(0,
|
|
19329
|
+
;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
|
|
19320
19330
|
width: w,
|
|
19321
19331
|
height: h
|
|
19322
19332
|
});
|
|
@@ -19350,7 +19360,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19350
19360
|
this.moved = Math.abs(x - left) > 100 || Math.abs(y - top) > 100;
|
|
19351
19361
|
}
|
|
19352
19362
|
// strings on purpose: `css()` would truncate fractional pixels
|
|
19353
|
-
;(0,
|
|
19363
|
+
;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
|
|
19354
19364
|
left: (x || left) + 'px',
|
|
19355
19365
|
top: (y || top) + 'px'
|
|
19356
19366
|
});
|
|
@@ -19370,6 +19380,12 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19370
19380
|
* ```
|
|
19371
19381
|
*/ setHeader(content) {
|
|
19372
19382
|
this.setElements(this.dialogbox_header, content);
|
|
19383
|
+
// `role="dialog"` needs an accessible name; a text title is the
|
|
19384
|
+
// natural one (element titles are left to the caller).
|
|
19385
|
+
if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isString)(content)) {
|
|
19386
|
+
const name = (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__.stripTags)(content, this.od).trim();
|
|
19387
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', name || null);
|
|
19388
|
+
}
|
|
19373
19389
|
return this;
|
|
19374
19390
|
}
|
|
19375
19391
|
/**
|
|
@@ -19423,7 +19439,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19423
19439
|
/**
|
|
19424
19440
|
* Get zIndex from dialog
|
|
19425
19441
|
*/ getZIndex() {
|
|
19426
|
-
return parseInt((0,
|
|
19442
|
+
return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex'), 10) || 0;
|
|
19427
19443
|
}
|
|
19428
19444
|
/**
|
|
19429
19445
|
* Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
|
|
@@ -19446,7 +19462,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19446
19462
|
this.__openedSiblings().forEach((dialog)=>{
|
|
19447
19463
|
maxZIndex = Math.max(dialog.getZIndex(), maxZIndex);
|
|
19448
19464
|
});
|
|
19449
|
-
(0,
|
|
19465
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
|
|
19450
19466
|
}
|
|
19451
19467
|
/**
|
|
19452
19468
|
* Expands the dialog on full browser window
|
|
@@ -19496,7 +19512,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19496
19512
|
this.setPosition(this.offsetX, this.offsetY);
|
|
19497
19513
|
this.setMaxZIndex();
|
|
19498
19514
|
} else {
|
|
19499
|
-
(0,
|
|
19515
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', null);
|
|
19500
19516
|
}
|
|
19501
19517
|
if (this.o.fullsize) {
|
|
19502
19518
|
this.toggleFullSize(true);
|
|
@@ -19610,7 +19626,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19610
19626
|
* True, if dialog was opened
|
|
19611
19627
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isOpened", false);
|
|
19612
19628
|
const self1 = this;
|
|
19613
|
-
self1.options = (0,
|
|
19629
|
+
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));
|
|
19614
19630
|
// Attach event handlers passed via `options.events` to the dialog's own
|
|
19615
19631
|
// emitter (as FileBrowser already does), so a consumer — e.g. a plugin
|
|
19616
19632
|
// forwarding the editor's `events` config — can observe `afterOpen` /
|
|
@@ -19628,40 +19644,40 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19628
19644
|
</div>
|
|
19629
19645
|
<div class="${n('content')}"></div>
|
|
19630
19646
|
<div class="${n('footer')}"></div>
|
|
19631
|
-
<div class="${n('resizer')}">${
|
|
19647
|
+
<div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__.Icon.get('resize_handler')}</div>
|
|
19632
19648
|
</div>
|
|
19633
19649
|
</div>`);
|
|
19634
19650
|
if (self1.options.direction === 'rtl') {
|
|
19635
|
-
(0,
|
|
19636
|
-
(0,
|
|
19651
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.container, 'direction', 'rtl');
|
|
19652
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'dir', 'rtl');
|
|
19637
19653
|
}
|
|
19638
19654
|
if (this.o.zIndex) {
|
|
19639
|
-
(0,
|
|
19655
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', this.o.zIndex.toString());
|
|
19640
19656
|
}
|
|
19641
|
-
;(0,
|
|
19657
|
+
;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'role', 'dialog');
|
|
19642
19658
|
Object.defineProperty(self1.container, 'component', {
|
|
19643
19659
|
value: this
|
|
19644
19660
|
});
|
|
19645
19661
|
self1.setMod('theme', self1.o.theme || 'default').setMod('resizable', Boolean(self1.o.resizable));
|
|
19646
19662
|
const dialog = self1.getElm('panel');
|
|
19647
|
-
(0,
|
|
19663
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialog != null, 'Panel element does not exist');
|
|
19648
19664
|
const resizer = self1.getElm('resizer');
|
|
19649
|
-
(0,
|
|
19665
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(resizer != null, 'Resizer element does not exist');
|
|
19650
19666
|
const dialogbox_header = self1.getElm('header-title');
|
|
19651
|
-
(0,
|
|
19667
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_header != null, 'header-title element does not exist');
|
|
19652
19668
|
const dialogbox_content = self1.getElm('content');
|
|
19653
|
-
(0,
|
|
19669
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_content != null, 'Content element does not exist');
|
|
19654
19670
|
const dialogbox_footer = self1.getElm('footer');
|
|
19655
|
-
(0,
|
|
19671
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_footer != null, 'Footer element does not exist');
|
|
19656
19672
|
const dialogbox_toolbar = self1.getElm('header-toolbar');
|
|
19657
|
-
(0,
|
|
19673
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
|
|
19658
19674
|
this.dialog = dialog;
|
|
19659
19675
|
this.resizer = resizer;
|
|
19660
19676
|
this.dialogbox_header = dialogbox_header;
|
|
19661
19677
|
this.dialogbox_content = dialogbox_content;
|
|
19662
19678
|
this.dialogbox_footer = dialogbox_footer;
|
|
19663
19679
|
this.dialogbox_toolbar = dialogbox_toolbar;
|
|
19664
|
-
(0,
|
|
19680
|
+
(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.dialog, {
|
|
19665
19681
|
maxWidth: self1.options.maxWidth,
|
|
19666
19682
|
minHeight: self1.options.minHeight,
|
|
19667
19683
|
minWidth: self1.options.minWidth
|
|
@@ -19674,7 +19690,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19674
19690
|
this.e.on(self1.container, 'close_dialog', self1.close).on(this.ow, 'keydown', this.__onEsc).on(this.ow, 'resize', this.__onResize);
|
|
19675
19691
|
if (this.o.closeOnClickOverlay) {
|
|
19676
19692
|
const overlay = self1.getElm('overlay');
|
|
19677
|
-
(0,
|
|
19693
|
+
(0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(overlay != null, 'Overlay element does not exist');
|
|
19678
19694
|
this.e.on(overlay, 'click', self1.close);
|
|
19679
19695
|
}
|
|
19680
19696
|
}
|
|
@@ -19684,7 +19700,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
|
|
|
19684
19700
|
* whole `destination` (usually `document.body`) for every z-index update.
|
|
19685
19701
|
*/ ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "__opened", new Set());
|
|
19686
19702
|
(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "defaultOptions", {
|
|
19687
|
-
...
|
|
19703
|
+
...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__.View.defaultOptions,
|
|
19688
19704
|
closeOnClickOverlay: false,
|
|
19689
19705
|
closeOnEsc: true
|
|
19690
19706
|
});
|
|
@@ -24812,6 +24828,13 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
|
|
|
24812
24828
|
/** @override */ className() {
|
|
24813
24829
|
return 'ToolbarContent';
|
|
24814
24830
|
}
|
|
24831
|
+
/** A toolbar item like `ToolbarButton`: the parent group is a `list`. */ getRole() {
|
|
24832
|
+
return 'listitem';
|
|
24833
|
+
}
|
|
24834
|
+
/**
|
|
24835
|
+
* Arbitrary content is not a toggle button — `aria-pressed` is not
|
|
24836
|
+
* allowed on a `listitem`.
|
|
24837
|
+
*/ onChangeActivated() {}
|
|
24815
24838
|
/** @override */ update() {
|
|
24816
24839
|
const { control } = this;
|
|
24817
24840
|
const content = control.getContent(this.j, this);
|
|
@@ -24851,7 +24874,6 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
|
|
|
24851
24874
|
constructor(jodit, control, target = null){
|
|
24852
24875
|
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;
|
|
24853
24876
|
this.container.classList.add(`${this.componentName}_${this.clearName(control.name)}`);
|
|
24854
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.container, 'role', 'content');
|
|
24855
24877
|
}
|
|
24856
24878
|
}
|
|
24857
24879
|
ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
@@ -32492,7 +32514,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
|
|
|
32492
32514
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
|
|
32493
32515
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
|
|
32494
32516
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
|
|
32495
|
-
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' + '}';
|
|
32517
|
+
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' + '}';
|
|
32496
32518
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
|
|
32497
32519
|
jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
|
|
32498
32520
|
|
|
@@ -32734,13 +32756,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
|
|
|
32734
32756
|
|
|
32735
32757
|
|
|
32736
32758
|
|
|
32759
|
+
|
|
32737
32760
|
const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
|
|
32738
32761
|
const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
32762
|
+
const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
|
|
32739
32763
|
/**
|
|
32740
32764
|
* Change editor's size after load all images
|
|
32741
32765
|
*/ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
32742
|
-
afterInit(jodit) {
|
|
32766
|
+
afterInit(jodit) {
|
|
32767
|
+
jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
32768
|
+
}
|
|
32743
32769
|
beforeDestruct(jodit) {
|
|
32770
|
+
jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
|
|
32771
|
+
jodit.editor.classList.remove(IMAGE_SELECTED);
|
|
32744
32772
|
const buffer = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cached)(jodit, 'buffer');
|
|
32745
32773
|
const list = buffer?.get(JODIT_IMAGE_BLOB_ID);
|
|
32746
32774
|
if (buffer && list) {
|
|
@@ -32771,6 +32799,13 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
32771
32799
|
}
|
|
32772
32800
|
}
|
|
32773
32801
|
}
|
|
32802
|
+
/**
|
|
32803
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
32804
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
32805
|
+
*/ onSelectionChange() {
|
|
32806
|
+
const { jodit } = this;
|
|
32807
|
+
jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
|
|
32808
|
+
}
|
|
32774
32809
|
async afterChange(data) {
|
|
32775
32810
|
const { jodit: editor } = this;
|
|
32776
32811
|
if (!editor.editor) {
|
|
@@ -32802,6 +32837,9 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
32802
32837
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
32803
32838
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':beforeSetElementValue')
|
|
32804
32839
|
], imageProcessor.prototype, "onBeforeSetElementValue", null);
|
|
32840
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
32841
|
+
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
|
|
32842
|
+
], imageProcessor.prototype, "onSelectionChange", null);
|
|
32805
32843
|
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
32806
32844
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
|
|
32807
32845
|
':change',
|
|
@@ -32810,6 +32848,14 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
|
|
|
32810
32848
|
]),
|
|
32811
32849
|
(0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.debounce)()
|
|
32812
32850
|
], imageProcessor.prototype, "afterChange", null);
|
|
32851
|
+
function isImageSelected(jodit) {
|
|
32852
|
+
const { sel } = jodit.s;
|
|
32853
|
+
if (!sel || !sel.rangeCount) {
|
|
32854
|
+
return false;
|
|
32855
|
+
}
|
|
32856
|
+
const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
|
|
32857
|
+
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);
|
|
32858
|
+
}
|
|
32813
32859
|
/**
|
|
32814
32860
|
* Remove the invisible-space text beside an image, which only held a caret.
|
|
32815
32861
|
* Selecting the image replaces the caret, and with the text still after a
|
|
@@ -41284,19 +41330,26 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
|
|
|
41284
41330
|
onResize();
|
|
41285
41331
|
this.onReady();
|
|
41286
41332
|
};
|
|
41333
|
+
let loading = false;
|
|
41287
41334
|
const initAceEditor = ()=>{
|
|
41288
41335
|
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) {
|
|
41289
41336
|
return;
|
|
41290
41337
|
}
|
|
41338
|
+
// ACE (~400 KiB from the CDN) is only needed once the source view
|
|
41339
|
+
// is actually shown — a page that stays in WYSIWYG must not
|
|
41340
|
+
// download it.
|
|
41341
|
+
if (!this.aceExists()) {
|
|
41342
|
+
if (!loading) {
|
|
41343
|
+
loading = true;
|
|
41344
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
|
|
41345
|
+
}
|
|
41346
|
+
return;
|
|
41347
|
+
}
|
|
41291
41348
|
this.fromWYSIWYG();
|
|
41292
41349
|
tryInitAceEditor();
|
|
41293
41350
|
};
|
|
41294
41351
|
editor.e.on('afterSetMode', initAceEditor);
|
|
41295
41352
|
initAceEditor();
|
|
41296
|
-
// global add ace editor in browser
|
|
41297
|
-
if (!this.aceExists()) {
|
|
41298
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
|
|
41299
|
-
}
|
|
41300
41353
|
}
|
|
41301
41354
|
destruct() {
|
|
41302
41355
|
this.instance.off('change', this.toWYSIWYG);
|
|
@@ -41834,7 +41887,20 @@ class SourceEditor {
|
|
|
41834
41887
|
return false;
|
|
41835
41888
|
};
|
|
41836
41889
|
if (!addEventListener()) {
|
|
41837
|
-
|
|
41890
|
+
// js-beautify is only needed once the source view is shown —
|
|
41891
|
+
// do not download it for a page that stays in WYSIWYG.
|
|
41892
|
+
let loading = false;
|
|
41893
|
+
const loadBeautify = ()=>{
|
|
41894
|
+
if (loading || editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SPLIT) {
|
|
41895
|
+
return;
|
|
41896
|
+
}
|
|
41897
|
+
loading = true;
|
|
41898
|
+
// It formats the source view from the next time it opens:
|
|
41899
|
+
// filling it again now would replace what was typed there
|
|
41900
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
|
|
41901
|
+
};
|
|
41902
|
+
editor.e.on('afterSetMode.source', loadBeautify);
|
|
41903
|
+
loadBeautify();
|
|
41838
41904
|
}
|
|
41839
41905
|
}
|
|
41840
41906
|
this.syncValueFromWYSIWYG(true);
|