@jvs-milkdown/crepe 1.2.25 → 1.2.27

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 (34) hide show
  1. package/lib/cjs/feature/block-edit/index.js +3 -3
  2. package/lib/cjs/feature/block-edit/index.js.map +1 -1
  3. package/lib/cjs/feature/toolbar/index.js +1 -1
  4. package/lib/cjs/feature/toolbar/index.js.map +1 -1
  5. package/lib/cjs/index.js +420 -6
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/esm/feature/block-edit/index.js +3 -3
  8. package/lib/esm/feature/block-edit/index.js.map +1 -1
  9. package/lib/esm/feature/toolbar/index.js +1 -1
  10. package/lib/esm/feature/toolbar/index.js.map +1 -1
  11. package/lib/esm/index.js +421 -7
  12. package/lib/esm/index.js.map +1 -1
  13. package/lib/theme/common/block-edit.css +5 -3
  14. package/lib/theme/common/code-mirror.css +19 -0
  15. package/lib/theme/common/link-tooltip.css +2 -2
  16. package/lib/theme/common/toolbar.css +1 -1
  17. package/lib/tsconfig.tsbuildinfo +1 -1
  18. package/lib/types/default-config/index.d.ts.map +1 -1
  19. package/lib/types/feature/block-edit/handle/index.d.ts.map +1 -1
  20. package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
  21. package/lib/types/feature/fixed-toolbar/config.d.ts.map +1 -1
  22. package/lib/types/feature/fixed-toolbar/index.d.ts +2 -0
  23. package/lib/types/feature/fixed-toolbar/index.d.ts.map +1 -1
  24. package/package.json +4 -4
  25. package/src/default-config/default-config.spec.ts +15 -0
  26. package/src/default-config/index.ts +17 -1
  27. package/src/feature/block-edit/handle/index.ts +8 -2
  28. package/src/feature/block-edit/menu/component.tsx +4 -1
  29. package/src/feature/fixed-toolbar/config.ts +482 -3
  30. package/src/feature/fixed-toolbar/index.ts +2 -0
  31. package/src/theme/common/block-edit.css +5 -3
  32. package/src/theme/common/code-mirror.css +19 -0
  33. package/src/theme/common/link-tooltip.css +2 -2
  34. package/src/theme/common/toolbar.css +1 -1
@@ -2357,7 +2357,7 @@ const Menu = defineComponent({
2357
2357
  const isTableBlock = (node == null ? void 0 : node.type.name) === "table";
2358
2358
  const isMedia = ((_a = node == null ? void 0 : node.type.name) == null ? void 0 : _a.includes("image")) || isAttachmentBlock || isImageParagraph || (node == null ? void 0 : node.type.name) === "hr" || isTableBlock;
2359
2359
  const showAlign = !isMedia || isImageBlock;
2360
- const isEmpty = node ? node.textContent.length === 0 && node.content.size <= 2 && !isMedia : false;
2360
+ const isEmpty = node ? node.type.name === "paragraph" && node.textContent.length === 0 && node.content.size <= 2 && !isMedia : false;
2361
2361
  const currentAlign = ((_b = node == null ? void 0 : node.attrs) == null ? void 0 : _b.align) || "left";
2362
2362
  const currentIndent = ((_c = node == null ? void 0 : node.attrs) == null ? void 0 : _c.indent) || 0;
2363
2363
  const setAlign = (alignValue) => {
@@ -3313,7 +3313,7 @@ class BlockHandleView {
3313
3313
  });
3314
3314
  }
3315
3315
  const isMedia = node.type.name.includes("image") || node.type.name.includes("attachment") || node.type.name === "hr" || node.type.name.includes("math") || hasMediaChild;
3316
- const isEmpty = node.textContent.length === 0 && node.content.size <= 2 && !isMedia;
3316
+ const isEmpty = node.type.name === "paragraph" && node.textContent.length === 0 && node.content.size <= 2 && !isMedia;
3317
3317
  if (isEmpty) {
3318
3318
  __privateGet(this, _content).classList.add("empty-block");
3319
3319
  } else {
@@ -3464,7 +3464,7 @@ class BlockHandleView {
3464
3464
  });
3465
3465
  }
3466
3466
  const isMedia = node.type.name.includes("image") || node.type.name.includes("attachment") || node.type.name === "hr" || node.type.name.includes("math") || hasMediaChild;
3467
- const isEmpty = node.textContent.length === 0 && node.content.size <= 2 && !isMedia;
3467
+ const isEmpty = node.type.name === "paragraph" && node.textContent.length === 0 && node.content.size <= 2 && !isMedia;
3468
3468
  if (isEmpty) {
3469
3469
  __privateGet(this, _content).classList.add("empty-block");
3470
3470
  } else {