Skip to content

Commit

Permalink
feat: remove mobile node menu
Browse files Browse the repository at this point in the history
The mobile node menu has been removed to allow better customization.
  • Loading branch information
SSShooter committed Oct 22, 2024
1 parent 81c748c commit e7c4256
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 209 deletions.
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 100],
'body-max-line-length': [2, 'always', 120],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 100],
'header-max-length': [2, 'always', 100],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mind-elixir",
"version": "4.2.2",
"version": "4.2.3",
"type": "module",
"description": "Mind elixir is a free open source mind map core.",
"keywords": [
Expand Down
1 change: 0 additions & 1 deletion src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const options: Options = {
},
],
},
mobileMenu: true,
toolBar: true,
nodeMenu: true,
keypress: true,
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ function MindElixir(
generateMainBranch,
generateSubBranch,
overflowHidden,
mobileMenu,
theme,
}: Options
): void {
Expand All @@ -63,7 +62,6 @@ function MindElixir(
this.toolBar = toolBar === undefined ? true : toolBar
this.keypress = keypress === undefined ? true : keypress
this.mouseSelectionButton = mouseSelectionButton || 0
this.mobileMenu = mobileMenu || false
// record the direction before enter focus mode, must true in focus mode, reset to null after exit focus
this.direction = typeof direction === 'number' ? direction : 1
this.draggable = draggable === undefined ? true : draggable
Expand Down
7 changes: 2 additions & 5 deletions src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import type { MindElixirInstance, MindElixirData } from './index'
import linkDiv from './linkDiv'
import contextMenu from './plugin/contextMenu'
import keypress from './plugin/keypress'
import mobileMenu from './plugin/mobileMenu'
import nodeDraggable from './plugin/nodeDraggable'
import operationHistory from './plugin/operationHistory'
import toolBar from './plugin/toolBar'
import selection from './plugin/selection'
import { editTopic, createWrapper, createParent, createChildren, createTopic, findEle } from './utils/dom'
import { getObjById, generateNewObj, fillParent, isMobile } from './utils/index'
import { getObjById, generateNewObj, fillParent } from './utils/index'
import { layout } from './utils/layout'
import changeTheme from './utils/theme'
import * as interact from './interact'
Expand Down Expand Up @@ -89,9 +88,7 @@ const methods = {
if (this.editable) {
selection(this)
}
if (isMobile() && this.mobileMenu) {
mobileMenu(this)
} else if (this.contextMenu) {
if (this.contextMenu) {
this.disposable.push(contextMenu(this, this.contextMenuOption))
}
this.draggable && nodeDraggable(this)
Expand Down
42 changes: 0 additions & 42 deletions src/plugin/mobileMenu.less

This file was deleted.

155 changes: 0 additions & 155 deletions src/plugin/mobileMenu.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export interface MindElixirInstance extends MindElixirMethods {
overflowHidden: boolean
mainBranchStyle: number
subBranchStyle: number
mobileMenu: boolean
generateMainBranch: (params: MainLineParams) => PathString
generateSubBranch: (params: SubLineParams) => PathString

Expand Down Expand Up @@ -130,7 +129,6 @@ export type Options = {
overflowHidden?: boolean
generateMainBranch?: (this: MindElixirInstance, params: MainLineParams) => PathString
generateSubBranch?: (this: MindElixirInstance, params: SubLineParams) => PathString
mobileMenu?: boolean
theme?: Theme
nodeMenu?: boolean
selectionContainer?: string | HTMLElement
Expand Down

0 comments on commit e7c4256

Please sign in to comment.