@shelf/global-renderer 0.2.24 → 0.3.1
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 +26 -0
- package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +4 -0
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +27 -0
- package/lib/DecisionTreeContent/components/Link.d.ts +6 -0
- package/lib/DecisionTreeContent/components/Question.d.ts +6 -0
- package/lib/DecisionTreeContent/components/Solution.d.ts +6 -0
- package/lib/DecisionTreeContent/components/StepHeader.d.ts +6 -0
- package/lib/DecisionTreeContent/helpers.d.ts +44 -0
- package/lib/DecisionTreeContent/mocks.d.ts +201 -0
- package/lib/DecisionTreeContent/renderDTContent.d.ts +2 -0
- package/lib/DecisionTreeContent/types.d.ts +27 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -1
- package/lib/renderDTContent.js +2 -0
- package/lib/renderDTContent.js.LICENSE.txt +57 -0
- package/lib/renderStaticDTDiagram.js +1 -1
- package/package.json +13 -5
- /package/lib/{renderStaticDTDiagram.d.ts → DecisionTreeDiagram/renderStaticDTDiagram.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
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.3.1](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.3.0...@shelf/global-renderer@0.3.1) (2022-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @shelf/global-renderer
|
|
9
|
+
|
|
10
|
+
## [0.3.0](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.2.24...@shelf/global-renderer@0.3.0) (2022-09-29)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- REACT-335 Add answers links ([5b47b41](https://github.com/shelfio/libs-frontend/commit/5b47b41c30460cea10f41ad5a29705df8acf5b3f))
|
|
15
|
+
- REACT-335 add DT render tests ([d69a196](https://github.com/shelfio/libs-frontend/commit/d69a196354d038028d693063890e4d012d0ed887))
|
|
16
|
+
- REACT-335 Add Link step ([3c2b3c7](https://github.com/shelfio/libs-frontend/commit/3c2b3c70bf7ec9bc9cc9696357d795e5c5e2609b))
|
|
17
|
+
- REACT-335 Add solution ([d9af4ff](https://github.com/shelfio/libs-frontend/commit/d9af4ffb1a44450f70da927f497d057eebc9fe5d))
|
|
18
|
+
- REACT-335 add stories ([4f9d9ea](https://github.com/shelfio/libs-frontend/commit/4f9d9ea906e45f9e3288fb6d116285c79f8e8bb0))
|
|
19
|
+
- REACT-335 Add tests ([8f8dbf6](https://github.com/shelfio/libs-frontend/commit/8f8dbf6b21bc90b62de2e4321529de5efb143773))
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
- REACT-335 Add new color that will be reused on gem page ([ffdeaf3](https://github.com/shelfio/libs-frontend/commit/ffdeaf37b03e9aa31cef5a1780c0d6621587d3dc))
|
|
24
|
+
- REACT-335 Add parent steps ([f454111](https://github.com/shelfio/libs-frontend/commit/f454111622ce7e626c269869b356d09011cd6c5d))
|
|
25
|
+
- REACT-335 Add pdf content to global renderer ([f54ddc5](https://github.com/shelfio/libs-frontend/commit/f54ddc56ab3a10d6d112a06f97952aff1496c9d4))
|
|
26
|
+
- REACT-335 changed to querySelector ([1d080c0](https://github.com/shelfio/libs-frontend/commit/1d080c0e7351c0a0750567c7d23ecbc181370389))
|
|
27
|
+
- REACT-335 fix colors ([abdfd20](https://github.com/shelfio/libs-frontend/commit/abdfd20a9f88acb0a6abf5de876cce4a9f89ed2c))
|
|
28
|
+
- REACT-335 real coverage ([2ffaa5c](https://github.com/shelfio/libs-frontend/commit/2ffaa5cd2fc24ef8e742f88fe002015d44336678))
|
|
29
|
+
- REACT-335 real coverage ([c0bad55](https://github.com/shelfio/libs-frontend/commit/c0bad55e0698f68968e2800dc30a104287940e87))
|
|
30
|
+
- REACT-335 remove querySelector, move tests mocks, add stories ([a7b5101](https://github.com/shelfio/libs-frontend/commit/a7b51018110b585dfe7cb548e3c3141cf1a5a58d))
|
|
31
|
+
|
|
6
32
|
### [0.2.24](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.2.23...@shelf/global-renderer@0.2.24) (2022-09-29)
|
|
7
33
|
|
|
8
34
|
**Note:** Version bump only for package @shelf/global-renderer
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const DTContentContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const DTMeta: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const DTIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const DTInternalMeta: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const DTTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const DTDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const DTContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const StepContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const StepNumber: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const StepTypeContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const StepType: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
+
color?: string | undefined;
|
|
13
|
+
}, never>;
|
|
14
|
+
export declare const StepTypeTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
+
export declare const ContentTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
+
export declare const Content: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const Question: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const QuestionTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const QuestionDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const Answer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
|
+
export declare const AnswerNumber: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
22
|
+
export declare const AnswerTitle: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
23
|
+
export declare const StepLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
24
|
+
export declare const StepParents: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
|
+
export declare const ParentLink: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
26
|
+
export declare const LinkUrl: import("styled-components").StyledComponent<"a", any, {}, never>;
|
|
27
|
+
export declare const NoLinks: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DTStep } from './types';
|
|
2
|
+
export declare const FIRST_STEP_ID = "Step#1";
|
|
3
|
+
export declare const QUESTION_TYPE = "Question";
|
|
4
|
+
export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[]) => {
|
|
5
|
+
parentSteps: {
|
|
6
|
+
id: string;
|
|
7
|
+
number: number;
|
|
8
|
+
}[];
|
|
9
|
+
number: number;
|
|
10
|
+
url?: string | undefined;
|
|
11
|
+
type?: import("@shelf/types-ddb/lib/decision-tree").StepType | undefined;
|
|
12
|
+
id: string;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
content?: string | undefined;
|
|
15
|
+
question: {
|
|
16
|
+
id: string;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
answers: {
|
|
20
|
+
id: string;
|
|
21
|
+
title?: string | undefined;
|
|
22
|
+
nextStep?: {
|
|
23
|
+
id?: string | undefined;
|
|
24
|
+
number?: number | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
textS3Key?: string | undefined;
|
|
29
|
+
settings?: import("@shelf/types-ddb/lib/decision-tree").StepSettings | undefined;
|
|
30
|
+
linkedSteps?: {
|
|
31
|
+
id?: string | undefined;
|
|
32
|
+
number?: number | undefined;
|
|
33
|
+
}[] | undefined;
|
|
34
|
+
}[];
|
|
35
|
+
export declare const convertStepToRenderFormat: (tree: DTStep[]) => DTStep[];
|
|
36
|
+
export declare const strings: {
|
|
37
|
+
question: string;
|
|
38
|
+
solution: string;
|
|
39
|
+
link: string;
|
|
40
|
+
step: string;
|
|
41
|
+
start: string;
|
|
42
|
+
parentSteps: string;
|
|
43
|
+
noLinks: string;
|
|
44
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
export declare const dtData: {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
tree: ({
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
type: string;
|
|
8
|
+
content: string;
|
|
9
|
+
url: null;
|
|
10
|
+
settings: {
|
|
11
|
+
borderColor: string;
|
|
12
|
+
position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
question: {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
answers: ({
|
|
22
|
+
title: string;
|
|
23
|
+
id: string;
|
|
24
|
+
nextStep: {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
28
|
+
title: string;
|
|
29
|
+
id: string;
|
|
30
|
+
nextStep: null;
|
|
31
|
+
})[];
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
id: string;
|
|
35
|
+
title: string;
|
|
36
|
+
type: string;
|
|
37
|
+
url: string;
|
|
38
|
+
settings: {
|
|
39
|
+
borderColor: null;
|
|
40
|
+
position: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
question: null;
|
|
46
|
+
content?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
id: string;
|
|
49
|
+
title: string;
|
|
50
|
+
type: string;
|
|
51
|
+
url: null;
|
|
52
|
+
content: string;
|
|
53
|
+
settings: {
|
|
54
|
+
borderColor: string;
|
|
55
|
+
position: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
question: {
|
|
61
|
+
title: string;
|
|
62
|
+
description: string;
|
|
63
|
+
answers: ({
|
|
64
|
+
title: string;
|
|
65
|
+
id: string;
|
|
66
|
+
nextStep: null;
|
|
67
|
+
} | {
|
|
68
|
+
title: string;
|
|
69
|
+
id: string;
|
|
70
|
+
nextStep: {
|
|
71
|
+
id: string;
|
|
72
|
+
};
|
|
73
|
+
})[];
|
|
74
|
+
id?: undefined;
|
|
75
|
+
};
|
|
76
|
+
} | {
|
|
77
|
+
id: string;
|
|
78
|
+
title: string;
|
|
79
|
+
content: string;
|
|
80
|
+
type: string;
|
|
81
|
+
url: null;
|
|
82
|
+
settings: {
|
|
83
|
+
borderColor: null;
|
|
84
|
+
position: {
|
|
85
|
+
x: number;
|
|
86
|
+
y: number;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
question: null;
|
|
90
|
+
})[];
|
|
91
|
+
};
|
|
92
|
+
export declare const initialTree: ({
|
|
93
|
+
id: string;
|
|
94
|
+
title: string;
|
|
95
|
+
type: string;
|
|
96
|
+
question: {
|
|
97
|
+
id: string;
|
|
98
|
+
title: string;
|
|
99
|
+
description: string;
|
|
100
|
+
answers: {
|
|
101
|
+
title: string;
|
|
102
|
+
id: string;
|
|
103
|
+
nextStep: {
|
|
104
|
+
id: string;
|
|
105
|
+
};
|
|
106
|
+
}[];
|
|
107
|
+
};
|
|
108
|
+
url?: undefined;
|
|
109
|
+
} | {
|
|
110
|
+
id: string;
|
|
111
|
+
title: string;
|
|
112
|
+
type: string;
|
|
113
|
+
url: null;
|
|
114
|
+
question: {
|
|
115
|
+
id: string;
|
|
116
|
+
title: string;
|
|
117
|
+
description: string;
|
|
118
|
+
answers: {
|
|
119
|
+
title: string;
|
|
120
|
+
id: string;
|
|
121
|
+
nextStep: {
|
|
122
|
+
id: string;
|
|
123
|
+
};
|
|
124
|
+
}[];
|
|
125
|
+
};
|
|
126
|
+
} | {
|
|
127
|
+
id: string;
|
|
128
|
+
title: string;
|
|
129
|
+
type: string;
|
|
130
|
+
url: null;
|
|
131
|
+
question: null;
|
|
132
|
+
} | {
|
|
133
|
+
id: string;
|
|
134
|
+
title: string;
|
|
135
|
+
type: string;
|
|
136
|
+
url: string;
|
|
137
|
+
question: null;
|
|
138
|
+
})[];
|
|
139
|
+
export declare const treeWithLinkedSteps: ({
|
|
140
|
+
id: string;
|
|
141
|
+
number: number;
|
|
142
|
+
title: string;
|
|
143
|
+
type: string;
|
|
144
|
+
url: null;
|
|
145
|
+
question: {
|
|
146
|
+
id: string;
|
|
147
|
+
title: string;
|
|
148
|
+
description: string;
|
|
149
|
+
answers: {
|
|
150
|
+
title: string;
|
|
151
|
+
id: string;
|
|
152
|
+
nextStep: {
|
|
153
|
+
id: string;
|
|
154
|
+
number: number;
|
|
155
|
+
};
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
linkedSteps: {
|
|
159
|
+
id: string;
|
|
160
|
+
number: number;
|
|
161
|
+
}[];
|
|
162
|
+
} | {
|
|
163
|
+
id: string;
|
|
164
|
+
number: number;
|
|
165
|
+
title: string;
|
|
166
|
+
type: string;
|
|
167
|
+
question: {
|
|
168
|
+
id: string;
|
|
169
|
+
title: string;
|
|
170
|
+
description: string;
|
|
171
|
+
answers: {
|
|
172
|
+
title: string;
|
|
173
|
+
id: string;
|
|
174
|
+
nextStep: {
|
|
175
|
+
id: string;
|
|
176
|
+
number: number;
|
|
177
|
+
};
|
|
178
|
+
}[];
|
|
179
|
+
};
|
|
180
|
+
linkedSteps: {
|
|
181
|
+
id: string;
|
|
182
|
+
number: number;
|
|
183
|
+
}[];
|
|
184
|
+
url?: undefined;
|
|
185
|
+
} | {
|
|
186
|
+
id: string;
|
|
187
|
+
number: number;
|
|
188
|
+
title: string;
|
|
189
|
+
type: string;
|
|
190
|
+
url: null;
|
|
191
|
+
question: null;
|
|
192
|
+
linkedSteps?: undefined;
|
|
193
|
+
} | {
|
|
194
|
+
id: string;
|
|
195
|
+
number: number;
|
|
196
|
+
title: string;
|
|
197
|
+
type: string;
|
|
198
|
+
url: string;
|
|
199
|
+
question: null;
|
|
200
|
+
linkedSteps?: undefined;
|
|
201
|
+
})[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DecisionTree } from '@shelf/types-ddb';
|
|
2
|
+
declare type StepPointer = {
|
|
3
|
+
id?: string;
|
|
4
|
+
number?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare type DTStep = Omit<DecisionTree.Step, 'question'> & {
|
|
7
|
+
number: number;
|
|
8
|
+
content?: string;
|
|
9
|
+
question: {
|
|
10
|
+
id: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
answers: {
|
|
14
|
+
id: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
nextStep?: StepPointer;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
linkedSteps?: StepPointer[];
|
|
20
|
+
parentSteps: StepPointer[];
|
|
21
|
+
};
|
|
22
|
+
export declare type RenderDTContentData = {
|
|
23
|
+
tree: DTStep[];
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './renderStaticDTDiagram';
|
|
1
|
+
export * from './DecisionTreeDiagram/renderStaticDTDiagram';
|
|
2
|
+
export * from './DecisionTreeContent/renderDTContent';
|