@rg-dev/tinymce-helpers 1.0.15 → 1.0.16

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 (3) hide show
  1. package/index.d.mts +2 -4
  2. package/index.mjs +4 -11
  3. package/package.json +1 -1
package/index.d.mts CHANGED
@@ -24,7 +24,7 @@ type RawEditorOptionsExtended = RawEditorOptions & {
24
24
  quickbars_selection_toolbar?: string;
25
25
  image_advtab: boolean;
26
26
  };
27
- type EditorOpts = Omit<RemoveIndexSignature<RawEditorOptionsExtended>, 'setup' | 'target' | 'selector'> & Record<string, unknown>;
27
+ type EditorOpts = Omit<RemoveIndexSignature<RawEditorOptionsExtended>, 'setup' | 'target' | 'selector' | 'content_css'> & Record<string, unknown>;
28
28
  /** A partial patch object, or a function that derives one from the defaults. */
29
29
  type TinyMCEPatch = Partial<EditorOpts> | ((defaults: EditorOpts) => Partial<EditorOpts> | void);
30
30
  declare class ListBuilder {
@@ -58,9 +58,7 @@ declare class MenuBuilder {
58
58
  addMenu(key: string, config: MenuEntry): this;
59
59
  removeMenu(key: string): this;
60
60
  /** Edit one menu's items with the same builder API as toolbar/contextmenu. */
61
- items(key: string, patch: ListPatch): this;
62
- /** Remove items from one menu, or from every menu if `key` is omitted. */
63
- removeItem(names: string | string[], key?: string): this;
61
+ patchMenu(key: string, patch: ListPatch): void;
64
62
  /** Empty menus are dropped so TinyMCE never sees a menu with no items. */
65
63
  toObject(): MenuConfig;
66
64
  }
package/index.mjs CHANGED
@@ -120,7 +120,7 @@ function resolvePatch(defaults, patch) {
120
120
  } else {
121
121
  resolved = patch;
122
122
  }
123
- const _b = resolved || {}, { target, setup, selector } = _b, safe = __objRest(_b, ["target", "setup", "selector"]);
123
+ const _b = resolved || {}, { target, setup, selector, content_css } = _b, safe = __objRest(_b, ["target", "setup", "selector", "content_css"]);
124
124
  return safe;
125
125
  }
126
126
  var ListBuilder = class {
@@ -210,21 +210,13 @@ var MenuBuilder = class {
210
210
  return this;
211
211
  }
212
212
  /** Edit one menu's items with the same builder API as toolbar/contextmenu. */
213
- items(key, patch) {
213
+ patchMenu(key, patch) {
214
214
  const menu = this.menus[key];
215
215
  if (!menu) {
216
216
  console.error(`MenuBuilder.items: menu "${key}" does not exist`);
217
- return this;
217
+ return;
218
218
  }
219
219
  menu.items = applyListPatch(menu.items, patch);
220
- return this;
221
- }
222
- /** Remove items from one menu, or from every menu if `key` is omitted. */
223
- removeItem(names, key) {
224
- const list = Array.isArray(names) ? names : [names];
225
- const keys = key ? [key] : Object.keys(this.menus);
226
- for (const k of keys) this.items(k, (t) => t.remove(...list));
227
- return this;
228
220
  }
229
221
  /** Empty menus are dropped so TinyMCE never sees a menu with no items. */
230
222
  toObject() {
@@ -470,6 +462,7 @@ var tinymceHelpers = class _tinymceHelpers {
470
462
  quickbars_selection_toolbar: "bold italic | quicklink blockquote quickimage quicktable",
471
463
  noneditable_class: "mceNonEditable",
472
464
  toolbar_mode: "sliding",
465
+ content_css: "",
473
466
  browser_spellcheck: true,
474
467
  menu: {
475
468
  file: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rg-dev/tinymce-helpers",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {