-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Changed imports from @foblex/core to @foblex/mediator, @foblex/…
…platform, @foblex/2d
- Loading branch information
1 parent
64018c4
commit 30a60da
Showing
237 changed files
with
431 additions
and
938 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
3 changes: 2 additions & 1 deletion
3
...ts/f-examples/layout-and-behaviors/dagre-layout-example/dagre-layout-example.component.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
3 changes: 2 additions & 1 deletion
3
...ts/f-examples/layout-and-behaviors/elkjs-layout-example/elkjs-layout-example.component.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
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
projects/f-flow/src/domain/clear-selection/clear-selection.execution.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
2 changes: 1 addition & 1 deletion
2
projects/f-flow/src/domain/create-connection-markers/create-connection-markers.execution.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
6 changes: 6 additions & 0 deletions
6
...w/src/domain/create-rounded-rect-from-element/create-rounded-rect-from-element-request.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class CreateRoundedRectFromElementRequest { | ||
constructor( | ||
public element: HTMLElement | SVGElement, | ||
) { | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...src/domain/create-rounded-rect-from-element/create-rounded-rect-from-element.execution.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { CreateRoundedRectFromElementRequest } from './create-rounded-rect-from-element-request'; | ||
import { FExecutionRegister, IExecution } from '@foblex/mediator'; | ||
import { BrowserService } from '@foblex/platform'; | ||
import { RoundedRect, RectExtensions } from '@foblex/2d'; | ||
|
||
@Injectable() | ||
@FExecutionRegister(CreateRoundedRectFromElementRequest) | ||
export class CreateRoundedRectFromElementExecution implements IExecution<CreateRoundedRectFromElementRequest, RoundedRect> { | ||
|
||
constructor( | ||
private fBrowser: BrowserService | ||
) { | ||
} | ||
|
||
public handle(request: CreateRoundedRectFromElementRequest): RoundedRect { | ||
return this.setRadiusFromElement(RoundedRect.fromRect(RectExtensions.fromElement(request.element)), request.element); | ||
} | ||
|
||
private setRadiusFromElement(rect: RoundedRect, element: HTMLElement | SVGElement): RoundedRect { | ||
const styles = this.getComputedStyle(element); | ||
rect.radius1 = this.toPixels(styles.borderTopLeftRadius, element, styles.fontSize); | ||
rect.radius2 = this.toPixels(styles.borderTopRightRadius, element, styles.fontSize); | ||
rect.radius3 = this.toPixels(styles.borderBottomRightRadius, element, styles.fontSize); | ||
rect.radius4 = this.toPixels(styles.borderBottomLeftRadius, element, styles.fontSize); | ||
return rect; | ||
} | ||
|
||
private getComputedStyle(element: HTMLElement | SVGElement): CSSStyleDeclaration { | ||
return this.fBrowser.window.getComputedStyle(element); | ||
} | ||
|
||
private toPixels(value: string, element: HTMLElement | SVGElement, fontSize: string): number { | ||
return this.fBrowser.toPixels(value, element.clientWidth, element.clientHeight, fontSize) || 0 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
projects/f-flow/src/domain/create-rounded-rect-from-element/index.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './create-rounded-rect-from-element.execution'; | ||
|
||
export * from './create-rounded-rect-from-element-request'; |
2 changes: 1 addition & 1 deletion
2
projects/f-flow/src/domain/emit-transform-changes/emit-transform-changes.execution.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
2 changes: 1 addition & 1 deletion
2
projects/f-flow/src/domain/get-can-be-selected-items/i-selectable-with-rect.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
9 changes: 4 additions & 5 deletions
9
projects/f-flow/src/domain/get-connection-line/get-connection-line.execution.spec.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
6 changes: 3 additions & 3 deletions
6
projects/f-flow/src/domain/get-connection-line/get-connection-line.request.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
38 changes: 0 additions & 38 deletions
38
...cts/f-flow/src/domain/get-element-rect-in-flow/get-element-rect-in-flow.execution.spec.ts
This file was deleted.
Oops, something went wrong.
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
projects/f-flow/src/domain/get-input-rect-in-flow/get-input-rect-in-flow-response.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
6 changes: 3 additions & 3 deletions
6
projects/f-flow/src/domain/get-input-rect-in-flow/get-input-rect-in-flow.execution.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
4 changes: 2 additions & 2 deletions
4
projects/f-flow/src/domain/get-nodes-rect/get-nodes-rect.execution.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
2 changes: 1 addition & 1 deletion
2
projects/f-flow/src/domain/get-output-rect-in-flow/get-output-rect-in-flow-response.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
6 changes: 3 additions & 3 deletions
6
projects/f-flow/src/domain/get-output-rect-in-flow/get-output-rect-in-flow.execution.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
2 changes: 1 addition & 1 deletion
2
projects/f-flow/src/domain/get-position-in-flow/get-position-in-flow-request.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
Oops, something went wrong.