@shelf/global-renderer 1.7.6 → 1.9.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 +30 -0
- package/lib/renderDTContent.js +38 -0
- package/lib/renderDTContent.js.LICENSE.txt +48 -0
- package/lib/renderStaticDTDiagram.js +3847 -0
- package/lib/renderStaticDTDiagram.js.LICENSE.txt +136 -0
- package/package.json +13 -18
- package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +0 -4
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +0 -49
- package/lib/DecisionTreeContent/components/Condition.d.ts +0 -8
- package/lib/DecisionTreeContent/components/ContentTable.d.ts +0 -6
- package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +0 -7
- package/lib/DecisionTreeContent/components/Link.d.ts +0 -6
- package/lib/DecisionTreeContent/components/Question.d.ts +0 -8
- package/lib/DecisionTreeContent/components/Solution.d.ts +0 -6
- package/lib/DecisionTreeContent/components/StepHeader.d.ts +0 -6
- package/lib/DecisionTreeContent/components/StepTypeIcon.d.ts +0 -7
- package/lib/DecisionTreeContent/helpers.d.ts +0 -44
- package/lib/DecisionTreeContent/mocks.d.ts +0 -314
- package/lib/DecisionTreeContent/renderDTContent.d.ts +0 -2
- package/lib/DecisionTreeContent/types.d.ts +0 -61
- package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +0 -7
- package/lib/DecisionTreeDiagram/renderStaticDTDiagram.d.ts +0 -8
- package/lib/i18next/index.d.ts +0 -3
- package/lib/index.d.ts +0 -3
- package/lib/index.es.js +0 -14261
- package/lib/index.umd.js +0 -275
- package/lib/types.d.ts +0 -1
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
export declare const dtData: {
|
|
2
|
-
title: string;
|
|
3
|
-
description: string;
|
|
4
|
-
exportedAt: string;
|
|
5
|
-
language: string;
|
|
6
|
-
exportedBy: string;
|
|
7
|
-
createdBy: string;
|
|
8
|
-
fields: {
|
|
9
|
-
name: string;
|
|
10
|
-
value: string;
|
|
11
|
-
}[];
|
|
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
|
-
defaultNextStep: {
|
|
24
|
-
id: string;
|
|
25
|
-
};
|
|
26
|
-
conditions: ({
|
|
27
|
-
id: string;
|
|
28
|
-
nextStep: {
|
|
29
|
-
id: string;
|
|
30
|
-
};
|
|
31
|
-
expression: {
|
|
32
|
-
joiner: string;
|
|
33
|
-
rules: {
|
|
34
|
-
id: string;
|
|
35
|
-
variableId: string;
|
|
36
|
-
value: string;
|
|
37
|
-
operator: string;
|
|
38
|
-
}[];
|
|
39
|
-
};
|
|
40
|
-
} | {
|
|
41
|
-
id: string;
|
|
42
|
-
expression: {
|
|
43
|
-
rules: {
|
|
44
|
-
id: string;
|
|
45
|
-
variableId: string;
|
|
46
|
-
value: string;
|
|
47
|
-
operator: string;
|
|
48
|
-
}[];
|
|
49
|
-
joiner?: undefined;
|
|
50
|
-
};
|
|
51
|
-
nextStep?: undefined;
|
|
52
|
-
})[];
|
|
53
|
-
content?: undefined;
|
|
54
|
-
url?: undefined;
|
|
55
|
-
question?: undefined;
|
|
56
|
-
isFirstStep?: undefined;
|
|
57
|
-
} | {
|
|
58
|
-
id: string;
|
|
59
|
-
title: string;
|
|
60
|
-
type: string;
|
|
61
|
-
content: string;
|
|
62
|
-
url: null;
|
|
63
|
-
settings: {
|
|
64
|
-
borderColor: string;
|
|
65
|
-
position: {
|
|
66
|
-
x: number;
|
|
67
|
-
y: number;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
question: {
|
|
71
|
-
id: string;
|
|
72
|
-
title: string;
|
|
73
|
-
description: string;
|
|
74
|
-
answers: ({
|
|
75
|
-
title: string;
|
|
76
|
-
id: string;
|
|
77
|
-
nextStep: {
|
|
78
|
-
id: string;
|
|
79
|
-
};
|
|
80
|
-
assignments?: undefined;
|
|
81
|
-
} | {
|
|
82
|
-
title: string;
|
|
83
|
-
id: string;
|
|
84
|
-
nextStep: {
|
|
85
|
-
id: string;
|
|
86
|
-
};
|
|
87
|
-
assignments: {
|
|
88
|
-
variableId: string;
|
|
89
|
-
value: string;
|
|
90
|
-
}[];
|
|
91
|
-
})[];
|
|
92
|
-
};
|
|
93
|
-
defaultNextStep?: undefined;
|
|
94
|
-
conditions?: undefined;
|
|
95
|
-
isFirstStep?: undefined;
|
|
96
|
-
} | {
|
|
97
|
-
id: string;
|
|
98
|
-
title: string;
|
|
99
|
-
type: string;
|
|
100
|
-
url: string;
|
|
101
|
-
settings: {
|
|
102
|
-
borderColor: null;
|
|
103
|
-
position: {
|
|
104
|
-
x: number;
|
|
105
|
-
y: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
question: null;
|
|
109
|
-
defaultNextStep?: undefined;
|
|
110
|
-
conditions?: undefined;
|
|
111
|
-
content?: undefined;
|
|
112
|
-
isFirstStep?: undefined;
|
|
113
|
-
} | {
|
|
114
|
-
id: string;
|
|
115
|
-
isFirstStep: boolean;
|
|
116
|
-
title: string;
|
|
117
|
-
type: string;
|
|
118
|
-
url: null;
|
|
119
|
-
content: string;
|
|
120
|
-
settings: {
|
|
121
|
-
borderColor: string;
|
|
122
|
-
position: {
|
|
123
|
-
x: number;
|
|
124
|
-
y: number;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
question: {
|
|
128
|
-
title: string;
|
|
129
|
-
description: string;
|
|
130
|
-
answers: ({
|
|
131
|
-
title: string;
|
|
132
|
-
id: string;
|
|
133
|
-
nextStep: null;
|
|
134
|
-
assignments?: undefined;
|
|
135
|
-
} | {
|
|
136
|
-
title: string;
|
|
137
|
-
id: string;
|
|
138
|
-
nextStep: {
|
|
139
|
-
id: string;
|
|
140
|
-
};
|
|
141
|
-
assignments: {
|
|
142
|
-
variableId: string;
|
|
143
|
-
value: string;
|
|
144
|
-
}[];
|
|
145
|
-
})[];
|
|
146
|
-
id?: undefined;
|
|
147
|
-
};
|
|
148
|
-
defaultNextStep?: undefined;
|
|
149
|
-
conditions?: undefined;
|
|
150
|
-
} | {
|
|
151
|
-
id: string;
|
|
152
|
-
title: string;
|
|
153
|
-
content: string;
|
|
154
|
-
type: string;
|
|
155
|
-
url: null;
|
|
156
|
-
settings: {
|
|
157
|
-
borderColor: string;
|
|
158
|
-
position: {
|
|
159
|
-
x: number;
|
|
160
|
-
y: number;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
question: {
|
|
164
|
-
id: string;
|
|
165
|
-
title: string;
|
|
166
|
-
description: string;
|
|
167
|
-
answers: ({
|
|
168
|
-
title: string;
|
|
169
|
-
id: string;
|
|
170
|
-
nextStep: {
|
|
171
|
-
id: string;
|
|
172
|
-
};
|
|
173
|
-
} | {
|
|
174
|
-
title: string;
|
|
175
|
-
id: string;
|
|
176
|
-
nextStep: null;
|
|
177
|
-
})[];
|
|
178
|
-
};
|
|
179
|
-
defaultNextStep?: undefined;
|
|
180
|
-
conditions?: undefined;
|
|
181
|
-
isFirstStep?: undefined;
|
|
182
|
-
} | {
|
|
183
|
-
id: string;
|
|
184
|
-
title: string;
|
|
185
|
-
content: string;
|
|
186
|
-
type: string;
|
|
187
|
-
url: null;
|
|
188
|
-
settings: {
|
|
189
|
-
borderColor: null;
|
|
190
|
-
position: {
|
|
191
|
-
x: number;
|
|
192
|
-
y: number;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
question: null;
|
|
196
|
-
defaultNextStep?: undefined;
|
|
197
|
-
conditions?: undefined;
|
|
198
|
-
isFirstStep?: undefined;
|
|
199
|
-
})[];
|
|
200
|
-
};
|
|
201
|
-
export declare const initialTree: ({
|
|
202
|
-
id: string;
|
|
203
|
-
title: string;
|
|
204
|
-
type: string;
|
|
205
|
-
question: {
|
|
206
|
-
id: string;
|
|
207
|
-
title: string;
|
|
208
|
-
description: string;
|
|
209
|
-
answers: {
|
|
210
|
-
title: string;
|
|
211
|
-
id: string;
|
|
212
|
-
nextStep: {
|
|
213
|
-
id: string;
|
|
214
|
-
};
|
|
215
|
-
}[];
|
|
216
|
-
};
|
|
217
|
-
isFirstStep?: undefined;
|
|
218
|
-
url?: undefined;
|
|
219
|
-
} | {
|
|
220
|
-
id: string;
|
|
221
|
-
title: string;
|
|
222
|
-
type: string;
|
|
223
|
-
isFirstStep: boolean;
|
|
224
|
-
url: null;
|
|
225
|
-
question: {
|
|
226
|
-
id: string;
|
|
227
|
-
title: string;
|
|
228
|
-
description: string;
|
|
229
|
-
answers: {
|
|
230
|
-
title: string;
|
|
231
|
-
id: string;
|
|
232
|
-
nextStep: {
|
|
233
|
-
id: string;
|
|
234
|
-
};
|
|
235
|
-
}[];
|
|
236
|
-
};
|
|
237
|
-
} | {
|
|
238
|
-
id: string;
|
|
239
|
-
title: string;
|
|
240
|
-
type: string;
|
|
241
|
-
url: null;
|
|
242
|
-
question: null;
|
|
243
|
-
isFirstStep?: undefined;
|
|
244
|
-
} | {
|
|
245
|
-
id: string;
|
|
246
|
-
title: string;
|
|
247
|
-
type: string;
|
|
248
|
-
url: string;
|
|
249
|
-
question: null;
|
|
250
|
-
isFirstStep?: undefined;
|
|
251
|
-
})[];
|
|
252
|
-
export declare const treeWithLinkedSteps: ({
|
|
253
|
-
id: string;
|
|
254
|
-
number: number;
|
|
255
|
-
title: string;
|
|
256
|
-
type: string;
|
|
257
|
-
url: null;
|
|
258
|
-
question: {
|
|
259
|
-
id: string;
|
|
260
|
-
title: string;
|
|
261
|
-
description: string;
|
|
262
|
-
answers: {
|
|
263
|
-
title: string;
|
|
264
|
-
id: string;
|
|
265
|
-
nextStep: {
|
|
266
|
-
id: string;
|
|
267
|
-
number: number;
|
|
268
|
-
};
|
|
269
|
-
}[];
|
|
270
|
-
};
|
|
271
|
-
linkedSteps: {
|
|
272
|
-
id: string;
|
|
273
|
-
number: number;
|
|
274
|
-
}[];
|
|
275
|
-
} | {
|
|
276
|
-
id: string;
|
|
277
|
-
number: number;
|
|
278
|
-
title: string;
|
|
279
|
-
type: string;
|
|
280
|
-
question: {
|
|
281
|
-
id: string;
|
|
282
|
-
title: string;
|
|
283
|
-
description: string;
|
|
284
|
-
answers: {
|
|
285
|
-
title: string;
|
|
286
|
-
id: string;
|
|
287
|
-
nextStep: {
|
|
288
|
-
id: string;
|
|
289
|
-
number: number;
|
|
290
|
-
};
|
|
291
|
-
}[];
|
|
292
|
-
};
|
|
293
|
-
linkedSteps: {
|
|
294
|
-
id: string;
|
|
295
|
-
number: number;
|
|
296
|
-
}[];
|
|
297
|
-
url?: undefined;
|
|
298
|
-
} | {
|
|
299
|
-
id: string;
|
|
300
|
-
number: number;
|
|
301
|
-
title: string;
|
|
302
|
-
type: string;
|
|
303
|
-
url: null;
|
|
304
|
-
question: null;
|
|
305
|
-
linkedSteps?: undefined;
|
|
306
|
-
} | {
|
|
307
|
-
id: string;
|
|
308
|
-
number: number;
|
|
309
|
-
title: string;
|
|
310
|
-
type: string;
|
|
311
|
-
url: string;
|
|
312
|
-
question: null;
|
|
313
|
-
linkedSteps?: undefined;
|
|
314
|
-
})[];
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { DecisionTree } from '@shelf/types-ddb';
|
|
2
|
-
import type { L10n } from '@shelf/types';
|
|
3
|
-
export type DTStepFromApi = DecisionTree.Step & {
|
|
4
|
-
content?: string;
|
|
5
|
-
isFirstStep?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export type RenderDTContentData = {
|
|
8
|
-
tree: DTStepFromApi[];
|
|
9
|
-
title: string;
|
|
10
|
-
description: string;
|
|
11
|
-
language: L10n.LanguageCode;
|
|
12
|
-
exportedAt: string;
|
|
13
|
-
exportedBy: string;
|
|
14
|
-
createdBy: string;
|
|
15
|
-
fields?: {
|
|
16
|
-
name: string;
|
|
17
|
-
value: string;
|
|
18
|
-
}[];
|
|
19
|
-
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
20
|
-
};
|
|
21
|
-
type StepPointer = {
|
|
22
|
-
id?: string;
|
|
23
|
-
number?: number;
|
|
24
|
-
};
|
|
25
|
-
export type ConditionType = {
|
|
26
|
-
id: string;
|
|
27
|
-
expression: {
|
|
28
|
-
joiner?: DecisionTree.Joiners;
|
|
29
|
-
rules: {
|
|
30
|
-
id: string;
|
|
31
|
-
variableId: string;
|
|
32
|
-
operator: DecisionTree.Operators;
|
|
33
|
-
value: string;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
nextStep?: StepPointer;
|
|
37
|
-
};
|
|
38
|
-
export type DTStep = Omit<DecisionTree.Step, 'question'> & {
|
|
39
|
-
number: number;
|
|
40
|
-
content?: string;
|
|
41
|
-
isFirstStep?: boolean;
|
|
42
|
-
question: {
|
|
43
|
-
id: string;
|
|
44
|
-
title?: string;
|
|
45
|
-
description?: string;
|
|
46
|
-
answers: {
|
|
47
|
-
id: string;
|
|
48
|
-
title?: string;
|
|
49
|
-
nextStep?: StepPointer;
|
|
50
|
-
assignments?: DecisionTree.Assignment[];
|
|
51
|
-
}[];
|
|
52
|
-
};
|
|
53
|
-
conditions?: ConditionType[];
|
|
54
|
-
linkedSteps?: StepPointer[];
|
|
55
|
-
parentSteps: StepPointer[];
|
|
56
|
-
defaultNextStep?: {
|
|
57
|
-
id: string;
|
|
58
|
-
number?: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
|
-
declare const StaticTreeContainer: ({ tree, variables, }: {
|
|
4
|
-
tree: DecisionTree.Step[];
|
|
5
|
-
variables: DecisionTree.ContextualVariableDefaults[];
|
|
6
|
-
}) => React.JSX.Element;
|
|
7
|
-
export default StaticTreeContainer;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { L10n } from '@shelf/types';
|
|
2
|
-
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
|
-
export declare const renderStaticDTDiagram: ({ language, tree, variables, containerSelector, }: {
|
|
4
|
-
language?: L10n.LanguageCode | undefined;
|
|
5
|
-
tree: DecisionTree.Step[];
|
|
6
|
-
variables: DecisionTree.ContextualVariableDefaults[];
|
|
7
|
-
containerSelector?: string | undefined;
|
|
8
|
-
}) => void;
|
package/lib/i18next/index.d.ts
DELETED
package/lib/index.d.ts
DELETED