@gantfdt/semiword 1.1.0 → 1.1.2

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.
@@ -1,4 +1,4 @@
1
- import { createStyles, useBlockStyles, Button, IconEdit, IconDelete, IconVideo, IconAttachment, createGraphicBlockView, createGraphicBlockNode, IconUndo, IconRedo, IconParagraph, IconQuote, IconCode, IconDivider, IconBulletList, IconOrderedList, IconTaskList, IconBold, IconItalic, IconUnderline, IconStrikethrough, IconTextColor, IconAlignLeft, IconAlignCenter, IconAlignRight, IconClearFormat, IconFormatPainter, IconBackgroundColor, IconTable, IconImage, IconFlowchart, IconWhiteboard, IconMindmap, IconMention, Tooltip, IconLink, Modal as Modal$1, Input, DatePicker } from './chunk-WT7ZJINB.mjs';
1
+ import { createStyles, useBlockStyles, Button, IconEdit, IconDelete, IconVideo, IconAttachment, createGraphicBlockView, createGraphicBlockNode, IconUndo, IconRedo, IconParagraph, IconQuote, IconCode, IconDivider, IconBulletList, IconOrderedList, IconTaskList, IconBold, IconItalic, IconStrikethrough, IconUnderline, IconTextColor, IconAlignLeft, IconAlignCenter, IconAlignRight, IconClearFormat, IconFormatPainter, IconBackgroundColor, IconTable, IconImage, IconFlowchart, IconWhiteboard, IconMindmap, IconMention, Tooltip, IconLink, Modal as Modal$1, Input, DatePicker } from './chunk-WT7ZJINB.mjs';
2
2
  import { sanitizeSvg, DATA_MEDIA_URI_PATTERN } from './chunk-7D6NMYFG.mjs';
3
3
  import { readTemplateBlockMeta, renderTemplateBlockMeta, parseTemplateBlockMeta, getTemplateBlockRegistry, effectivePin, createTemplateController, getRegisteredTemplateBlockExtensions, createIntegrityExtension } from './chunk-EOUNN3NA.mjs';
4
4
  import { tr } from './chunk-W627LLF4.mjs';
@@ -60,7 +60,7 @@ import Placeholder from '@tiptap/extension-placeholder';
60
60
  import CharacterCount from '@tiptap/extension-character-count';
61
61
 
62
62
  // src/editor/plugins/constants.ts
