jodit 4.0.0-beta.95 → 4.0.0-beta.99

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 (95) hide show
  1. package/CHANGELOG.md +21 -5
  2. package/README.md +4 -4
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +95 -88
  6. package/es2015/jodit.min.js +2 -2
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +95 -88
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.js +1 -1
  17. package/es2018/plugins/debug/debug.min.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  21. package/es2021/jodit.css +1 -1
  22. package/es2021/jodit.fat.min.js +2 -2
  23. package/es2021/jodit.js +95 -88
  24. package/es2021/jodit.min.js +2 -2
  25. package/es2021/plugins/debug/debug.js +1 -1
  26. package/es2021/plugins/debug/debug.min.js +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  30. package/es2021.en/jodit.css +1 -1
  31. package/es2021.en/jodit.fat.min.js +2 -2
  32. package/es2021.en/jodit.js +95 -88
  33. package/es2021.en/jodit.min.js +2 -2
  34. package/es2021.en/plugins/debug/debug.js +1 -1
  35. package/es2021.en/plugins/debug/debug.min.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  38. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  39. package/es5/jodit.css +2 -2
  40. package/es5/jodit.fat.min.js +2 -2
  41. package/es5/jodit.js +104 -97
  42. package/es5/jodit.min.css +2 -2
  43. package/es5/jodit.min.js +2 -2
  44. package/es5/plugins/debug/debug.js +1 -1
  45. package/es5/plugins/debug/debug.min.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  47. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  48. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  49. package/esm/core/async/async.d.ts +1 -1
  50. package/esm/core/async/async.js +4 -0
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/helpers/string/ucfirst.js +1 -1
  53. package/esm/core/helpers/utils/index.d.ts +0 -1
  54. package/esm/core/helpers/utils/index.js +0 -1
  55. package/esm/core/selection/interface.d.ts +1 -1
  56. package/esm/core/ui/form/inputs/area/area.d.ts +1 -1
  57. package/esm/core/ui/form/inputs/area/area.js +1 -1
  58. package/esm/core/ui/form/inputs/checkbox/checkbox.d.ts +1 -1
  59. package/esm/core/ui/form/inputs/checkbox/checkbox.js +1 -1
  60. package/esm/core/ui/form/inputs/file/file.d.ts +1 -1
  61. package/esm/core/ui/form/inputs/file/file.js +1 -1
  62. package/esm/core/ui/form/inputs/index.d.ts +1 -1
  63. package/esm/core/ui/form/inputs/index.js +1 -1
  64. package/esm/core/ui/form/inputs/input/input.d.ts +1 -1
  65. package/esm/core/ui/form/inputs/input/input.js +1 -1
  66. package/esm/core/ui/form/inputs/select/select.d.ts +1 -1
  67. package/esm/core/ui/form/inputs/select/select.js +1 -1
  68. package/esm/modules/messages/messages.d.ts +28 -0
  69. package/esm/modules/messages/messages.js +28 -0
  70. package/esm/modules/table/table.d.ts +4 -2
  71. package/esm/modules/table/table.js +2 -0
  72. package/esm/modules/widget/color-picker/color-picker.d.ts +1 -1
  73. package/esm/modules/widget/color-picker/color-picker.js +1 -1
  74. package/esm/modules/widget/file-selector/file-selector.d.ts +1 -18
  75. package/esm/modules/widget/file-selector/file-selector.js +12 -19
  76. package/esm/modules/widget/tabs/tabs.d.ts +17 -6
  77. package/esm/modules/widget/tabs/tabs.js +17 -6
  78. package/package.json +1 -1
  79. package/types/core/async/async.d.ts +1 -1
  80. package/types/core/helpers/utils/index.d.ts +0 -1
  81. package/types/core/selection/interface.d.ts +1 -1
  82. package/types/core/ui/form/inputs/area/area.d.ts +1 -1
  83. package/types/core/ui/form/inputs/checkbox/checkbox.d.ts +1 -1
  84. package/types/core/ui/form/inputs/file/file.d.ts +1 -1
  85. package/types/core/ui/form/inputs/index.d.ts +1 -1
  86. package/types/core/ui/form/inputs/input/input.d.ts +1 -1
  87. package/types/core/ui/form/inputs/select/select.d.ts +1 -1
  88. package/types/modules/messages/messages.d.ts +28 -0
  89. package/types/modules/table/table.d.ts +4 -2
  90. package/types/modules/widget/color-picker/color-picker.d.ts +1 -1
  91. package/types/modules/widget/file-selector/file-selector.d.ts +1 -18
  92. package/types/modules/widget/tabs/tabs.d.ts +17 -6
  93. package/esm/core/helpers/utils/val.d.ts +0 -9
  94. package/esm/core/helpers/utils/val.js +0 -18
  95. package/types/core/helpers/utils/val.d.ts +0 -9
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.0-beta.95
4
+ * Version: v4.0.0-beta.99
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.0-beta.95
4
+ * Version: v4.0.0-beta.99
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.0-beta.95
4
+ * Version: v4.0.0-beta.99
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.0-beta.95
4
+ * Version: v4.0.0-beta.99
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.0-beta.95
4
+ * Version: v4.0.0-beta.99
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -14,7 +14,7 @@ export declare class Async implements IAsync {
14
14
  private timers;
15
15
  private __callbacks;
16
16
  delay(timeout: number | IAsyncParams): RejectablePromise<void>;
17
- setTimeout(callback: Callback, timeout: number | IAsyncParams, ...args: any[]): number;
17
+ setTimeout(callback: Callback, timeout: number | IAsyncParams | undefined, ...args: any[]): number;
18
18
  updateTimeout(label: string, timeout: number): Nullable<number>;
19
19
  private clearLabel;
20
20
  clearTimeout(timer: number): void;
@@ -10,6 +10,7 @@ import { isPromise } from "jodit/esm/core/helpers/checker/is-promise.js";
10
10
  import { isString } from "jodit/esm/core/helpers/checker/is-string.js";
11
11
  import { isNumber } from "jodit/esm/core/helpers/checker/is-number.js";
12
12
  import { assert } from "jodit/esm/core/helpers/utils/assert.js";
13
+ import { isVoid } from "jodit/esm/core/helpers/checker/is-void.js";
13
14
  import { IS_ES_NEXT } from "jodit/esm/core/constants.js";
14
15
  export class Async {
15
16
  constructor() {
@@ -44,6 +45,9 @@ export class Async {
44
45
  return 0;
45
46
  }
46
47
  let options = {};
48
+ if (isVoid(timeout)) {
49
+ timeout = 0;
50
+ }
47
51
  if (!isNumber(timeout)) {
48
52
  options = timeout;
49
53
  timeout = options.timeout || 0;
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.0.0-beta.95";
6
+ export const APP_VERSION = "4.0.0-beta.99";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -13,5 +13,5 @@ export function ucfirst(value) {
13
13
  if (!value.length) {
14
14
  return '';
15
15
  }
16
- return value[0].toUpperCase() + value.substr(1);
16
+ return value[0].toUpperCase() + value.substring(1);
17
17
  }
@@ -33,4 +33,3 @@ export * from "./selector";
33
33
  export * from "./set";
34
34
  export * from "./stack";
35
35
  export * from "./utils";
36
- export * from "./val";
@@ -33,4 +33,3 @@ export * from "./selector";
33
33
  export * from "./set";
34
34
  export * from "./stack";
35
35
  export * from "./utils";
36
- export * from "./val";
@@ -3,10 +3,10 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- import type { ICommitStyle } from "jodit/esm/types";
7
6
  /**
8
7
  * @module selection
9
8
  */
9
+ import type { ICommitStyle } from "jodit/esm/types";
10
10
  declare module 'jodit/types/events' {
11
11
  interface IEventEmitter {
12
12
  /**
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUITextArea, IViewBased } from "jodit/esm/types";
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  var UITextArea_1;
17
17
  /**
18
- * @module ui/form/inputs
18
+ * @module ui/form
19
19
  */
20
20
  import { UIInput } from "jodit/esm/core/ui/form/inputs/input/input.js";
21
21
  import { component } from "jodit/esm/core/decorators/component/component.js";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IViewBased, IUICheckBox } from "jodit/esm/types";
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  var UICheckbox_1;
17
17
  /**
18
- * @module ui/form/inputs
18
+ * @module ui/form
19
19
  */
20
20
  import { UIInput } from "jodit/esm/core/ui/form/inputs/input/input.js";
21
21
  import { component, watch, hook } from "jodit/esm/core/decorators/index.js";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUIInput, IViewBased } from "jodit/esm/types";
@@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
16
  /**
17
- * @module ui/form/inputs
17
+ * @module ui/form
18
18
  */
19
19
  import { UIInput } from "jodit/esm/core/ui/form/inputs/input/input.js";
20
20
  import { component } from "jodit/esm/core/decorators/component/component.js";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
  export * from "./input/input";
10
10
  export * from "./area/area";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
  export * from "./input/input";
10
10
  export * from "./area/area";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUIInput, IUIInputValidator, IViewBased } from "jodit/esm/types";
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  var UIInput_1;
17
17
  /**
18
- * @module ui/form/inputs
18
+ * @module ui/form
19
19
  */
20
20
  import { UIElement } from "jodit/esm/core/ui/element.js";
21
21
  import { attr } from "jodit/esm/core/helpers/utils/index.js";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUISelect, IViewBased } from "jodit/esm/types";
@@ -15,7 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  var UISelect_1;
17
17
  /**
18
- * @module ui/form/inputs
18
+ * @module ui/form
19
19
  */
20
20
  import { attr } from "jodit/esm/core/helpers/utils/attr.js";
21
21
  import { component } from "jodit/esm/core/decorators/component/component.js";
@@ -25,9 +25,37 @@ export declare class UIMessages extends UIGroup implements IMessages {
25
25
  defaultTimeout: number;
26
26
  defaultOffset: number;
27
27
  });
28
+ /**
29
+ * Show popup info message in the lower right corner of the container
30
+ * ```js
31
+ * const jodit = Jodit.make('#editor');
32
+ * jodit.info('Hello world', 3000);
33
+ * ```
34
+ */
28
35
  info(text: string, timeout?: number): void;
36
+ /**
37
+ * Show popup success message in the lower right corner of the container
38
+ * ```js
39
+ * const jodit = Jodit.make('#editor');
40
+ * jodit.success('Hello world', 3000);
41
+ * ```
42
+ */
29
43
  success(text: string, timeout?: number): void;
44
+ /**
45
+ * Show popup error message in the lower right corner of the container
46
+ * ```js
47
+ * const jodit = Jodit.make('#editor');
48
+ * jodit.error('Hello world', 3000);
49
+ * ```
50
+ */
30
51
  error(text: string, timeout?: number): void;
52
+ /**
53
+ * Show popup message in the lower right corner of the container
54
+ * ```js
55
+ * const jodit = Jodit.make('#editor');
56
+ * jodit.message('Hello world', 'info', 3000);
57
+ * ```
58
+ */
31
59
  message(text: string, variant?: MessageVariant, timeout?: number): void;
32
60
  private __message;
33
61
  private __getRemoveCallback;
@@ -38,15 +38,43 @@ let UIMessages = class UIMessages extends UIGroup {
38
38
  this.options = options;
39
39
  this.__messages = new Set();
40
40
  }
41
+ /**
42
+ * Show popup info message in the lower right corner of the container
43
+ * ```js
44
+ * const jodit = Jodit.make('#editor');
45
+ * jodit.info('Hello world', 3000);
46
+ * ```
47
+ */
41
48
  info(text, timeout) {
42
49
  this.__message(text, 'info', timeout);
43
50
  }
51
+ /**
52
+ * Show popup success message in the lower right corner of the container
53
+ * ```js
54
+ * const jodit = Jodit.make('#editor');
55
+ * jodit.success('Hello world', 3000);
56
+ * ```
57
+ */
44
58
  success(text, timeout) {
45
59
  this.__message(text, 'success', timeout);
46
60
  }
61
+ /**
62
+ * Show popup error message in the lower right corner of the container
63
+ * ```js
64
+ * const jodit = Jodit.make('#editor');
65
+ * jodit.error('Hello world', 3000);
66
+ * ```
67
+ */
47
68
  error(text, timeout) {
48
69
  this.__message(text, 'error', timeout);
49
70
  }
71
+ /**
72
+ * Show popup message in the lower right corner of the container
73
+ * ```js
74
+ * const jodit = Jodit.make('#editor');
75
+ * jodit.message('Hello world', 'info', 3000);
76
+ * ```
77
+ */
50
78
  message(text, variant, timeout) {
51
79
  this.__message(text, variant, timeout);
52
80
  }
@@ -8,7 +8,7 @@
8
8
  * @packageDocumentation
9
9
  * @module modules/table
10
10
  */
11
- import type { ICreate, IJodit } from "jodit/esm/types";
11
+ import type { ICreate, IJodit, Prettify } from "jodit/esm/types";
12
12
  import { ViewComponent } from "jodit/esm/core/component";
13
13
  export declare class Table extends ViewComponent<IJodit> {
14
14
  /** @override */
@@ -45,11 +45,13 @@ export declare class Table extends ViewComponent<IJodit> {
45
45
  /**
46
46
  * Inserts a new line after row what contains the selected cell
47
47
  *
48
+ * @param table - Working table
48
49
  * @param line - Insert a new line after/before this
49
50
  * line contains the selected cell
50
51
  * @param after - Insert a new line after line contains the selected cell
52
+ * @param create - Instance of Create class
51
53
  */
52
- static appendRow(table: HTMLTableElement, line: false | HTMLTableRowElement, after: boolean, create: ICreate): void;
54
+ static appendRow(table: HTMLTableElement, line: false | HTMLTableRowElement, after: boolean, create: Prettify<Pick<ICreate, 'element'>>): void;
53
55
  /**
54
56
  * Remove row
55
57
  */
@@ -156,9 +156,11 @@ export class Table extends ViewComponent {
156
156
  /**
157
157
  * Inserts a new line after row what contains the selected cell
158
158
  *
159
+ * @param table - Working table
159
160
  * @param line - Insert a new line after/before this
160
161
  * line contains the selected cell
161
162
  * @param after - Insert a new line after line contains the selected cell
163
+ * @param create - Instance of Create class
162
164
  */
163
165
  static appendRow(table, line, after, create) {
164
166
  let row;
@@ -17,7 +17,7 @@ import type { IJodit } from "jodit/esm/types";
17
17
  * @param coldColor - Color value ex. #fff or rgb(123, 123, 123) or rgba(123, 123, 123, 1)
18
18
  * @example
19
19
  * ```javascript
20
- * $tabs = TabsWidget(editor, {
20
+ * const tabs = TabsWidget(editor, {
21
21
  * 'Text' : ColorPickerWidget(editor, function (color) {
22
22
  * box.style.color = color;
23
23
  * }, box.style.color),
@@ -20,7 +20,7 @@ Icon.set('palette', paletteIcon);
20
20
  * @param coldColor - Color value ex. #fff or rgb(123, 123, 123) or rgba(123, 123, 123, 1)
21
21
  * @example
22
22
  * ```javascript
23
- * $tabs = TabsWidget(editor, {
23
+ * const tabs = TabsWidget(editor, {
24
24
  * 'Text' : ColorPickerWidget(editor, function (color) {
25
25
  * box.style.color = color;
26
26
  * }, box.style.color),
@@ -28,27 +28,10 @@ interface ImageSelectorCallbacks {
28
28
  * Generate 3 tabs
29
29
  * upload - Use Drag and Drop
30
30
  * url - By specifying the image url
31
- * filebrowser - After opening the file browser . In the absence of one of the parameters will be less tabs
31
+ * filebrowser - After opening the file browser. In the absence of one of the parameters will be less tabs
32
32
  *
33
33
  * @param callbacks - Object with keys `url`, `upload` and `filebrowser`, values which are callback
34
34
  * functions with different parameters
35
- *
36
- * @example
37
- * ```javascript
38
- * let widget = new Jodit.modules.Widget(editor);
39
- *
40
- * return widget.c('ImageSelector', {
41
- * url: function (url, alt) {
42
- * editor.selections.insertImage(url);
43
- * },
44
- * upload: function (images) {
45
- * editor.selections.insertImage(images[0]);
46
- * },
47
- * filebrowser: function (images) {
48
- * editor.selections.insertImage(images[0]);
49
- * }
50
- * }, image);
51
- * ```
52
35
  */
53
36
  export declare const FileSelectorWidget: (editor: IJodit, callbacks: ImageSelectorCallbacks, elm: HTMLElement | null, close: () => void, isImage?: boolean) => HTMLDivElement;
54
37
  export {};
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- import { isFunction, $$, attr, val } from "jodit/esm/core/helpers/index.js";
6
+ import { isFunction, $$, attr } from "jodit/esm/core/helpers/index.js";
7
7
  import { Dom } from "jodit/esm/core/dom/dom.js";
8
8
  import { UIBlock, UIForm, UIInput, UIButton } from "jodit/esm/core/ui/index.js";
9
9
  import { TabsWidget } from "jodit/esm/modules/widget/tabs/tabs.js";
@@ -11,27 +11,10 @@ import { TabsWidget } from "jodit/esm/modules/widget/tabs/tabs.js";
11
11
  * Generate 3 tabs
12
12
  * upload - Use Drag and Drop
13
13
  * url - By specifying the image url
14
- * filebrowser - After opening the file browser . In the absence of one of the parameters will be less tabs
14
+ * filebrowser - After opening the file browser. In the absence of one of the parameters will be less tabs
15
15
  *
16
16
  * @param callbacks - Object with keys `url`, `upload` and `filebrowser`, values which are callback
17
17
  * functions with different parameters
18
- *
19
- * @example
20
- * ```javascript
21
- * let widget = new Jodit.modules.Widget(editor);
22
- *
23
- * return widget.c('ImageSelector', {
24
- * url: function (url, alt) {
25
- * editor.selections.insertImage(url);
26
- * },
27
- * upload: function (images) {
28
- * editor.selections.insertImage(images[0]);
29
- * },
30
- * filebrowser: function (images) {
31
- * editor.selections.insertImage(images[0]);
32
- * }
33
- * }, image);
34
- * ```
35
18
  */
36
19
  export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true) => {
37
20
  let currentImage;
@@ -122,3 +105,13 @@ export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true
122
105
  }
123
106
  return TabsWidget(editor, tabs);
124
107
  };
108
+ function val(elm, selector, value) {
109
+ const child = elm.querySelector(selector);
110
+ if (!child) {
111
+ return '';
112
+ }
113
+ if (value) {
114
+ child.value = value;
115
+ }
116
+ return child.value;
117
+ }
@@ -24,12 +24,23 @@ export interface TabOption {
24
24
  *
25
25
  * @example
26
26
  * ```javascript
27
- * let tabs = Jodit.modules.TabsWidget(editor, [
28
- * {name: 'Images', content: '<div>Images</div>'},
29
- * {name: 'Title 2': Jodit.modules.Helpers.dom('<div>Some content</div>')},
30
- * {name: 'Color Picker': ColorPickerWidget(editor, function (color) {
31
- * box.style.color = color;
32
- * }, box.style.color)},
27
+ * const editor = Jodit.make('#editor');
28
+ * const tabs = Jodit.modules.TabsWidget(editor, [
29
+ * { name: 'Images', content: '<div>Images</div>' },
30
+ * {
31
+ * name: 'Title 2',
32
+ * content: editor.c.fromHTML('<div>Some content</div>')
33
+ * },
34
+ * {
35
+ * name: 'Color Picker',
36
+ * content: ColorPickerWidget(
37
+ * editor,
38
+ * function (color) {
39
+ * box.style.color = color;
40
+ * },
41
+ * box.style.color
42
+ * )
43
+ * }
33
44
  * ]);
34
45
  * ```
35
46
  */
@@ -21,12 +21,23 @@ import { Dom } from "jodit/esm/core/dom/dom.js";
21
21
  *
22
22
  * @example
23
23
  * ```javascript
24
- * let tabs = Jodit.modules.TabsWidget(editor, [
25
- * {name: 'Images', content: '<div>Images</div>'},
26
- * {name: 'Title 2': Jodit.modules.Helpers.dom('<div>Some content</div>')},
27
- * {name: 'Color Picker': ColorPickerWidget(editor, function (color) {
28
- * box.style.color = color;
29
- * }, box.style.color)},
24
+ * const editor = Jodit.make('#editor');
25
+ * const tabs = Jodit.modules.TabsWidget(editor, [
26
+ * { name: 'Images', content: '<div>Images</div>' },
27
+ * {
28
+ * name: 'Title 2',
29
+ * content: editor.c.fromHTML('<div>Some content</div>')
30
+ * },
31
+ * {
32
+ * name: 'Color Picker',
33
+ * content: ColorPickerWidget(
34
+ * editor,
35
+ * function (color) {
36
+ * box.style.color = color;
37
+ * },
38
+ * box.style.color
39
+ * )
40
+ * }
30
41
  * ]);
31
42
  * ```
32
43
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.0.0-beta.95",
3
+ "version": "4.0.0-beta.99",
4
4
  "description": "Jodit is awesome and usefully wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -14,7 +14,7 @@ export declare class Async implements IAsync {
14
14
  private timers;
15
15
  private __callbacks;
16
16
  delay(timeout: number | IAsyncParams): RejectablePromise<void>;
17
- setTimeout(callback: Callback, timeout: number | IAsyncParams, ...args: any[]): number;
17
+ setTimeout(callback: Callback, timeout: number | IAsyncParams | undefined, ...args: any[]): number;
18
18
  updateTimeout(label: string, timeout: number): Nullable<number>;
19
19
  private clearLabel;
20
20
  clearTimeout(timer: number): void;
@@ -33,4 +33,3 @@ export * from "./selector";
33
33
  export * from "./set";
34
34
  export * from "./stack";
35
35
  export * from "./utils";
36
- export * from "./val";
@@ -3,10 +3,10 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- import type { ICommitStyle } from "jodit/esm/types";
7
6
  /**
8
7
  * @module selection
9
8
  */
9
+ import type { ICommitStyle } from "jodit/esm/types";
10
10
  declare module 'jodit/types/events' {
11
11
  interface IEventEmitter {
12
12
  /**
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUITextArea, IViewBased } from "jodit/esm/types";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IViewBased, IUICheckBox } from "jodit/esm/types";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUIInput, IViewBased } from "jodit/esm/types";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
  export * from "./input/input";
10
10
  export * from "./area/area";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUIInput, IUIInputValidator, IViewBased } from "jodit/esm/types";
@@ -4,7 +4,7 @@
4
4
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
- * @module ui/form/inputs
7
+ * @module ui/form
8
8
  */
9
9
 
10
10
  import type { IUISelect, IViewBased } from "jodit/esm/types";