-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de9cf1c
commit 7281828
Showing
9 changed files
with
76 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...e/src/utils/sorter/ComponentCanvasNode.ts → ...e/src/utils/sorter/CanvasComponentNode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { BaseComponentNode } from './BaseComponentNode'; | ||
|
||
export class ComponentCanvasNode extends BaseComponentNode { | ||
export default class CanvasComponentNode extends BaseComponentNode { | ||
/** | ||
* Get the associated view of this component. | ||
* @returns The view associated with the component, or undefined if none. | ||
*/ | ||
// TODO add the correct type | ||
get view(): any { | ||
return this.model.getView(); | ||
return this.model.getView?.(); | ||
} | ||
|
||
/** | ||
* Get the associated element of this component. | ||
* @returns The Element associated with the component, or undefined if none. | ||
*/ | ||
get element(): HTMLElement | undefined { | ||
return this.model.getEl(); | ||
return this.model.getEl?.(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import CanvasComponentNode from "./CanvasComponentNode"; | ||
|
||
export default class CanvasNewComponentNode extends CanvasComponentNode { | ||
/** | ||
* For new components, we will not add it to the target collection. | ||
*/ | ||
addChildAt(node: CanvasNewComponentNode, index: number): CanvasNewComponentNode { | ||
return new (this.constructor as any)(node.model); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/src/utils/sorter/ComponentLayersNode.ts → ...e/src/utils/sorter/LayersComponentNode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters