Skip to content

Commit 0d9c597

Browse files
authored
0.3.2. (#8)
1 parent dfef511 commit 0d9c597

32 files changed

+416
-68
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.3.2
2+
3+
* The `StepModel` interface has two new properties: `category` and `description`. The category is used to group steps in the toolbox. The description is used to display an additional information about a step in the editor.
4+
* The `PropertyModel` interface has one new property: `hint`. The hint is used to display an additional information about a property in the editor.
5+
16
## 0.3.1
27

38
Added new value model: boolean (`booleanValueModel({ ... })`).

demos/webpack-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"sequential-workflow-model": "^0.1.3",
1919
"sequential-workflow-designer": "^0.13.2",
2020
"sequential-workflow-machine": "^0.2.0",
21-
"sequential-workflow-editor-model": "^0.3.1",
22-
"sequential-workflow-editor": "^0.3.1"
21+
"sequential-workflow-editor-model": "^0.3.2",
22+
"sequential-workflow-editor": "^0.3.2"
2323
},
2424
"devDependencies": {
2525
"ts-loader": "^9.4.2",

demos/webpack-app/src/playground/app.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { editorProvider } from './editor-provider';
33
import { AppState, AppStorage } from './storage';
44
import { Playground } from './playground';
55
import { executeMachine } from './machine/machine-executor';
6-
import { MyDefinition, definitionModel } from './model/definition-model';
6+
import { MyDefinition } from './model/definition-model';
77
import { defaultAppState } from './default-state';
88

99
import 'sequential-workflow-designer/css/designer.css';
@@ -33,12 +33,7 @@ export class App {
3333
}
3434
},
3535
toolbox: {
36-
groups: [
37-
{
38-
name: 'Steps',
39-
steps: Object.keys(definitionModel.steps).map(stepType => editorProvider.activateStep(stepType))
40-
}
41-
]
36+
groups: editorProvider.getToolboxGroups()
4237
},
4338
undoStackSize: 10,
4439
definitionWalker

demos/webpack-app/src/playground/model/calculate-step-model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export interface CalculateStep extends Step {
2222
}
2323

2424
export const calculateStepModel = createStepModel<CalculateStep>('calculate', 'task', step => {
25+
step.category('Values');
26+
step.description('Calculate value from two numbers. Result is stored in variable.');
27+
2528
const val = dynamicValueModel({
2629
models: [
2730
numberValueModel({}),

demos/webpack-app/src/playground/model/convert-value-step-model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ export interface ConvertValueStep extends Step {
1111
}
1212

1313
export const convertValueStepModel = createStepModel<ConvertValueStep>('convertValue', 'task', step => {
14+
step.category('Values');
15+
step.description('Convert value from one variable to another.');
16+
1417
step.property('source')
1518
.value(
1619
nullableAnyVariableValueModel({

demos/webpack-app/src/playground/model/if-step-model.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export interface IfStep extends BranchedStep {
2323
}
2424

2525
export const ifStepModel = createBranchedStepModel<IfStep>('if', 'switch', step => {
26+
step.category('Logic');
27+
step.description('Check condition and execute different branches.');
28+
2629
const ab = dynamicValueModel({
2730
models: [
2831
numberValueModel({}),
@@ -34,17 +37,18 @@ export const ifStepModel = createBranchedStepModel<IfStep>('if', 'switch', step
3437
]
3538
});
3639

37-
step.property('a').value(ab).label('A');
40+
step.property('a').value(ab).label('A').hint('Left side of comparison.');
3841

3942
step.property('operator')
4043
.label('Operator')
4144
.value(
4245
choiceValueModel({
4346
choices: ['==', '===', '!=', '!==', '>', '>=', '<', '<=']
4447
})
45-
);
48+
)
49+
.hint('Comparison operator.\nStep supports strict and non-strict operators.');
4650

47-
step.property('b').value(ab).label('B');
51+
step.property('b').value(ab).label('B').hint('Right side of comparison.');
4852

4953
step.branches().value(
5054
branchesValueModel({

demos/webpack-app/src/playground/model/loop-step-model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export interface LoopStep extends SequentialStep {
2828
}
2929

3030
export const loopStepModel = createSequentialStepModel('loop', 'container', step => {
31+
step.category('Logic');
32+
step.description('Loop over a range of numbers.');
33+
3134
step.property('from')
3235
.label('From')
3336
.value(

demos/webpack-app/src/playground/model/root-model.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { MyDefinition } from './definition-model';
33

44
export const rootModel = createRootModel<MyDefinition>(root => {
55
root.property('inputs')
6+
.hint('Variables passed to the workflow from the outside.')
67
.value(variableDefinitionsValueModel({}))
78
.dependentProperty('outputs')
89
.customValidator({
@@ -11,7 +12,9 @@ export const rootModel = createRootModel<MyDefinition>(root => {
1112
return inputs.variables.length > 0 ? null : 'At least one input is required';
1213
}
1314
});
14-
root.property('outputs').value(variableDefinitionsValueModel({})).label('Outputs');
15+
16+
root.property('outputs').hint('Variables returned from the workflow.').value(variableDefinitionsValueModel({})).label('Outputs');
17+
1518
root.sequence().value(
1619
sequenceValueModel({
1720
sequence: []

demos/webpack-app/src/playground/model/set-string-value-step-model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export interface SetStringValueStep extends Step {
1919
}
2020

2121
export const setStringValueStepModel = createStepModel<SetStringValueStep>('setStringValue', 'task', step => {
22+
step.category('Values');
23+
2224
step.property('variable')
2325
.value(
2426
nullableVariableValueModel({

editor/css/editor.css

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,23 @@
88
.swe-editor {
99
margin: 10px 0 0;
1010
font-size: 13px;
11-
line-height: 1.3em;
11+
line-height: 1.3rem;
12+
}
13+
.swe-editor-header {
14+
padding: 0 10px 5px;
15+
}
16+
.swe-editor-header-title {
17+
margin: 0;
18+
padding: 5px 0 10px;
19+
font-size: 1.4rem;
20+
line-height: 1.3rem;
21+
white-space: nowrap;
22+
text-overflow: ellipsis;
23+
overflow: hidden;
24+
}
25+
.swe-editor-header-description {
26+
margin: 0 0 10px;
27+
color: #666;
1228
}
1329

1430
/* properties */
@@ -24,14 +40,44 @@
2440
}
2541
.swe-property-header-label {
2642
display: block;
27-
flex: 1;
2843
padding: 0;
2944
margin: 0;
3045
font-size: 1.05rem;
46+
line-height: 1.3rem;
47+
}
48+
.swe-property-header-hint-toggle {
49+
display: block;
50+
width: 18px;
51+
height: 18px;
52+
margin: 0 8px;
53+
background: #ddd;
54+
border-radius: 50% 50%;
55+
text-align: center;
56+
font-size: 11px;
57+
cursor: pointer;
58+
}
59+
.swe-property-header-hint-toggle:hover {
60+
background: #eee;
61+
}
62+
.swe-property-header-hint-toggle-icon {
63+
width: 70%;
64+
height: 70%;
65+
margin: 15%;
66+
}
67+
.swe-property-header-hint-toggle-icon path {
68+
fill: #777;
3169
}
3270
.swe-property-header-control {
71+
flex: 1;
3372
text-align: right;
3473
}
74+
.swe-property-hint-text {
75+
margin: 0 0 10px;
76+
padding: 6px 10px;
77+
border-radius: 5px;
78+
background: #eee;
79+
border: 1px solid #ddd;
80+
}
3581
.swe-validation-error-text {
3682
margin: 0 0 10px;
3783
padding: 6px 10px;

0 commit comments

Comments
 (0)