Skip to content

Commit 91e6608

Browse files
authored
0.2.0. (#4)
1 parent 6ec029c commit 91e6608

32 files changed

+134
-58
lines changed

.github/cover.png

976 Bytes
Loading

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 0.2.0
2+
3+
**Breaking changes:**
4+
5+
* The editor displays variables with dollar prefix (`$`).
6+
* The `choices` property is renamed to `models` in the `DynamicValueModelConfiguration` interface.
7+
8+
## 0.1.0
9+
10+
First release! 🚀

demos/webpack-app/package.json

Lines changed: 3 additions & 3 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.0",
2020
"sequential-workflow-machine": "^0.2.0",
21-
"sequential-workflow-editor-model": "^0.1.0",
22-
"sequential-workflow-editor": "^0.1.0"
21+
"sequential-workflow-editor-model": "^0.2.0",
22+
"sequential-workflow-editor": "^0.2.0"
2323
},
2424
"devDependencies": {
2525
"ts-loader": "^9.4.2",
@@ -33,4 +33,4 @@
3333
"@typescript-eslint/parser": "^5.47.0",
3434
"eslint": "^8.30.0"
3535
}
36-
}
36+
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const definition: MyDefinition = {
1111
sequence: [
1212
{
1313
id: 'a282bc1908816678905a3c94049478aa',
14-
name: 'index < loops',
14+
name: '$index < $loops',
1515
type: 'loop',
1616
componentType: 'container',
1717
properties: {
@@ -20,28 +20,28 @@ const definition: MyDefinition = {
2020
to: { modelId: 'nullableVariable', value: { name: 'loops' } },
2121
increment: { modelId: 'number', value: 1 },
2222
indexVariable: { name: 'index', type: 'number' },
23-
variables: { variables: [{ name: 'diff', type: 'number' }] }
23+
variables: { variables: [{ name: 'remainder', type: 'number' }] }
2424
},
2525
sequence: [
2626
{
2727
id: '32529a3fbef39d5e480df8454164edae',
28-
name: 'diff = index % 2',
28+
name: '$remainder = $index % 2',
2929
type: 'calculate',
3030
componentType: 'task',
3131
properties: {
3232
a: { modelId: 'nullableVariable', value: { name: 'index' } },
3333
operator: '%',
3434
b: { modelId: 'number', value: 2 },
35-
result: { name: 'diff' }
35+
result: { name: 'remainder' }
3636
}
3737
},
3838
{
3939
id: 'f2f35f162f009e7683cf31c24a1e9589',
40-
name: 'If diff == 0',
40+
name: 'If $remainder == 0',
4141
type: 'if',
4242
componentType: 'switch',
4343
properties: {
44-
a: { modelId: 'nullableVariable', value: { name: 'diff' } },
44+
a: { modelId: 'nullableVariable', value: { name: 'remainder' } },
4545
operator: '=',
4646
b: { modelId: 'number', value: 0 }
4747
},

demos/webpack-app/src/playground/machine/activities/log-activity.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createAtomActivity } from 'sequential-workflow-machine';
22
import { GlobalState } from '../global-state';
33
import { LogStep } from '../../model/log-step-model';
4+
import { formatVariableName } from 'sequential-workflow-editor';
45

56
export const logActivity = createAtomActivity<LogStep, GlobalState>({
67
init: () => ({}),
@@ -11,7 +12,8 @@ export const logActivity = createAtomActivity<LogStep, GlobalState>({
1112
for (const variable of step.properties.variables.variables) {
1213
const value = $variables.isSet(variable.name) ? $variables.read(variable.name) || '<empty>' : '<not set>';
1314
const type = typeof value;
14-
message += `\n${variable.name}=${value} (${type})`;
15+
const name = formatVariableName(variable.name);
16+
message += `\n${name}=${value} (${type})`;
1517
}
1618

1719
$logger.log(message);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface CalculateStep extends Step {
2323

2424
export const calculateStepModel = createStepModel<CalculateStep>('calculate', 'task', step => {
2525
const val = dynamicValueModel({
26-
choices: [
26+
models: [
2727
numberValueModel({}),
2828
nullableVariableValueModel({
2929
isRequired: true,
@@ -32,6 +32,13 @@ export const calculateStepModel = createStepModel<CalculateStep>('calculate', 't
3232
]
3333
});
3434

35+
step.property('result').value(
36+
nullableVariableValueModel({
37+
variableType: ValueKnownType.number,
38+
isRequired: true
39+
})
40+
);
41+
3542
step.property('a').value(val).label('A');
3643

3744
step.property('operator').value(
@@ -41,11 +48,4 @@ export const calculateStepModel = createStepModel<CalculateStep>('calculate', 't
4148
);
4249

4350
step.property('b').value(val).label('B');
44-
45-
step.property('result').value(
46-
nullableVariableValueModel({
47-
variableType: ValueKnownType.number,
48-
isRequired: true
49-
})
50-
);
5151
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface IfStep extends BranchedStep {
2323

2424
export const ifStepModel = createBranchedStepModel<IfStep>('if', 'switch', step => {
2525
const val = dynamicValueModel({
26-
choices: [
26+
models: [
2727
numberValueModel({}),
2828
nullableVariableValueModel({
2929
isRequired: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const logStepModel = createStepModel<LogStep>('log', 'task', step => {
2424
step.property('message')
2525
.value(
2626
dynamicValueModel({
27-
choices: [
27+
models: [
2828
stringValueModel({
2929
minLength: 1
3030
}),

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const loopStepModel = createSequentialStepModel('loop', 'container', step
3232
.label('From')
3333
.value(
3434
dynamicValueModel({
35-
choices: [
35+
models: [
3636
numberValueModel({}),
3737
nullableVariableValueModel({
3838
isRequired: true,
@@ -54,7 +54,7 @@ export const loopStepModel = createSequentialStepModel('loop', 'container', step
5454
.label('To')
5555
.value(
5656
dynamicValueModel({
57-
choices: [
57+
models: [
5858
numberValueModel({}),
5959
nullableVariableValueModel({
6060
isRequired: true,
@@ -68,7 +68,7 @@ export const loopStepModel = createSequentialStepModel('loop', 'container', step
6868
.label('Increment')
6969
.value(
7070
dynamicValueModel({
71-
choices: [
71+
models: [
7272
numberValueModel({
7373
defaultValue: 1
7474
}),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const setStringValueModel = createStepModel<SetStringValueStep>('setStrin
3030
step.property('value')
3131
.value(
3232
dynamicValueModel({
33-
choices: [
33+
models: [
3434
stringValueModel({
3535
minLength: 1
3636
}),

0 commit comments

Comments
 (0)