Skip to content

Commit 52b8d51

Browse files
committed
feat: export dragMoveHelper
1 parent 6666fba commit 52b8d51

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import initMouseEvent from './mouse'
66
import Bus from './utils/pubsub'
77
import { findEle } from './utils/dom'
88
import { createLinkSvg, createLine } from './utils/svg'
9+
import dragMoveHelper from './utils/dragMoveHelper'
910
// types
1011
export * from './types/index'
1112
export * from './types/dom'
@@ -160,6 +161,8 @@ if (import.meta.env.MODE !== 'lite') {
160161
})
161162
}
162163

164+
MindElixir.dragMoveHelper = dragMoveHelper
165+
163166
export interface MindElixirCtor {
164167
new (options: Options): MindElixirInstance
165168
E: typeof findEle
@@ -171,6 +174,7 @@ export interface MindElixirCtor {
171174
THEME: typeof THEME
172175
DARK_THEME: typeof DARK_THEME
173176
prototype: MindElixirMethods
177+
dragMoveHelper: typeof dragMoveHelper
174178
}
175179

176180
export default MindElixir as unknown as MindElixirCtor

src/mouse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function (mind: MindElixirInstance) {
2121
}
2222
mind.clearSelection()
2323
// e.preventDefault() // can cause <a /> tags don't work
24-
const target = e.target as any
24+
const target = e.target as HTMLElement
2525
if (target.tagName === 'ME-EPD') {
2626
mind.expandNode((target as Expander).previousSibling)
2727
} else if (isTopic(target)) {
@@ -30,7 +30,7 @@ export default function (mind: MindElixirInstance) {
3030
return
3131
} else if (target.tagName === 'text') {
3232
if (target.dataset.type === 'custom-link') {
33-
mind.selectArrow(target.parentElement as CustomSvg)
33+
mind.selectArrow(target.parentElement as unknown as CustomSvg)
3434
} else {
3535
mind.selectSummary(target.parentElement as unknown as SummarySvgGroup)
3636
}

0 commit comments

Comments
 (0)