mardora 1.2.1 → 1.2.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.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkOHZKW7YE_cjs = require('./chunk-OHZKW7YE.cjs');
3
+ var chunkU3D2P2CM_cjs = require('./chunk-U3D2P2CM.cjs');
4
4
  var chunkMLBEBFHB_cjs = require('./chunk-MLBEBFHB.cjs');
5
5
  var chunkKNDWF2DP_cjs = require('./chunk-KNDWF2DP.cjs');
6
6
  var chunk3ZOCCFDL_cjs = require('./chunk-3ZOCCFDL.cjs');
@@ -11,99 +11,99 @@ var chunkWFVCG4LD_cjs = require('./chunk-WFVCG4LD.cjs');
11
11
 
12
12
  Object.defineProperty(exports, "CODE_COPY_SUCCESS_ICON", {
13
13
  enumerable: true,
14
- get: function () { return chunkOHZKW7YE_cjs.CODE_COPY_SUCCESS_ICON; }
14
+ get: function () { return chunkU3D2P2CM_cjs.CODE_COPY_SUCCESS_ICON; }
15
15
  });
16
16
  Object.defineProperty(exports, "CodePlugin", {
17
17
  enumerable: true,
18
- get: function () { return chunkOHZKW7YE_cjs.CodePlugin; }
18
+ get: function () { return chunkU3D2P2CM_cjs.CodePlugin; }
19
19
  });
20
20
  Object.defineProperty(exports, "EmojiPlugin", {
21
21
  enumerable: true,
22
- get: function () { return chunkOHZKW7YE_cjs.EmojiPlugin; }
22
+ get: function () { return chunkU3D2P2CM_cjs.EmojiPlugin; }
23
23
  });
24
24
  Object.defineProperty(exports, "HRPlugin", {
25
25
  enumerable: true,
26
- get: function () { return chunkOHZKW7YE_cjs.HRPlugin; }
26
+ get: function () { return chunkU3D2P2CM_cjs.HRPlugin; }
27
27
  });
28
28
  Object.defineProperty(exports, "HTMLPlugin", {
29
29
  enumerable: true,
30
- get: function () { return chunkOHZKW7YE_cjs.HTMLPlugin; }
30
+ get: function () { return chunkU3D2P2CM_cjs.HTMLPlugin; }
31
31
  });
32
32
  Object.defineProperty(exports, "HeadingPlugin", {
33
33
  enumerable: true,
34
- get: function () { return chunkOHZKW7YE_cjs.HeadingPlugin; }
34
+ get: function () { return chunkU3D2P2CM_cjs.HeadingPlugin; }
35
35
  });
36
36
  Object.defineProperty(exports, "ImagePlugin", {
37
37
  enumerable: true,
38
- get: function () { return chunkOHZKW7YE_cjs.ImagePlugin; }
38
+ get: function () { return chunkU3D2P2CM_cjs.ImagePlugin; }
39
39
  });
40
40
  Object.defineProperty(exports, "InlinePlugin", {
41
41
  enumerable: true,
42
- get: function () { return chunkOHZKW7YE_cjs.InlinePlugin; }
42
+ get: function () { return chunkU3D2P2CM_cjs.InlinePlugin; }
43
43
  });
44
44
  Object.defineProperty(exports, "LinkPlugin", {
45
45
  enumerable: true,
46
- get: function () { return chunkOHZKW7YE_cjs.LinkPlugin; }
46
+ get: function () { return chunkU3D2P2CM_cjs.LinkPlugin; }
47
47
  });
48
48
  Object.defineProperty(exports, "ListPlugin", {
49
49
  enumerable: true,
50
- get: function () { return chunkOHZKW7YE_cjs.ListPlugin; }
50
+ get: function () { return chunkU3D2P2CM_cjs.ListPlugin; }
51
51
  });
52
52
  Object.defineProperty(exports, "MathPlugin", {
53
53
  enumerable: true,
54
- get: function () { return chunkOHZKW7YE_cjs.MathPlugin; }
54
+ get: function () { return chunkU3D2P2CM_cjs.MathPlugin; }
55
55
  });
56
56
  Object.defineProperty(exports, "MermaidPlugin", {
57
57
  enumerable: true,
58
- get: function () { return chunkOHZKW7YE_cjs.MermaidPlugin; }
58
+ get: function () { return chunkU3D2P2CM_cjs.MermaidPlugin; }
59
59
  });
