@mdaemon/html-editor 1.4.2 → 1.5.0

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/README.md CHANGED
@@ -77,6 +77,7 @@ const editor = new HTMLEditor(container, {
77
77
  | `basicEditor` | boolean | false | Use simplified toolbar for notes/tasks |
78
78
  | `readonly` | boolean | false | Start the editor in read-only mode (see `setReadOnly`) |
79
79
  | `forced_root_block` | 'p' \| 'div' | 'p' | Block element produced on Enter. `'div'` gives CKEditor `ENTER_DIV` parity |
80
+ | `trailingNode` | boolean | false | Append an empty trailing paragraph when the document ends in a block node (table, image, code block) so the cursor can be placed after it |
80
81
  | `includeTemplates` | boolean | false | Show template dropdown |
81
82
  | `templates` | Template[] | [] | Array of templates |
82
83
  | `dropbox` | boolean | false | Enable Dropbox integration |
package/dist/index.d.ts CHANGED
@@ -172,6 +172,7 @@ export declare interface EditorConfig {
172
172
  * 'p' (default) emits <p>; 'div' emits <div> (CKEditor ENTER_DIV parity).
173
173
  */
174
174
  forced_root_block?: 'p' | 'div';
175
+ trailingNode?: boolean;
175
176
  includeTemplates?: boolean;
176
177
  templates?: Template[];
177
178
  dropbox?: boolean;
package/dist/index.js CHANGED
@@ -51907,6 +51907,10 @@ class HTMLEditor {
51907
51907
  // We use CodeBlockLowlight instead
51908
51908
  // When forced_root_block is 'div', swap StarterKit's <p> paragraph for
51909
51909
  // a custom Paragraph that renders as <div> (CKEditor ENTER_DIV parity).
51910
+ // StarterKit enables trailingNode by default; it accepts `false` to
51911
+ // disable or an options object, but not `true`. Map our boolean toggle:
51912
+ // truthy → undefined (use StarterKit's default/enabled), otherwise disable.
51913
+ trailingNode: this.config.trailingNode ? void 0 : false,
51910
51914
  ...useDivBlocks ? { paragraph: false } : {}
51911
51915
  }),
51912
51916
  SignatureBlock,
package/dist/index.mjs CHANGED
@@ -51905,6 +51905,10 @@ class HTMLEditor {
51905
51905
  // We use CodeBlockLowlight instead
51906
51906
  // When forced_root_block is 'div', swap StarterKit's <p> paragraph for
51907
51907
  // a custom Paragraph that renders as <div> (CKEditor ENTER_DIV parity).
51908
+ // StarterKit enables trailingNode by default; it accepts `false` to
51909
+ // disable or an options object, but not `true`. Map our boolean toggle:
51910
+ // truthy → undefined (use StarterKit's default/enabled), otherwise disable.
51911
+ trailingNode: this.config.trailingNode ? void 0 : false,
51908
51912
  ...useDivBlocks ? { paragraph: false } : {}
51909
51913
  }),
51910
51914
  SignatureBlock,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdaemon/html-editor",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "A TinyMCE-compatible HTML editor built on TipTap",
5
5
  "homepage": "https://github.com/mdaemon-technologies/MDHTMLEditor",
6
6
  "repository": {