@shelf/global-renderer 0.24.68 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +1 -1
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +5 -0
- package/lib/DecisionTreeContent/components/Condition.d.ts +8 -0
- package/lib/DecisionTreeContent/components/Question.d.ts +3 -1
- package/lib/DecisionTreeContent/helpers.d.ts +3 -2
- package/lib/DecisionTreeContent/mocks.d.ts +88 -1
- package/lib/DecisionTreeContent/types.d.ts +16 -0
- package/lib/renderDTContent.js +1 -1
- package/lib/renderStaticDTDiagram.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.25.0](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.24.69...@shelf/global-renderer@0.25.0) (2023-04-10)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- PREVIEWAPI-341 Add assignment ([5b719f9](https://github.com/shelfio/libs-frontend/commit/5b719f9415cc587b1cdc787ba6e87a2edf4640e7))
|
|
11
|
+
- PREVIEWAPI-341 Add CL ([7d9786a](https://github.com/shelfio/libs-frontend/commit/7d9786ad899ce242a18531c2c668d0371e7469d2))
|
|
12
|
+
- PREVIEWAPI-341 Add conditions ([9bc070e](https://github.com/shelfio/libs-frontend/commit/9bc070e9cba6fc46a29716a33ded41482d03640d))
|
|
13
|
+
- PREVIEWAPI-341 Fix tests ([bbf5591](https://github.com/shelfio/libs-frontend/commit/bbf5591611d39526a17ae656aac25bc5a95682fa))
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- PREVIEWAPI-341 tests ([195ea16](https://github.com/shelfio/libs-frontend/commit/195ea160bc8e5de9bf29b89ef8551f882a85703d))
|
|
18
|
+
|
|
19
|
+
### [0.24.69](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.24.68...@shelf/global-renderer@0.24.69) (2023-04-07)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @shelf/global-renderer
|
|
22
|
+
|
|
6
23
|
### [0.24.68](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.24.67...@shelf/global-renderer@0.24.68) (2023-04-07)
|
|
7
24
|
|
|
8
25
|
**Note:** Version bump only for package @shelf/global-renderer
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RenderDTContentData } from './types';
|
|
3
|
-
declare const DecisionTreeContent: ({ title, description, tree, exportedBy, exportedAt, createdBy, fields, }: RenderDTContentData) => JSX.Element;
|
|
3
|
+
declare const DecisionTreeContent: ({ title, description, tree, exportedBy, exportedAt, createdBy, fields, variables, }: RenderDTContentData) => JSX.Element;
|
|
4
4
|
export default DecisionTreeContent;
|
|
@@ -20,8 +20,13 @@ export declare const Question: import("styled-components").StyledComponent<"div"
|
|
|
20
20
|
export declare const QuestionTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
21
|
export declare const QuestionDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
22
|
export declare const Answer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
+
export declare const AnswerWithAssignments: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
24
|
export declare const AnswerNumber: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
|
+
export declare const AssignmentIconBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
|
+
export declare const AssignmentIcon: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
24
27
|
export declare const AnswerTitle: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
28
|
+
export declare const Condition: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
29
|
+
export declare const Rule: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
30
|
export declare const StepLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
26
31
|
export declare const StepParents: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
32
|
export declare const ParentLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
|
+
import { DTStep } from '../types';
|
|
4
|
+
declare const _default: ({ step, variables, }: {
|
|
5
|
+
step: DTStep;
|
|
6
|
+
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { DecisionTree } from '@shelf/types-ddb';
|
|
2
3
|
import { DTStep } from '../types';
|
|
3
|
-
declare const _default: ({ step }: {
|
|
4
|
+
declare const _default: ({ step, variables, }: {
|
|
4
5
|
step: DTStep;
|
|
6
|
+
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
5
7
|
}) => JSX.Element;
|
|
6
8
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DTStep, DTStepFromApi } from './types';
|
|
2
2
|
export declare const FIRST_STEP_ID = "Step#1";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const TYPES_TO_LINK: string[];
|
|
4
4
|
export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[]) => {
|
|
5
5
|
parentSteps: {
|
|
6
6
|
id: string;
|
|
@@ -19,6 +19,7 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
number?: number | undefined;
|
|
21
21
|
} | undefined;
|
|
22
|
+
assignments?: import("@shelf/types-ddb/lib/decision-tree").Assignment[] | undefined;
|
|
22
23
|
}[];
|
|
23
24
|
};
|
|
24
25
|
title?: string | undefined;
|
|
@@ -29,7 +30,7 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
29
30
|
defaultNextStep?: {
|
|
30
31
|
id: string;
|
|
31
32
|
} | undefined;
|
|
32
|
-
conditions?: import("@shelf/types-ddb/lib/decision-tree").Condition[] | undefined;
|
|
33
|
+
conditions?: (import("@shelf/types-ddb/lib/decision-tree").Condition[] & import("./types").ConditionType[]) | undefined;
|
|
33
34
|
content?: string | undefined;
|
|
34
35
|
linkedSteps?: {
|
|
35
36
|
id?: string | undefined;
|
|
@@ -10,6 +10,47 @@ export declare const dtData: {
|
|
|
10
10
|
value: string;
|
|
11
11
|
}[];
|
|
12
12
|
tree: ({
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
type: string;
|
|
16
|
+
settings: {
|
|
17
|
+
position: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
borderColor?: undefined;
|
|
22
|
+
};
|
|
23
|
+
conditions: ({
|
|
24
|
+
id: string;
|
|
25
|
+
nextStep: {
|
|
26
|
+
id: string;
|
|
27
|
+
};
|
|
28
|
+
expression: {
|
|
29
|
+
joiner: string;
|
|
30
|
+
rules: {
|
|
31
|
+
id: string;
|
|
32
|
+
variableId: string;
|
|
33
|
+
value: string;
|
|
34
|
+
operator: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
id: string;
|
|
39
|
+
expression: {
|
|
40
|
+
rules: {
|
|
41
|
+
id: string;
|
|
42
|
+
variableId: string;
|
|
43
|
+
value: string;
|
|
44
|
+
operator: string;
|
|
45
|
+
}[];
|
|
46
|
+
joiner?: undefined;
|
|
47
|
+
};
|
|
48
|
+
nextStep?: undefined;
|
|
49
|
+
})[];
|
|
50
|
+
content?: undefined;
|
|
51
|
+
url?: undefined;
|
|
52
|
+
question?: undefined;
|
|
53
|
+
} | {
|
|
13
54
|
id: string;
|
|
14
55
|
title: string;
|
|
15
56
|
type: string;
|
|
@@ -32,12 +73,20 @@ export declare const dtData: {
|
|
|
32
73
|
nextStep: {
|
|
33
74
|
id: string;
|
|
34
75
|
};
|
|
76
|
+
assignments?: undefined;
|
|
35
77
|
} | {
|
|
36
78
|
title: string;
|
|
37
79
|
id: string;
|
|
38
|
-
nextStep:
|
|
80
|
+
nextStep: {
|
|
81
|
+
id: string;
|
|
82
|
+
};
|
|
83
|
+
assignments: {
|
|
84
|
+
variableId: string;
|
|
85
|
+
value: string;
|
|
86
|
+
}[];
|
|
39
87
|
})[];
|
|
40
88
|
};
|
|
89
|
+
conditions?: undefined;
|
|
41
90
|
} | {
|
|
42
91
|
id: string;
|
|
43
92
|
title: string;
|
|
@@ -51,6 +100,7 @@ export declare const dtData: {
|
|
|
51
100
|
};
|
|
52
101
|
};
|
|
53
102
|
question: null;
|
|
103
|
+
conditions?: undefined;
|
|
54
104
|
content?: undefined;
|
|
55
105
|
} | {
|
|
56
106
|
id: string;
|
|
@@ -72,15 +122,51 @@ export declare const dtData: {
|
|
|
72
122
|
title: string;
|
|
73
123
|
id: string;
|
|
74
124
|
nextStep: null;
|
|
125
|
+
assignments?: undefined;
|
|
75
126
|
} | {
|
|
76
127
|
title: string;
|
|
77
128
|
id: string;
|
|
78
129
|
nextStep: {
|
|
79
130
|
id: string;
|
|
80
131
|
};
|
|
132
|
+
assignments: {
|
|
133
|
+
variableId: string;
|
|
134
|
+
value: string;
|
|
135
|
+
}[];
|
|
81
136
|
})[];
|
|
82
137
|
id?: undefined;
|
|
83
138
|
};
|
|
139
|
+
conditions?: undefined;
|
|
140
|
+
} | {
|
|
141
|
+
id: string;
|
|
142
|
+
title: string;
|
|
143
|
+
content: string;
|
|
144
|
+
type: string;
|
|
145
|
+
url: null;
|
|
146
|
+
settings: {
|
|
147
|
+
borderColor: string;
|
|
148
|
+
position: {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
question: {
|
|
154
|
+
id: string;
|
|
155
|
+
title: string;
|
|
156
|
+
description: string;
|
|
157
|
+
answers: ({
|
|
158
|
+
title: string;
|
|
159
|
+
id: string;
|
|
160
|
+
nextStep: {
|
|
161
|
+
id: string;
|
|
162
|
+
};
|
|
163
|
+
} | {
|
|
164
|
+
title: string;
|
|
165
|
+
id: string;
|
|
166
|
+
nextStep: null;
|
|
167
|
+
})[];
|
|
168
|
+
};
|
|
169
|
+
conditions?: undefined;
|
|
84
170
|
} | {
|
|
85
171
|
id: string;
|
|
86
172
|
title: string;
|
|
@@ -95,6 +181,7 @@ export declare const dtData: {
|
|
|
95
181
|
};
|
|
96
182
|
};
|
|
97
183
|
question: null;
|
|
184
|
+
conditions?: undefined;
|
|
98
185
|
})[];
|
|
99
186
|
};
|
|
100
187
|
export declare const initialTree: ({
|
|
@@ -15,11 +15,25 @@ export declare type RenderDTContentData = {
|
|
|
15
15
|
name: string;
|
|
16
16
|
value: string;
|
|
17
17
|
}[];
|
|
18
|
+
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
18
19
|
};
|
|
19
20
|
declare type StepPointer = {
|
|
20
21
|
id?: string;
|
|
21
22
|
number?: number;
|
|
22
23
|
};
|
|
24
|
+
export declare type ConditionType = {
|
|
25
|
+
id: string;
|
|
26
|
+
expression: {
|
|
27
|
+
joiner?: DecisionTree.Joiners;
|
|
28
|
+
rules: {
|
|
29
|
+
id: string;
|
|
30
|
+
variableId: string;
|
|
31
|
+
operator: DecisionTree.Operators;
|
|
32
|
+
value: string;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
nextStep?: StepPointer;
|
|
36
|
+
};
|
|
23
37
|
export declare type DTStep = Omit<DecisionTree.Step, 'question'> & {
|
|
24
38
|
number: number;
|
|
25
39
|
content?: string;
|
|
@@ -31,8 +45,10 @@ export declare type DTStep = Omit<DecisionTree.Step, 'question'> & {
|
|
|
31
45
|
id: string;
|
|
32
46
|
title?: string;
|
|
33
47
|
nextStep?: StepPointer;
|
|
48
|
+
assignments?: DecisionTree.Assignment[];
|
|
34
49
|
}[];
|
|
35
50
|
};
|
|
51
|
+
conditions?: ConditionType[];
|
|
36
52
|
linkedSteps?: StepPointer[];
|
|
37
53
|
parentSteps: StepPointer[];
|
|
38
54
|
};
|