63
- var DEFAULT_TOOLBAR_GROUP_ORDER = ["history", "block", "format", "color", "list", "align", "insert"];
63
+ var DEFAULT_TOOLBAR_GROUP_ORDER = ["history", "format", "color", "layout", "insert"];
64
64
  var MINIMAL_PLUGINS = [
65
65
  "starter",
66
66
  "heading",
@@ -1398,7 +1398,7 @@ var headingPlugin = {
1398
1398
  {
1399
1399
  id: "heading",
1400
1400
  type: "dropdown",
1401
- group: "block",
1401
+ group: "format",
1402
1402
  order: 10,
1403
1403
  label: tr("\u6807\u9898"),
1404
1404
  icon: /* @__PURE__ */ jsx(IconParagraph, {}),
@@ -1453,8 +1453,8 @@ var blockquotePlugin = {
1453
1453
  {
1454
1454
  id: "blockquote",
1455
1455
  type: "button",
1456
- group: "block",
1457
- order: 15,
1456
+ group: "insert",
1457
+ order: 61,
1458
1458
  label: tr("\u5F15\u7528"),
1459
1459
  icon: /* @__PURE__ */ jsx(IconQuote, {}),
1460
1460
  isActive: (editor) => editor.isActive("blockquote"),
@@ -1723,8 +1723,8 @@ var codeBlockPlugin = {
1723
1723
  {
1724
1724
  id: "code-block",
1725
1725
  type: "button",
1726
- group: "block",
1727
- order: 16,
1726
+ group: "insert",
1727
+ order: 68,
1728
1728
  label: tr("\u4EE3\u7801\u5757"),
1729
1729
  icon: /* @__PURE__ */ jsx(IconCode, {}),
1730
1730
  isActive: (editor) => editor.isActive("codeBlock"),
@@ -1766,8 +1766,8 @@ var horizontalRulePlugin = {
1766
1766
  {
1767
1767
  id: "horizontal-rule",
1768
1768
  type: "button",
1769
- group: "block",
1770
- order: 17,
1769
+ group: "insert",
1770
+ order: 62,
1771
1771
  label: tr("\u5206\u5272\u7EBF"),
1772
1772
  icon: /* @__PURE__ */ jsx(IconDivider, {}),
1773
1773
  onClick: (editor) => editor.chain().focus().setHorizontalRule().run()
@@ -1812,7 +1812,7 @@ var listPlugin = {
1812
1812
  {
1813
1813
  id: "bullet-list",
1814
1814
  type: "button",
1815
- group: "list",
1815
+ group: "layout",
1816
1816
  order: 50,
1817
1817
  label: tr("\u65E0\u5E8F\u5217\u8868"),
1818
1818
  icon: /* @__PURE__ */ jsx(IconBulletList, {}),
@@ -1822,7 +1822,7 @@ var listPlugin = {
1822
1822
  {
1823
1823
  id: "ordered-list",
1824
1824
  type: "button",
1825
- group: "list",
1825
+ group: "layout",
1826
1826
  order: 51,
1827
1827
  label: tr("\u6709\u5E8F\u5217\u8868"),
1828
1828
  icon: /* @__PURE__ */ jsx(IconOrderedList, {}),
@@ -1879,7 +1879,7 @@ var taskListPlugin = {
1879
1879
  {
1880
1880
  id: "task-list",
1881
1881
  type: "button",
1882
- group: "list",
1882
+ group: "layout",
1883
1883
  order: 52,
1884
1884
  label: tr("\u4EFB\u52A1\u5217\u8868"),
1885
1885
  icon: /* @__PURE__ */ jsx(IconTaskList, {}),
@@ -2504,24 +2504,24 @@ var textFormatPlugin = {
2504
2504
  onClick: (editor) => editor.chain().focus().toggleItalic().run()
2505
2505
  },
2506
2506
  {
2507
- id: "underline",
2507
+ id: "strike",
2508
2508
  type: "button",
2509
2509
  group: "format",
2510
2510
  order: 22,
2511
- label: tr("\u4E0B\u5212\u7EBF"),
2512
- icon: /* @__PURE__ */ jsx(IconUnderline, {}),
2513
- isActive: (editor) => editor.isActive("underline"),
2514
- onClick: (editor) => editor.chain().focus().toggleUnderline().run()
2511
+ label: tr("\u5220\u9664\u7EBF"),
2512
+ icon: /* @__PURE__ */ jsx(IconStrikethrough, {}),
2513
+ isActive: (editor) => editor.isActive("strike"),
2514
+ onClick: (editor) => editor.chain().focus().toggleStrike().run()
2515
2515
  },
2516
2516
  {
2517
- id: "strike",
2517
+ id: "underline",
2518
2518
  type: "button",
2519
2519
  group: "format",
2520
2520
  order: 23,
2521
- label: tr("\u5220\u9664\u7EBF"),
2522
- icon: /* @__PURE__ */ jsx(IconStrikethrough, {}),
2523
- isActive: (editor) => editor.isActive("strike"),
2524
- onClick: (editor) => editor.chain().focus().toggleStrike().run()
2521
+ label: tr("\u4E0B\u5212\u7EBF"),
2522
+ icon: /* @__PURE__ */ jsx(IconUnderline, {}),
2523
+ isActive: (editor) => editor.isActive("underline"),
2524
+ onClick: (editor) => editor.chain().focus().toggleUnderline().run()
2525
2525
  }
2526
2526
  ],
2527
2527
  // AI 能力声明:mark 类——基础文字格式的行内标记,全部 toggle 语义(应用/取消
@@ -2679,7 +2679,7 @@ var textAlignPlugin = {
2679
2679
  {
2680
2680
  id: "align-left",
2681
2681
  type: "button",
2682
- group: "align",
2682
+ group: "layout",
2683
2683
  order: 40,
2684
2684
  label: tr("\u5DE6\u5BF9\u9F50"),
2685
2685
  icon: /* @__PURE__ */ jsx(IconAlignLeft, {}),
@@ -2689,7 +2689,7 @@ var textAlignPlugin = {
2689
2689
  {
2690
2690
  id: "align-center",
2691
2691
  type: "button",
2692
- group: "align",
2692
+ group: "layout",
2693
2693
  order: 41,
2694
2694
  label: tr("\u5C45\u4E2D"),
2695
2695
  icon: /* @__PURE__ */ jsx(IconAlignCenter, {}),
@@ -2699,7 +2699,7 @@ var textAlignPlugin = {
2699
2699
  {
2700
2700
  id: "align-right",
2701
2701
  type: "button",
2702
- group: "align",
2702
+ group: "layout",
2703
2703
  order: 42,
2704
2704
  label: tr("\u53F3\u5BF9\u9F50"),
2705
2705
  icon: /* @__PURE__ */ jsx(IconAlignRight, {}),
@@ -2730,8 +2730,8 @@ var clearFormatPlugin = {
2730
2730
  {
2731
2731
  id: "clear-format",
2732
2732
  type: "button",
2733
- group: "format",
2734
- order: 26,
2733
+ group: "history",
2734
+ order: 3,
2735
2735
  label: tr("\u6E05\u9664\u683C\u5F0F"),
2736
2736
  icon: /* @__PURE__ */ jsx(IconClearFormat, {}),
2737
2737
  onClick: (editor) => editor.chain().focus().unsetAllMarks().clearNodes().run()
@@ -2832,8 +2832,8 @@ var formatPainterPlugin = {
2832
2832
  {
2833
2833
  id: "format-painter",
2834
2834
  type: "button",
2835
- group: "format",
2836
- order: 25,
2835
+ group: "history",
2836
+ order: 2,
2837
2837
  label: tr("\u683C\u5F0F\u5237"),
2838
2838
  icon: /* @__PURE__ */ jsx(IconFormatPainter, {}),
2839
2839
  isActive: (editor) => isFormatPainterArmed(editor),
@@ -2892,8 +2892,6 @@ var backgroundColorPlugin = {
2892
2892
  order: 31,
2893
2893
  label: tr("\u80CC\u666F\u989C\u8272"),
2894
2894
  icon: /* @__PURE__ */ jsx(IconBackgroundColor, {}),
2895
- // 首次点击左侧图标区时应用编辑器默认高亮色
2896
- initialColor: "#FADB14",
2897
2895
  getActiveValue: (editor) => {
2898
2896
  const attrs = editor.getAttributes("highlight");
2899
2897
  return attrs.gradient || attrs.color || null;
@@ -4268,7 +4266,7 @@ var tablePlugin = {
4268
4266
  id: "table",
4269
4267
  type: "table-grid",
4270
4268
  group: "insert",
4271
- order: 60,
4269
+ order: 65,
4272
4270
  label: tr("\u8868\u683C"),
4273
4271
  icon: /* @__PURE__ */ jsx(IconTable, {}),
4274
4272
  isActive: (editor) => editor.isActive("table"),
@@ -4614,7 +4612,7 @@ var imagePlugin = {
4614
4612
  id: "image",
4615
4613
  type: "button",
4616
4614
  group: "insert",
4617
- order: 61,
4615
+ order: 63,
4618
4616
  label: tr("\u56FE\u7247"),
4619
4617
  icon: /* @__PURE__ */ jsx(IconImage, {}),
4620
4618
  onClick: (editor) => runInsertImage(editor, config)
@@ -5093,7 +5091,7 @@ var videoPlugin = {
5093
5091
  id: "video",
5094
5092
  type: "button",
5095
5093
  group: "insert",
5096
- order: 62,
5094
+ order: 66,
5097
5095
  label: tr("\u89C6\u9891"),
5098
5096
  icon: /* @__PURE__ */ jsx(IconVideo, {}),
5099
5097
  onClick: (editor) => startInsertVideo(editor, config)
@@ -5374,7 +5372,7 @@ var attachmentPlugin = {
5374
5372
  id: "attachment",
5375
5373
  type: "button",
5376
5374
  group: "insert",
5377
- order: 63,
5375
+ order: 64,
5378
5376
  label: tr("\u9644\u4EF6"),
5379
5377
  icon: /* @__PURE__ */ jsx(IconAttachment, {}),
5380
5378
  onClick: (editor) => runInsertAttachment(editor, config)
@@ -5421,7 +5419,7 @@ var flowchartPlugin = {
5421
5419
  id: "flowchart",
5422
5420
  type: "button",
5423
5421
  group: "insert",
5424
- order: 64,
5422
+ order: 69,
5425
5423
  label: tr("\u6D41\u7A0B\u56FE"),
5426
5424
  icon: /* @__PURE__ */ jsx(IconFlowchart, {}),
5427
5425
  onClick: (editor) => editor.chain().focus().insertFlowchartBlock().run()
@@ -5490,7 +5488,7 @@ var whiteboardPlugin = {
5490
5488
  id: "whiteboard",
5491
5489
  type: "button",
5492
5490
  group: "insert",
5493
- order: 65,
5491
+ order: 70,
5494
5492
  label: tr("\u753B\u677F"),
5495
5493
  icon: /* @__PURE__ */ jsx(IconWhiteboard, {}),
5496
5494
  onClick: (editor) => editor.chain().focus().insertWhiteboardBlock().run()
@@ -5537,7 +5535,7 @@ var mindmapPlugin = {
5537
5535
  id: "mindmap",
5538
5536
  type: "button",
5539
5537
  group: "insert",
5540
- order: 66,
5538
+ order: 71,
5541
5539
  label: tr("\u601D\u7EF4\u5BFC\u56FE"),
5542
5540
  icon: /* @__PURE__ */ jsx(IconMindmap, {}),
5543
5541
  onClick: (editor) => editor.chain().focus().insertMindmapBlock().run()
@@ -5733,7 +5731,7 @@ var linkPlugin = {
5733
5731
  id: "link",
5734
5732
  type: "custom",
5735
5733
  group: "insert",
5736
- order: 62,
5734
+ order: 60,
5737
5735
  label: tr("\u94FE\u63A5"),
5738
5736
  render: (editor) => /* @__PURE__ */ jsx(LinkEditorButton, { editor })
5739
5737
  }
@@ -6278,7 +6276,7 @@ var mentionPlugin = {
6278
6276
  id: "mention",
6279
6277
  type: "button",
6280
6278
  group: "insert",
6281
- order: 63,
6279
+ order: 67,
6282
6280
  label: tr("\u63D0\u53CA"),
6283
6281
  icon: /* @__PURE__ */ jsx(IconMention, {}),
6284
6282
  onClick: (editor) => {
@@ -7297,5 +7295,5 @@ function fixedTableCss({ token, pa, borderRadius, mode, sel: s }) {
7297
7295
  }
7298
7296
 
7299
7297
  export { BUILTIN_PLUGINS, DEFAULT_TOOLBAR_GROUP_ORDER, FIXED_CELL_BG, HIGHLIGHT_THEME_CSS, MINIMAL_PLUGINS, PluginRegistry, codeBlockCss, configureEditorFeedback, configureEditorLocale, createCssScope, downloadFile, escapeHtml, findAncestor, fixedTableCss, getDefaultPlaceholder, glassSurfaceCss, headerControlForCol, isPlainObject, isSafeCssColor, lowlight, normalizeFixedTableBackgroundColor, outlinePlugin, parseFormula, pickFile, readFileAsText, readFixedCellControl, resolveCellControl, sanitizeJsonContent, showConfirmModal, showMessage, tableCss, templateCss, templatePlugin, typographyCss, validateFormula };
7300
- //# sourceMappingURL=chunk-6XGJMUU3.mjs.map
7301
- //# sourceMappingURL=chunk-6XGJMUU3.mjs.map
7298
+ //# sourceMappingURL=chunk-YE3O5CVM.mjs.map
7299
+ //# sourceMappingURL=chunk-YE3O5CVM.mjs.map