@nerd-bible/wordgard 0.5.3-beta3 → 0.5.3-beta4

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/doc.js CHANGED
@@ -3154,9 +3154,12 @@ function fitReplacement(doc, from, to, slice, context) {
3154
3154
  cx = cx.parent;
3155
3155
  }
3156
3156
  }
3157
- for (let i = 0; i < context.length; i++) {
3158
- if (doc.schema.canContain(from.parent.node.type, context[i].type)) {
3159
- slice = closeSlice(doc.schema, slice, context, i + 1, true);
3157
+ for (let i = -1; i < context.length; i++) {
3158
+ if (i == preferredContext)
3159
+ continue;
3160
+ let depth = i < 0 ? preferredContext : i;
3161
+ if (doc.schema.canContain(from.parent.node.type, context[depth].type)) {
3162
+ slice = closeSlice(doc.schema, slice, context, depth + 1, true);
3160
3163
  break;
3161
3164
  }
3162
3165
  }
package/dist/table.js CHANGED
@@ -790,7 +790,7 @@ function pastedCells(schema, slice, context) {
790
790
  tok.type == Table.type) {
791
791
  table = tok;
792
792
  }
793
- else if (context.length && isTableContent(schema, context[0].type) ||
793
+ else if (context.some(tag => isTableContent(schema, tag.type)) ||
794
794
  slice.content.some(tok => tok.tokenType != Token.Type.Close && isTableContent(schema, tok.type))) {
795
795
  table = fitSlice(schema, Table, slice, context);
796
796
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nerd-bible/wordgard",
3
- "version": "0.5.3-beta3",
3
+ "version": "0.5.3-beta4",
4
4
  "description": "Semantic rich text editor system",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",