diff --git a/src/DragDropApp.tsx b/src/DragDropApp.tsx index 999fbac5..137dd074 100644 --- a/src/DragDropApp.tsx +++ b/src/DragDropApp.tsx @@ -97,14 +97,6 @@ export function DragDropApp({ win, plugin }: { win: Window; plugin: KanbanPlugin dropPath.push(0); } - plugin.app.workspace.trigger( - 'kanban:card-moved', - stateManager.file, - dragPath, - dropPath, - dragEntityData - ); - return stateManager.setState((board) => { let didMoveItem = false; diff --git a/src/StateManager.ts b/src/StateManager.ts index 5409cefb..17397498 100644 --- a/src/StateManager.ts +++ b/src/StateManager.ts @@ -388,8 +388,6 @@ export class StateManager { }); }); - this.app.workspace.trigger('kanban:board-cards-archived', this.file, archived); - try { this.setState( update(board, { diff --git a/src/helpers/boardModifiers.ts b/src/helpers/boardModifiers.ts index 4262608f..ebdb16c7 100644 --- a/src/helpers/boardModifiers.ts +++ b/src/helpers/boardModifiers.ts @@ -55,44 +55,24 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { return { appendItems: (path: Path, items: Item[]) => { - items.forEach((item) => - stateManager.app.workspace.trigger('kanban:card-added', stateManager.file, item) - ); - stateManager.setState((boardData) => appendEntities(boardData, path, items)); }, prependItems: (path: Path, items: Item[]) => { - items.forEach((item) => - stateManager.app.workspace.trigger('kanban:card-added', stateManager.file, item) - ); - stateManager.setState((boardData) => prependEntities(boardData, path, items)); }, insertItems: (path: Path, items: Item[]) => { - items.forEach((item) => - stateManager.app.workspace.trigger('kanban:card-added', stateManager.file, item) - ); - stateManager.setState((boardData) => insertEntity(boardData, path, items)); }, replaceItem: (path: Path, items: Item[]) => { - items.forEach((item) => - stateManager.app.workspace.trigger('kanban:card-added', stateManager.file, item) - ); - stateManager.setState((boardData) => insertEntity(removeEntity(boardData, path), path, items) ); }, splitItem: (path: Path, items: Item[]) => { - items.forEach((item) => - stateManager.app.workspace.trigger('kanban:card-added', stateManager.file, item) - ); - stateManager.setState((boardData) => { return insertEntity(removeEntity(boardData, path), path, items); }); @@ -111,20 +91,14 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { }, addLane: (lane: Lane) => { - stateManager.app.workspace.trigger('kanban:lane-added', stateManager.file, lane); - stateManager.setState((boardData) => appendEntities(boardData, [], [lane])); }, insertLane: (path: Path, lane: Lane) => { - stateManager.app.workspace.trigger('kanban:lane-added', stateManager.file, lane); - stateManager.setState((boardData) => insertEntity(boardData, path, [lane])); }, updateLane: (path: Path, lane: Lane) => { - stateManager.app.workspace.trigger('kanban:lane-updated', stateManager.file, lane); - stateManager.setState((boardData) => updateParentEntity(boardData, path, { children: { @@ -141,8 +115,6 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { const lane = getEntityFromPath(boardData, path); const items = lane.children; - stateManager.app.workspace.trigger('kanban:lane-archived', stateManager.file, lane); - try { return update(removeEntity(boardData, path), { data: { @@ -165,8 +137,6 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { const lane = getEntityFromPath(boardData, path); const items = lane.children; - stateManager.app.workspace.trigger('kanban:lane-cards-archived', stateManager.file, items); - try { return update( updateEntity(boardData, path, { @@ -193,24 +163,12 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { deleteEntity: (path: Path) => { stateManager.setState((boardData) => { - const entity = getEntityFromPath(boardData, path); - - stateManager.app.workspace.trigger( - `kanban:${entity.type}-deleted`, - stateManager.file, - entity - ); - return removeEntity(boardData, path); }); }, updateItem: (path: Path, item: Item) => { stateManager.setState((boardData) => { - const oldItem = getEntityFromPath(boardData, path); - - stateManager.app.workspace.trigger('kanban:card-updated', stateManager.file, oldItem, item); - return updateParentEntity(boardData, path, { children: { [path[path.length - 1]]: { @@ -224,9 +182,6 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { archiveItem: (path: Path) => { stateManager.setState((boardData) => { const item = getEntityFromPath(boardData, path); - - stateManager.app.workspace.trigger('kanban:card-archived', stateManager.file, path, item); - try { return update(removeEntity(boardData, path), { data: { @@ -247,14 +202,6 @@ export function getBoardModifiers(stateManager: StateManager): BoardModifiers { duplicateEntity: (path: Path) => { stateManager.setState((boardData) => { const entity = getEntityFromPath(boardData, path); - - stateManager.app.workspace.trigger( - `kanban:${entity.type}-duplicated`, - stateManager.file, - path, - entity - ); - const entityWithNewID = update(entity, { id: { $set: generateInstanceId(),