jodit 4.12.43 → 4.12.44
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 +10 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +44 -5
- package/es2015/jodit.min.js +3 -3
- 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 +3 -3
- package/es2018/jodit.min.js +3 -3
- 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 +5 -5
- package/es2021/jodit.js +44 -5
- package/es2021/jodit.min.js +5 -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 +5 -5
- package/es2021.en/jodit.js +44 -5
- package/es2021.en/jodit.min.js +5 -5
- 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 +44 -5
- 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 +22 -0
- package/esm/config.js +21 -0
- package/esm/core/constants.js +1 -1
- package/esm/core/storage/async-storage.d.ts +2 -2
- package/esm/core/storage/async-storage.js +19 -1
- package/esm/core/storage/engines/local-storage-provider.js +6 -1
- package/esm/core/view/view.js +1 -1
- package/esm/types/storage.d.ts +15 -0
- package/esm/types/view.d.ts +8 -1
- package/package.json +1 -1
- package/types/config.d.ts +22 -0
- package/types/core/storage/async-storage.d.ts +2 -2
- package/types/types/storage.d.ts +15 -0
- package/types/types/view.d.ts +8 -1
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.12.
|
|
4
|
+
* Version: v4.12.44
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -378,6 +378,26 @@ let ConfigPrototype = {};
|
|
|
378
378
|
/**
|
|
379
379
|
* if set true, then the current mode is saved in a cookie, and is restored after a reload of the page
|
|
380
380
|
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "saveModeInStorage", false);
|
|
381
|
+
/**
|
|
382
|
+
* Configure the provider that backs {@link IViewBased.asyncStorage}.
|
|
383
|
+
*
|
|
384
|
+
* By default the editor's `asyncStorage` uses persistent `IndexedDB` (with an
|
|
385
|
+
* in-memory fallback when it is unavailable). Set `defaultProvider` to override it:
|
|
386
|
+
* - `'local'` — persist in `localStorage`;
|
|
387
|
+
* - `'memory'` — keep everything in memory (nothing survives a reload);
|
|
388
|
+
* - a custom {@link IAsyncStorage} implementation — plug in your own backend.
|
|
389
|
+
*
|
|
390
|
+
* ```javascript
|
|
391
|
+
* Jodit.make('#editor', {
|
|
392
|
+
* asyncStorage: { defaultProvider: 'local' }
|
|
393
|
+
* });
|
|
394
|
+
*
|
|
395
|
+
* // or a fully custom backend
|
|
396
|
+
* Jodit.make('#editor', {
|
|
397
|
+
* asyncStorage: { defaultProvider: myAsyncStorage }
|
|
398
|
+
* });
|
|
399
|
+
* ```
|
|
400
|
+
*/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "asyncStorage", {});
|
|
381
401
|
/**
|
|
382
402
|
* Class name that can be appended to the editable area
|
|
383
403
|
*
|
|
@@ -1823,7 +1843,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1823
1843
|
* ```
|
|
1824
1844
|
* @packageDocumentation
|
|
1825
1845
|
* @module constants
|
|
1826
|
-
*/ const APP_VERSION = "4.12.
|
|
1846
|
+
*/ const APP_VERSION = "4.12.44";
|
|
1827
1847
|
// prettier-ignore
|
|
1828
1848
|
const ES = "es2021";
|
|
1829
1849
|
const IS_ES_MODERN = true;
|
|
@@ -13031,9 +13051,23 @@ class AsyncStorage {
|
|
|
13031
13051
|
await provider.close();
|
|
13032
13052
|
}
|
|
13033
13053
|
}
|
|
13034
|
-
static makeStorage(persistentOrStrategy = false, suffix) {
|
|
13054
|
+
static makeStorage(persistentOrStrategy = false, suffix, options) {
|
|
13035
13055
|
let provider = undefined;
|
|
13036
13056
|
let storage = null;
|
|
13057
|
+
// An explicit `defaultProvider` overrides the strategy-based selection
|
|
13058
|
+
// below and decides which provider backs the storage.
|
|
13059
|
+
const defaultProvider = options?.defaultProvider;
|
|
13060
|
+
if (defaultProvider != null) {
|
|
13061
|
+
if (defaultProvider === 'local') {
|
|
13062
|
+
provider = (0,_engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_3__.canUsePersistentStorage)('localStorage') ? new _engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_3__.LocalStorageProvider(_storage__WEBPACK_IMPORTED_MODULE_5__.StorageKey + (suffix || '')) : new _engines_memory_storage_provider__WEBPACK_IMPORTED_MODULE_4__.MemoryStorageProvider();
|
|
13063
|
+
} else if (defaultProvider === 'memory') {
|
|
13064
|
+
provider = new _engines_memory_storage_provider__WEBPACK_IMPORTED_MODULE_4__.MemoryStorageProvider();
|
|
13065
|
+
} else {
|
|
13066
|
+
// A custom IAsyncStorage implementation, used as-is.
|
|
13067
|
+
provider = defaultProvider;
|
|
13068
|
+
}
|
|
13069
|
+
return new AsyncStorage(Promise.resolve(provider), suffix);
|
|
13070
|
+
}
|
|
13037
13071
|
if (persistentOrStrategy === 'localStorage' || persistentOrStrategy === 'sessionStorage') {
|
|
13038
13072
|
if ((0,_engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_3__.canUsePersistentStorage)(persistentOrStrategy)) {
|
|
13039
13073
|
provider = new _engines_local_storage_provider__WEBPACK_IMPORTED_MODULE_3__.LocalStorageProvider(_storage__WEBPACK_IMPORTED_MODULE_5__.StorageKey + (suffix || ''), persistentOrStrategy);
|
|
@@ -13321,7 +13355,12 @@ function clearUseIndexedDBCache() {
|
|
|
13321
13355
|
}
|
|
13322
13356
|
delete(key) {
|
|
13323
13357
|
try {
|
|
13324
|
-
this.storage.
|
|
13358
|
+
const buffer = this.storage.getItem(this.rootKey);
|
|
13359
|
+
if (buffer) {
|
|
13360
|
+
const json = JSON.parse(buffer);
|
|
13361
|
+
delete json[key];
|
|
13362
|
+
this.storage.setItem(this.rootKey, JSON.stringify(json));
|
|
13363
|
+
}
|
|
13325
13364
|
} catch {}
|
|
13326
13365
|
return this;
|
|
13327
13366
|
}
|
|
@@ -16686,7 +16725,7 @@ class View extends jodit_core_component_component__WEBPACK_IMPORTED_MODULE_3__.C
|
|
|
16686
16725
|
/**
|
|
16687
16726
|
* Container for persistent set/get value
|
|
16688
16727
|
*/ get asyncStorage() {
|
|
16689
|
-
return jodit_core_storage_async_storage__WEBPACK_IMPORTED_MODULE_14__.AsyncStorage.makeStorage(true, this.id);
|
|
16728
|
+
return jodit_core_storage_async_storage__WEBPACK_IMPORTED_MODULE_14__.AsyncStorage.makeStorage(true, this.id, this.o.asyncStorage);
|
|
16690
16729
|
}
|
|
16691
16730
|
/**
|
|
16692
16731
|
* Short alias for `create`
|