@rg-dev/tinymce-helpers 1.0.9 → 1.0.10

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/index.d.mts CHANGED
@@ -13,7 +13,7 @@ declare const skinsTable: {
13
13
  type RemoveIndexSignature<T> = {
14
14
  [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K];
15
15
  };
16
- type Opts = {
16
+ type MyTinymceOpts = {
17
17
  skin?: keyof typeof skinsTable;
18
18
  direction?: 'rtl' | 'ltr';
19
19
  customSetup?: (editor: Editor) => void;
@@ -25,8 +25,9 @@ declare class tinymceHelpers {
25
25
  private _lockButton?;
26
26
  private originalContextMenu;
27
27
  private constructor();
28
- static initMce(el: HTMLElement, customOpts?: Opts): Promise<tinymceHelpers>;
29
- _initMce(el: HTMLElement, customOpts?: Opts): Promise<this>;
28
+ static initMce(el: HTMLElement, customOpts?: MyTinymceOpts): Promise<tinymceHelpers>;
29
+ addImg(src: string): void;
30
+ _initMce(el: HTMLElement, customOpts?: MyTinymceOpts): Promise<this>;
30
31
  private setContextMenu;
31
32
  toggleReadOnly(lock?: 'yes' | 'no'): void;
32
33
  isEditable(): boolean;
@@ -42,4 +43,4 @@ declare class tinymceHelpers {
42
43
  destroy(): void;
43
44
  }
44
45
 
45
- export { tinymceHelpers };
46
+ export { type MyTinymceOpts, tinymceHelpers };
package/index.mjs CHANGED
@@ -114,6 +114,9 @@ var tinymceHelpers = class _tinymceHelpers {
114
114
  static async initMce(el, customOpts = Object()) {
115
115
  return await new _tinymceHelpers()._initMce(el, customOpts);
116
116
  }
117
+ addImg(src) {
118
+ this.editor.insertContent(`<img src="${src}" alt="">`);
119
+ }
117
120
  async _initMce(el, customOpts = Object()) {
118
121
  var _a, _b;
119
122
  if (!(el instanceof HTMLElement)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rg-dev/tinymce-helpers",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {