@jvs-milkdown/crepe 1.2.7 → 1.2.8

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 (31) hide show
  1. package/lib/cjs/builder.js.map +1 -1
  2. package/lib/cjs/feature/block-edit/index.js.map +1 -1
  3. package/lib/cjs/feature/code-mirror/index.js.map +1 -1
  4. package/lib/cjs/feature/cursor/index.js.map +1 -1
  5. package/lib/cjs/feature/image-block/index.js.map +1 -1
  6. package/lib/cjs/feature/latex/index.js.map +1 -1
  7. package/lib/cjs/feature/link-tooltip/index.js.map +1 -1
  8. package/lib/cjs/feature/list-item/index.js.map +1 -1
  9. package/lib/cjs/feature/placeholder/index.js.map +1 -1
  10. package/lib/cjs/feature/table/index.js.map +1 -1
  11. package/lib/cjs/feature/toolbar/index.js.map +1 -1
  12. package/lib/cjs/index.js +30 -30
  13. package/lib/cjs/index.js.map +1 -1
  14. package/lib/esm/builder.js.map +1 -1
  15. package/lib/esm/feature/block-edit/index.js.map +1 -1
  16. package/lib/esm/feature/code-mirror/index.js.map +1 -1
  17. package/lib/esm/feature/cursor/index.js.map +1 -1
  18. package/lib/esm/feature/image-block/index.js.map +1 -1
  19. package/lib/esm/feature/latex/index.js.map +1 -1
  20. package/lib/esm/feature/link-tooltip/index.js.map +1 -1
  21. package/lib/esm/feature/list-item/index.js.map +1 -1
  22. package/lib/esm/feature/placeholder/index.js.map +1 -1
  23. package/lib/esm/feature/table/index.js.map +1 -1
  24. package/lib/esm/feature/toolbar/index.js.map +1 -1
  25. package/lib/esm/index.js +30 -30
  26. package/lib/esm/index.js.map +1 -1
  27. package/lib/tsconfig.tsbuildinfo +1 -1
  28. package/lib/types/feature/fixed-toolbar/config.d.ts.map +1 -1
  29. package/package.json +4 -4
  30. package/src/feature/fixed-toolbar/config.ts +32 -29
  31. package/src/feature/index.ts +1 -1
package/lib/cjs/index.js CHANGED
@@ -71,7 +71,7 @@ const defaultFeatures = {
71
71
  ["block-edit" /* BlockEdit */]: true,
72
72
  ["placeholder" /* Placeholder */]: true,
73
73
  ["toolbar" /* Toolbar */]: true,
74
- ["fixed-toolbar" /* FixedToolbar */]: false,
74
+ ["fixed-toolbar" /* FixedToolbar */]: true,
75
75
  ["code-mirror" /* CodeMirror */]: true,
76
76
  ["table" /* Table */]: true,
77
77
  ["latex" /* Latex */]: true,
@@ -8581,6 +8581,35 @@ function buildDefaultFixedToolbar(builder, _config, ctx) {
8581
8581
  }
8582
8582
  });
8583
8583
  const blockGroup = builder.addGroup("block", "Block");
8584
+ if (isTableEnabled) {
8585
+ blockGroup.addItem("table", {
8586
+ label: ctx ? i18n(ctx, "menu.item.table") : "Table",
8587
+ icon: tableIcon,
8588
+ active: () => false,
8589
+ onRun: (ctx2) => {
8590
+ const commands = ctx2.get(core.commandsCtx);
8591
+ const view = ctx2.get(core.editorViewCtx);
8592
+ const { from } = view.state.selection;
8593
+ commands.call(commonmark.addBlockTypeCommand.key, {
8594
+ nodeType: gfm.createTable(ctx2, 3, 3)
8595
+ });
8596
+ commands.call(commonmark.selectTextNearPosCommand.key, { pos: from });
8597
+ }
8598
+ });
8599
+ }
8600
+ if (isImageBlockEnabled) {
8601
+ blockGroup.addItem("image", {
8602
+ label: ctx ? i18n(ctx, "menu.item.image") : "Image",
8603
+ icon: imageIcon,
8604
+ active: () => false,
8605
+ onRun: (ctx2) => {
8606
+ const commands = ctx2.get(core.commandsCtx);
8607
+ commands.call(commonmark.addBlockTypeCommand.key, {
8608
+ nodeType: imageBlock$1.imageBlockSchema.type(ctx2)
8609
+ });
8610
+ }
8611
+ });
8612
+ }
8584
8613
  blockGroup.addItem("quote", {
8585
8614
  label: ctx ? i18n(ctx, "menu.item.quote") : "Quote",
8586
8615
  icon: quoteIcon,
@@ -8647,19 +8676,6 @@ function buildDefaultFixedToolbar(builder, _config, ctx) {
8647
8676
  commands.call(linkTooltip$1.toggleLinkCommand.key);
8648
8677
  }
8649
8678
  });
8650
- if (isImageBlockEnabled) {
8651
- blockGroup.addItem("image", {
8652
- label: ctx ? i18n(ctx, "menu.item.image") : "Image",
8653
- icon: imageIcon,
8654
- active: () => false,
8655
- onRun: (ctx2) => {
8656
- const commands = ctx2.get(core.commandsCtx);
8657
- commands.call(commonmark.addBlockTypeCommand.key, {
8658
- nodeType: imageBlock$1.imageBlockSchema.type(ctx2)
8659
- });
8660
- }
8661
- });
8662
- }
8663
8679
  if (isAttachmentEnabled) {
8664
8680
  blockGroup.addItem("attachment", {
8665
8681
  label: ctx ? i18n(ctx, "menu.item.attachment") : "Video or File",
@@ -8712,22 +8728,6 @@ function buildDefaultFixedToolbar(builder, _config, ctx) {
8712
8728
  });
8713
8729
  }
8714
8730
  });
8715
- if (isTableEnabled) {
8716
- blockGroup.addItem("table", {
8717
- label: ctx ? i18n(ctx, "menu.item.table") : "Table",
8718
- icon: tableIcon,
8719
- active: () => false,
8720
- onRun: (ctx2) => {
8721
- const commands = ctx2.get(core.commandsCtx);
8722
- const view = ctx2.get(core.editorViewCtx);
8723
- const { from } = view.state.selection;
8724
- commands.call(commonmark.addBlockTypeCommand.key, {
8725
- nodeType: gfm.createTable(ctx2, 3, 3)
8726
- });
8727
- commands.call(commonmark.selectTextNearPosCommand.key, { pos: from });
8728
- }
8729
- });
8730
- }
8731
8731
  if (isLatexEnabled) {
8732
8732
  blockGroup.addItem("math-block", {
8733
8733
  label: ctx ? i18n(ctx, "menu.item.math") : "Math Block",