60
60
  Object.defineProperty(exports, "ParagraphPlugin", {
61
61
  enumerable: true,
62
- get: function () { return chunkOHZKW7YE_cjs.ParagraphPlugin; }
62
+ get: function () { return chunkU3D2P2CM_cjs.ParagraphPlugin; }
63
63
  });
64
64
  Object.defineProperty(exports, "QuotePlugin", {
65
65
  enumerable: true,
66
- get: function () { return chunkOHZKW7YE_cjs.QuotePlugin; }
66
+ get: function () { return chunkU3D2P2CM_cjs.QuotePlugin; }
67
67
  });
68
68
  Object.defineProperty(exports, "TablePlugin", {
69
69
  enumerable: true,
70
- get: function () { return chunkOHZKW7YE_cjs.TablePlugin; }
70
+ get: function () { return chunkU3D2P2CM_cjs.TablePlugin; }
71
71
  });
72
72
  Object.defineProperty(exports, "allPlugins", {
73
73
  enumerable: true,
74
- get: function () { return chunkOHZKW7YE_cjs.allPlugins; }
74
+ get: function () { return chunkU3D2P2CM_cjs.allPlugins; }
75
75
  });
76
76
  Object.defineProperty(exports, "bindCodeCopyButtons", {
77
77
  enumerable: true,
78
- get: function () { return chunkOHZKW7YE_cjs.bindCodeCopyButtons; }
78
+ get: function () { return chunkU3D2P2CM_cjs.bindCodeCopyButtons; }
79
79
  });
80
80
  Object.defineProperty(exports, "bindImagePreviewButtons", {
81
81
  enumerable: true,
82
- get: function () { return chunkOHZKW7YE_cjs.bindImagePreviewButtons; }
82
+ get: function () { return chunkU3D2P2CM_cjs.bindImagePreviewButtons; }
83
83
  });
84
84
  Object.defineProperty(exports, "copyCodeTextToClipboard", {
85
85
  enumerable: true,
86
- get: function () { return chunkOHZKW7YE_cjs.copyCodeTextToClipboard; }
86
+ get: function () { return chunkU3D2P2CM_cjs.copyCodeTextToClipboard; }
87
87
  });
88
88
  Object.defineProperty(exports, "decodeCodeCopyPayload", {
89
89
  enumerable: true,
90
- get: function () { return chunkOHZKW7YE_cjs.decodeCodeCopyPayload; }
90
+ get: function () { return chunkU3D2P2CM_cjs.decodeCodeCopyPayload; }
91
91
  });
92
92
  Object.defineProperty(exports, "encodeCodeCopyPayload", {
93
93
  enumerable: true,
94
- get: function () { return chunkOHZKW7YE_cjs.encodeCodeCopyPayload; }
94
+ get: function () { return chunkU3D2P2CM_cjs.encodeCodeCopyPayload; }
95
95
  });
96
96
  Object.defineProperty(exports, "essentialPlugins", {
97
97
  enumerable: true,
98
- get: function () { return chunkOHZKW7YE_cjs.essentialPlugins; }
98
+ get: function () { return chunkU3D2P2CM_cjs.essentialPlugins; }
99
99
  });
100
100
  Object.defineProperty(exports, "resolveCalloutTitleInputTarget", {
101
101
  enumerable: true,
102
- get: function () { return chunkOHZKW7YE_cjs.resolveCalloutTitleInputTarget; }
102
+ get: function () { return chunkU3D2P2CM_cjs.resolveCalloutTitleInputTarget; }
103
103
  });
104
104
  Object.defineProperty(exports, "resolveCalloutTypeChange", {
105
105
  enumerable: true,
106
- get: function () { return chunkOHZKW7YE_cjs.resolveCalloutTypeChange; }
106
+ get: function () { return chunkU3D2P2CM_cjs.resolveCalloutTypeChange; }
107
107
  });
