@underverse-ui/underverse 1.0.134 → 1.0.135

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/dist/index.js CHANGED
@@ -25350,6 +25350,7 @@ var letter_spacing_default = LetterSpacing;
25350
25350
 
25351
25351
  // src/components/UEditor/table-align.ts
25352
25352
  import { Table as Table3 } from "@tiptap/extension-table";
25353
+ import { Plugin as Plugin3 } from "@tiptap/pm/state";
25353
25354
 
25354
25355
  // src/components/UEditor/table-align-utils.ts
25355
25356
  function findTableNodeInfoAtResolvedPos($pos) {
@@ -25477,6 +25478,24 @@ var UEditorTable = Table3.extend({
25477
25478
  return true;
25478
25479
  }
25479
25480
  };
25481
+ },
25482
+ addProseMirrorPlugins() {
25483
+ return [
25484
+ new Plugin3({
25485
+ appendTransaction(_transactions, _oldState, newState) {
25486
+ const { doc, schema } = newState;
25487
+ const paragraphType = schema.nodes.paragraph;
25488
+ if (!paragraphType) return null;
25489
+ const needsLeading = doc.firstChild?.type.name === "table";
25490
+ const needsTrailing = doc.lastChild?.type.name === "table";
25491
+ if (!needsLeading && !needsTrailing) return null;
25492
+ const tr = newState.tr;
25493
+ if (needsTrailing) tr.insert(doc.content.size, paragraphType.create());
25494
+ if (needsLeading) tr.insert(0, paragraphType.create());
25495
+ return tr;
25496
+ }
25497
+ })
25498
+ ];
25480
25499
  }
25481
25500
  });
25482
25501
  var table_align_default = UEditorTable;