jodit 4.12.43 → 4.13.3

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es2015/jodit.css +6 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +14 -14
  5. package/es2015/jodit.js +198 -20
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +5 -5
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +3 -3
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +5 -5
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +6 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +5 -5
  23. package/es2021/jodit.js +189 -20
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +7 -7
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +6 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +6 -6
  35. package/es2021.en/jodit.js +189 -20
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +6 -6
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +7 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +234 -20
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/config.d.ts +22 -0
  60. package/esm/config.js +21 -0
  61. package/esm/core/constants.js +1 -1
  62. package/esm/core/selection/selection.d.ts +31 -0
  63. package/esm/core/selection/selection.js +143 -14
  64. package/esm/core/storage/async-storage.d.ts +2 -2
  65. package/esm/core/storage/async-storage.js +19 -1
  66. package/esm/core/storage/engines/local-storage-provider.js +6 -1
  67. package/esm/core/view/view-with-toolbar.d.ts +6 -0
  68. package/esm/core/view/view-with-toolbar.js +18 -2
  69. package/esm/core/view/view.js +1 -1
  70. package/esm/jodit.js +7 -0
  71. package/esm/types/jodit.d.ts +2 -0
  72. package/esm/types/storage.d.ts +15 -0
  73. package/esm/types/view.d.ts +8 -1
  74. package/package.json +1 -1
  75. package/types/config.d.ts +22 -0
  76. package/types/core/selection/selection.d.ts +31 -0
  77. package/types/core/storage/async-storage.d.ts +2 -2
  78. package/types/core/view/view-with-toolbar.d.ts +6 -0
  79. package/types/types/jodit.d.ts +2 -0
  80. package/types/types/storage.d.ts +15 -0
  81. package/types/types/view.d.ts +8 -1
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * @module storage
8
8
  */
9
- import type { IAsyncStorage, IStorage, StorageValueType } from "../../types/index";
9
+ import type { IAsyncStorage, IAsyncStorageOptions, IStorage, StorageValueType } from "../../types/index";
10
10
  import { type WebStorageStrategy } from "./engines/local-storage-provider";
11
11
  export declare class AsyncStorage<T = StorageValueType> implements IAsyncStorage<T> {
12
12
  private provider;
@@ -18,5 +18,5 @@ export declare class AsyncStorage<T = StorageValueType> implements IAsyncStorage
18
18
  exists(key: string): Promise<boolean>;
19
19
  clear(): Promise<this>;
20
20
  close(): Promise<void>;
21
- static makeStorage(persistentOrStrategy?: boolean | WebStorageStrategy | 'memoryStorage' | 'indexedDB', suffix?: string): IAsyncStorage;
21
+ static makeStorage(persistentOrStrategy?: boolean | WebStorageStrategy | 'memoryStorage' | 'indexedDB', suffix?: string, options?: IAsyncStorageOptions): IAsyncStorage;
22
22
  }
@@ -16,6 +16,12 @@ export declare abstract class ViewWithToolbar extends View implements IViewWithT
16
16
  * Container for toolbar
17
17
  */
18
18
  get toolbarContainer(): HTMLElement;
19
+ /**
20
+ * Keep the toolbar box as the first child of the container, except that
21
+ * children flagged with `data-jodit-above-toolbar` (e.g. the `above`
22
+ * workplace slot used for presence bars and banners) stay above it.
23
+ */
24
+ private __appendToolbarBox;
19
25
  /**
20
26
  * Change panel container
21
27
  */
@@ -18,6 +18,8 @@ interface IWorkPlace {
18
18
  container: HTMLDivElement;
19
19
  workplace: HTMLDivElement;
20
20
  slots: {
21
+ /** Sits above the toolbar (presence bars, banners). */
22
+ above: HTMLDivElement;
21
23
  top: HTMLDivElement;
22
24
  bottom: HTMLDivElement;
23
25
  center: HTMLDivElement;
@@ -22,3 +22,18 @@ export interface IAsyncStorage<T = StorageValueType> {
22
22
  clear(): Promise<this>;
23
23
  close(): Promise<void>;
24
24
  }
25
+ /**
26
+ * Which provider should back an {@link IAsyncStorage} created by
27
+ * `AsyncStorage.makeStorage`:
28
+ * - `'local'` — use `localStorage` (falls back to memory if it is blocked);
29
+ * - `'memory'` — use an in-memory store (nothing survives a page reload);
30
+ * - a custom {@link IAsyncStorage} implementation — use it as-is.
31
+ */
32
+ export type AsyncStorageDefaultProvider = 'local' | 'memory' | IAsyncStorage;
33
+ export interface IAsyncStorageOptions {
34
+ /**
35
+ * Overrides the provider that backs the storage. When omitted the storage
36
+ * behaves as before — persistent `IndexedDB` with an in-memory fallback.
37
+ */
38
+ defaultProvider?: AsyncStorageDefaultProvider;
39
+ }
@@ -9,7 +9,7 @@
9
9
  import type { Buttons, ButtonsGroup, ButtonsOption, Controls, IControlType, IProgressBar, IToolbarCollection } from "./toolbar";
10
10
  import type { CanUndef, IComponent, IContainer, IDictionary, Nullable } from "./types";
11
11
  import type { Attributes, ICreate } from "./create";
12
- import type { IAsyncStorage, IStorage } from "./storage";
12
+ import type { IAsyncStorage, IAsyncStorageOptions, IStorage } from "./storage";
13
13
  import type { IUIButtonState } from "./ui";
14
14
  import type { IEventEmitter } from "./events";
15
15
  import type { IPluginButton } from "./plugin";
@@ -40,6 +40,13 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
40
40
  * Use cache for heavy methods
41
41
  */
42
42
  cache?: boolean;
43
+ /**
44
+ * Configure the provider that backs {@link IViewBased.asyncStorage}.
45
+ * By default it uses persistent `IndexedDB` (with an in-memory fallback);
46
+ * set `defaultProvider` to `'local'`, `'memory'` or a custom
47
+ * {@link IAsyncStorage} implementation to override it.
48
+ */
49
+ asyncStorage?: IAsyncStorageOptions;
43
50
  getIcon?: (name: string, clearName: string) => CanUndef<string>;
44
51
  headerButtons?: string | Array<IControlType | string | ButtonsGroup>;
45
52
  readonly basePath?: string;