108
108
  Object.defineProperty(exports, "Compartment", {
109
109
  enumerable: true,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { CODE_COPY_SUCCESS_ICON, CodePlugin, EmojiPlugin, HRPlugin, HTMLPlugin, HeadingPlugin, ImagePlugin, InlinePlugin, LinkPlugin, ListPlugin, MathPlugin, MermaidPlugin, ParagraphPlugin, QuotePlugin, TablePlugin, allPlugins, bindCodeCopyButtons, bindImagePreviewButtons, copyCodeTextToClipboard, decodeCodeCopyPayload, encodeCodeCopyPayload, essentialPlugins, resolveCalloutTitleInputTarget, resolveCalloutTypeChange } from './chunk-PCXW2FUR.js';
1
+ export { CODE_COPY_SUCCESS_ICON, CodePlugin, EmojiPlugin, HRPlugin, HTMLPlugin, HeadingPlugin, ImagePlugin, InlinePlugin, LinkPlugin, ListPlugin, MathPlugin, MermaidPlugin, ParagraphPlugin, QuotePlugin, TablePlugin, allPlugins, bindCodeCopyButtons, bindImagePreviewButtons, copyCodeTextToClipboard, decodeCodeCopyPayload, encodeCodeCopyPayload, essentialPlugins, resolveCalloutTitleInputTarget, resolveCalloutTypeChange } from './chunk-SMHHXYOS.js';
2
2
  export { Compartment, DecorationPlugin, EditorSelection, EditorState, EditorView, MardoraPlugin, StateEffect, StateField, SyntaxPlugin, attachments, buildBlockTypeChange, buildInlineFormatChange, buildLinkChange, buildListChange, buildSlashReplacement, computeSelectionToolbarLayout, createSelectionToolbarElement, createSlashMenuElement, createSlashRuntimeConfig, createUploadMarker, defaultMardoraLocale, defaultSlashCommands, detectAttachmentKind, detectSelectionBlockType, detectSlashQuery, extractHeadingFoldRangesFromState, filterSlashCommands, formatAttachmentMarkdown, getDefaultSlashCommands, getSelectionToolbarMessages, getSlashMessages, headingFold, headingFoldTheme, highlightActiveLine, isAcceptedAttachment, keymap, mardora, mardoraBaseTheme, markdownResetExtension, parseSelectedLink, resolveHeadingFoldConfig, resolveMardoraLocale, selectionToolbar, selectionToolbarTheme, slashCommands, slashMenuTheme, uploadAttachmentFile } from './chunk-XL6WFGJT.js';
3
3
  export { createWrapSelectionInputHandler } from './chunk-BIKZQZ6W.js';
4
4
  export { extractPreviewTocFromMarkdown, generateCSS, preview } from './chunk-G4SE26YY.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkOHZKW7YE_cjs = require('../chunk-OHZKW7YE.cjs');
3
+ var chunkU3D2P2CM_cjs = require('../chunk-U3D2P2CM.cjs');
4
4
  require('../chunk-MLBEBFHB.cjs');
5
5
  require('../chunk-KNDWF2DP.cjs');
6
6
  require('../chunk-SWFUKJDO.cjs');
@@ -10,99 +10,99 @@ require('../chunk-WFVCG4LD.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "CODE_COPY_SUCCESS_ICON", {
12
12
  enumerable: true,
13
- get: function () { return chunkOHZKW7YE_cjs.CODE_COPY_SUCCESS_ICON; }
13
+ get: function () { return chunkU3D2P2CM_cjs.CODE_COPY_SUCCESS_ICON; }
14
14
  });
15
15
  Object.defineProperty(exports, "CodePlugin", {
16
16
  enumerable: true,
17
- get: function () { return chunkOHZKW7YE_cjs.CodePlugin; }
17
+ get: function () { return chunkU3D2P2CM_cjs.CodePlugin; }
18
18
  });
19
19
  Object.defineProperty(exports, "EmojiPlugin", {
20
20
  enumerable: true,
21
- get: function () { return chunkOHZKW7YE_cjs.EmojiPlugin; }
21
+ get: function () { return chunkU3D2P2CM_cjs.EmojiPlugin; }
22
22
  });
23
23
  Object.defineProperty(exports, "HRPlugin", {
24
24
  enumerable: true,
25
- get: function () { return chunkOHZKW7YE_cjs.HRPlugin; }
25
+ get: function () { return chunkU3D2P2CM_cjs.HRPlugin; }
26
26
  });
27
27
  Object.defineProperty(exports, "HTMLPlugin", {
28
28
  enumerable: true,
29
- get: function () { return chunkOHZKW7YE_cjs.HTMLPlugin; }
29
+ get: function () { return chunkU3D2P2CM_cjs.HTMLPlugin; }
30
30
  });
31
31
  Object.defineProperty(exports, "HeadingPlugin", {
32
32
  enumerable: true,
33
- get: function () { return chunkOHZKW7YE_cjs.HeadingPlugin; }
33
+ get: function () { return chunkU3D2P2CM_cjs.HeadingPlugin; }
34
34
  });
35
35
  Object.defineProperty(exports, "ImagePlugin", {
36
36
  enumerable: true,
37
- get: function () { return chunkOHZKW7YE_cjs.ImagePlugin; }
37
+ get: function () { return chunkU3D2P2CM_cjs.ImagePlugin; }
38
38
  });
39
39
  Object.defineProperty(exports, "InlinePlugin", {
40
40
  enumerable: true,
41
- get: function () { return chunkOHZKW7YE_cjs.InlinePlugin; }
41
+ get: function () { return chunkU3D2P2CM_cjs.InlinePlugin; }
42
42
  });
43
43
  Object.defineProperty(exports, "LinkPlugin", {
44
44
  enumerable: true,
45
- get: function () { return chunkOHZKW7YE_cjs.LinkPlugin; }
45
+ get: function () { return chunkU3D2P2CM_cjs.LinkPlugin; }
46
46
  });
47
47
  Object.defineProperty(exports, "ListPlugin", {
48
48
  enumerable: true,
49
- get: function () { return chunkOHZKW7YE_cjs.ListPlugin; }
49
+ get: function () { return chunkU3D2P2CM_cjs.ListPlugin; }
50
50
  });
51
51
  Object.defineProperty(exports, "MathPlugin", {
52
52
  enumerable: true,
53
- get: function () { return chunkOHZKW7YE_cjs.MathPlugin; }
53
+ get: function () { return chunkU3D2P2CM_cjs.MathPlugin; }
54
54
  });
55
55
  Object.defineProperty(exports, "MermaidPlugin", {
56
56
  enumerable: true,
57
- get: function () { return chunkOHZKW7YE_cjs.MermaidPlugin; }
57
+ get: function () { return chunkU3D2P2CM_cjs.MermaidPlugin; }
58
58
  });
59
59
  Object.defineProperty(exports, "ParagraphPlugin", {
60
60
  enumerable: true,
61
- get: function () { return chunkOHZKW7YE_cjs.ParagraphPlugin; }
61
+ get: function () { return chunkU3D2P2CM_cjs.ParagraphPlugin; }
62
62
  });
63
63
  Object.defineProperty(exports, "QuotePlugin", {
64
64
  enumerable: true,
65
- get: function () { return chunkOHZKW7YE_cjs.QuotePlugin; }
65
+ get: function () { return chunkU3D2P2CM_cjs.QuotePlugin; }
66
66
  });
67
67
  Object.defineProperty(exports, "TablePlugin", {
68
68
  enumerable: true,
69
- get: function () { return chunkOHZKW7YE_cjs.TablePlugin; }
69
+ get: function () { return chunkU3D2P2CM_cjs.TablePlugin; }
70
70
  });
71
71
  Object.defineProperty(exports, "allPlugins", {
72
72
  enumerable: true,
73
- get: function () { return chunkOHZKW7YE_cjs.allPlugins; }
73
+ get: function () { return chunkU3D2P2CM_cjs.allPlugins; }
74
74
  });
75
75
  Object.defineProperty(exports, "bindCodeCopyButtons", {
76
76
  enumerable: true,
77
- get: function () { return chunkOHZKW7YE_cjs.bindCodeCopyButtons; }
77
+ get: function () { return chunkU3D2P2CM_cjs.bindCodeCopyButtons; }
78
78
  });
79
79
  Object.defineProperty(exports, "bindImagePreviewButtons", {
80
80
  enumerable: true,
81
- get: function () { return chunkOHZKW7YE_cjs.bindImagePreviewButtons; }
81
+ get: function () { return chunkU3D2P2CM_cjs.bindImagePreviewButtons; }
82
82
  });
83
83
  Object.defineProperty(exports, "copyCodeTextToClipboard", {
84
84
  enumerable: true,
85
- get: function () { return chunkOHZKW7YE_cjs.copyCodeTextToClipboard; }
85
+ get: function () { return chunkU3D2P2CM_cjs.copyCodeTextToClipboard; }
86
86
  });
87
87
  Object.defineProperty(exports, "decodeCodeCopyPayload", {
88
88
  enumerable: true,
89
- get: function () { return chunkOHZKW7YE_cjs.decodeCodeCopyPayload; }
89
+ get: function () { return chunkU3D2P2CM_cjs.decodeCodeCopyPayload; }
90
90
  });
91
91
  Object.defineProperty(exports, "encodeCodeCopyPayload", {
92
92
  enumerable: true,
93
- get: function () { return chunkOHZKW7YE_cjs.encodeCodeCopyPayload; }
93
+ get: function () { return chunkU3D2P2CM_cjs.encodeCodeCopyPayload; }
94
94
  });
95
95
  Object.defineProperty(exports, "essentialPlugins", {
96
96
  enumerable: true,
97
- get: function () { return chunkOHZKW7YE_cjs.essentialPlugins; }
97
+ get: function () { return chunkU3D2P2CM_cjs.essentialPlugins; }
98
98
  });
99
99
  Object.defineProperty(exports, "resolveCalloutTitleInputTarget", {
100
100
  enumerable: true,
101
- get: function () { return chunkOHZKW7YE_cjs.resolveCalloutTitleInputTarget; }
101
+ get: function () { return chunkU3D2P2CM_cjs.resolveCalloutTitleInputTarget; }
102
102
  });
103
103
  Object.defineProperty(exports, "resolveCalloutTypeChange", {
104
104
  enumerable: true,
105
- get: function () { return chunkOHZKW7YE_cjs.resolveCalloutTypeChange; }
105
+ get: function () { return chunkU3D2P2CM_cjs.resolveCalloutTypeChange; }
106
106
  });
107
107
  //# sourceMappingURL=index.cjs.map
108
108
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- export { CODE_COPY_SUCCESS_ICON, CodePlugin, EmojiPlugin, HRPlugin, HTMLPlugin, HeadingPlugin, ImagePlugin, InlinePlugin, LinkPlugin, ListPlugin, MathPlugin, MermaidPlugin, ParagraphPlugin, QuotePlugin, TablePlugin, allPlugins, bindCodeCopyButtons, bindImagePreviewButtons, copyCodeTextToClipboard, decodeCodeCopyPayload, encodeCodeCopyPayload, essentialPlugins, resolveCalloutTitleInputTarget, resolveCalloutTypeChange } from '../chunk-PCXW2FUR.js';
1
+ export { CODE_COPY_SUCCESS_ICON, CodePlugin, EmojiPlugin, HRPlugin, HTMLPlugin, HeadingPlugin, ImagePlugin, InlinePlugin, LinkPlugin, ListPlugin, MathPlugin, MermaidPlugin, ParagraphPlugin, QuotePlugin, TablePlugin, allPlugins, bindCodeCopyButtons, bindImagePreviewButtons, copyCodeTextToClipboard, decodeCodeCopyPayload, encodeCodeCopyPayload, essentialPlugins, resolveCalloutTitleInputTarget, resolveCalloutTypeChange } from '../chunk-SMHHXYOS.js';
2
2
  import '../chunk-XL6WFGJT.js';
3
3
  import '../chunk-BIKZQZ6W.js';
4
4
  import '../chunk-EQJESPP2.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mardora",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Core library for Mardora",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -44,6 +44,14 @@ interface ImageMarkdownRange {
44
44
 
45
45
  const imageWidthAttributePattern = /^(\s*)\{width=(\d+)\}/;
46
46
  const minImageWidth = 120;
47
+ const imageWidgetEditorSelectionEventTypes = new Set([
48
+ "mousedown",
49
+ "mouseup",
50
+ "mousemove",
51
+ "pointerdown",
52
+ "pointermove",
53
+ "pointerup",
54
+ ]);
47
55
  const previewImageIcon =
48
56
  '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3h6v6"></path><path d="m21 3-7 7"></path><path d="M9 21H3v-6"></path><path d="m3 21 7-7"></path></svg>';
49
57
 
@@ -261,9 +269,8 @@ class ImageWidget extends WidgetType {
261
269
  }
262
270
 
263
271
  override ignoreEvent(event: Event) {
264
- return !["click", "mousedown", "mouseup", "mousemove", "pointerdown", "pointermove", "pointerup"].includes(
265
- event.type
266
- );
272
+ if (imageWidgetEditorSelectionEventTypes.has(event.type)) return true;
273
+ return event.type !== "click";
267
274
  }
268
275
 
269
276
  private createToolbar(view: EditorView, figure: HTMLElement): HTMLElement {