-
Notifications
You must be signed in to change notification settings - Fork 120
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
Showing
35 changed files
with
250 additions
and
102 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6744,17 +6744,17 @@ [email protected]: | |
range-parser "~1.2.1" | ||
statuses "2.0.1" | ||
|
||
sequential-workflow-designer-angular@^0.25.0: | ||
version "0.25.0" | ||
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.25.0.tgz#eb65370283a408c10eeb7b71b67dae2af9d6196b" | ||
integrity sha512-E100P2es8Gn5th0f0ErfjRr9TWWcgocz16kZocWvCHeOn5/iLo+oCuvSSZjewpnYTVA6oDcHH//KJnq5sPN69g== | ||
sequential-workflow-designer-angular@^0.26.0: | ||
version "0.26.0" | ||
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.26.0.tgz#f27885071efaf6e20e6884129f0666aefcb66ba6" | ||
integrity sha512-UkWmksYIXggsDGWTHcjDW6RVpEpi3gKkBKBtMsyYTtZsE8PtMm0W5PF6gTHL3t1JBDw40jHCVLeEFNfjOp6jKg== | ||
dependencies: | ||
tslib "^2.3.0" | ||
|
||
sequential-workflow-designer@^0.25.0: | ||
version "0.25.0" | ||
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.25.0.tgz#db8d35441a68f0b05f169e458f12f5457f9beca9" | ||
integrity sha512-KNOTA4zx/TkpL0LHQFvNe2S07vejA4YjRcl6UNpLjG4fODQKfiZ8zj5RypcG54O6TArBU8eDEUwtXgnuopGEYQ== | ||
sequential-workflow-designer@^0.26.0: | ||
version "0.26.0" | ||
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.26.0.tgz#6ea3148d663e8fda9939b50af575568a19d2c157" | ||
integrity sha512-PIHiMBti6TWhou5gz7DXMe6HF7AEX9ZkRvXOBLhn07hZn+rk9MPFkV83h7sZDdiTrH6VoMw7rZ7f/th/knm/0A== | ||
dependencies: | ||
sequential-workflow-model "^0.2.0" | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Vector } from '../core'; | ||
import { Behavior } from './behavior'; | ||
import { BehaviorController } from './behavior-controller'; | ||
import { SelectStepBehaviorEndToken } from './select-step-behavior-end-token'; | ||
|
||
describe('BehaviorController', () => { | ||
it('passes the last end token to a next behavior', done => { | ||
const controller = BehaviorController.create(undefined); | ||
const baseBehavior = { | ||
onStart(position: Vector) { | ||
expect(position.x).toBe(1); | ||
expect(position.y).toBe(2); | ||
}, | ||
onMove() { | ||
/* ... */ | ||
} | ||
}; | ||
|
||
function stage0() { | ||
const behavior0: Behavior = { | ||
...baseBehavior, | ||
onEnd() { | ||
setTimeout(stage1); | ||
return new SelectStepBehaviorEndToken('step-id', 12345); | ||
} | ||
}; | ||
|
||
controller.start(new Vector(1, 2), behavior0); | ||
window.dispatchEvent(new MouseEvent('mouseup')); | ||
} | ||
|
||
function stage1() { | ||
const behavior1: Behavior = { | ||
...baseBehavior, | ||
onEnd(_0, _1, previousEndToken) { | ||
if (SelectStepBehaviorEndToken.is(previousEndToken)) { | ||
expect(previousEndToken.stepId).toBe('step-id'); | ||
expect(previousEndToken.time).toBe(12345); | ||
done(); | ||
return; | ||
} | ||
fail('Invalid end token'); | ||
} | ||
}; | ||
controller.start(new Vector(1, 2), behavior1); | ||
window.dispatchEvent(new MouseEvent('mouseup')); | ||
} | ||
|
||
stage0(); | ||
}); | ||
}); |
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
8 changes: 8 additions & 0 deletions
8
designer/src/behaviors/default-click-behavior-wrapper-extension.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,8 @@ | ||
import { ClickBehaviorWrapper, ClickBehaviorWrapperExtension } from '../designer-extension'; | ||
import { DefaultClickBehaviorWrapper } from './default-click-behavior-wrapper'; | ||
|
||
export class DefaultClickBehaviorWrapperExtension implements ClickBehaviorWrapperExtension { | ||
public create(): ClickBehaviorWrapper { | ||
return new DefaultClickBehaviorWrapper(); | ||
} | ||
} |
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 @@ | ||
import { ClickBehaviorWrapper } from '../designer-extension'; | ||
import { Behavior } from './behavior'; | ||
|
||
export class DefaultClickBehaviorWrapper implements ClickBehaviorWrapper { | ||
public readonly wrap = (behavior: Behavior) => behavior; | ||
} |
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,2 @@ | ||
export * from './behavior'; | ||
export * from './select-step-behavior-end-token'; |
Oops, something went wrong.