@shelf/global-renderer 1.0.0-beta.0 → 1.0.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +45 -2367
  2. package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
  3. package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +11483 -47
  4. package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
  5. package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
  6. package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
  7. package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
  8. package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
  9. package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
  10. package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
  11. package/lib/DecisionTreeContent/helpers.d.ts +4 -4
  12. package/lib/DecisionTreeContent/types.d.ts +1 -1
  13. package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
  14. package/lib/index.js +20383 -4
  15. package/package.json +19 -16
  16. package/lib/DecisionTreeContent/DecisionTreeContent.js +0 -84
  17. package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +0 -225
  18. package/lib/DecisionTreeContent/components/Condition.js +0 -73
  19. package/lib/DecisionTreeContent/components/ContentTable.js +0 -26
  20. package/lib/DecisionTreeContent/components/ExportedMeta.js +0 -29
  21. package/lib/DecisionTreeContent/components/Link.js +0 -18
  22. package/lib/DecisionTreeContent/components/Question.js +0 -55
  23. package/lib/DecisionTreeContent/components/Solution.js +0 -20
  24. package/lib/DecisionTreeContent/components/StepHeader.js +0 -46
  25. package/lib/DecisionTreeContent/components/StepTypeIcon.js +0 -30
  26. package/lib/DecisionTreeContent/helpers.js +0 -56
  27. package/lib/DecisionTreeContent/renderDTContent.js +0 -12
  28. package/lib/DecisionTreeDiagram/StaticTreeContainer.js +0 -27
  29. package/lib/DecisionTreeDiagram/renderStaticDTDiagram.js +0 -26
  30. package/lib/_virtual/_commonjsHelpers.js +0 -4
  31. package/lib/_virtual/advancedFormat.js +0 -4
  32. package/lib/_virtual/client.js +0 -4
  33. package/lib/_virtual/dayjs.min.js +0 -4
  34. package/lib/_virtual/index.js +0 -4
  35. package/lib/_virtual/index2.js +0 -4
  36. package/lib/_virtual/localeData.js +0 -4
  37. package/lib/_virtual/localizedFormat.js +0 -4
  38. package/lib/_virtual/react-dom.development.js +0 -4
  39. package/lib/_virtual/react-dom.production.min.js +0 -4
  40. package/lib/_virtual/scheduler.development.js +0 -4
  41. package/lib/_virtual/scheduler.production.min.js +0 -4
  42. package/lib/i18next/index.js +0 -18
  43. package/lib/node_modules/@shelf/datetime/lib/getDateFormatTemplates.js +0 -15
  44. package/lib/node_modules/@shelf/datetime/lib/getDateWithCustomFormat.js +0 -10
  45. package/lib/node_modules/@shelf/datetime/lib/getTimeFormatTemplates.js +0 -17
  46. package/lib/node_modules/@shelf/datetime/lib/isDate.js +0 -4
  47. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/dayjs.min.js +0 -295
  48. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/advancedFormat.js +0 -54
  49. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/localeData.js +0 -82
  50. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/localizedFormat.js +0 -28
  51. package/lib/node_modules/react-dom/cjs/react-dom.development.js +0 -12880
  52. package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +0 -5643
  53. package/lib/node_modules/react-dom/client.js +0 -28
  54. package/lib/node_modules/react-dom/index.js +0 -17
  55. package/lib/node_modules/scheduler/cjs/scheduler.development.js +0 -278
  56. package/lib/node_modules/scheduler/cjs/scheduler.production.min.js +0 -231
  57. package/lib/node_modules/scheduler/index.js +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shelf/global-renderer",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0",
4
4
  "description": "The package exposes entrypoints with window's function(-s) to render React component",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,35 +19,38 @@
19
19
  "module": "lib/index.js",
20
20
  "types": "lib/index.d.ts",
21
21
  "files": [
22
- "lib"
22
+ "lib",
23
+ "CHANGELOG.md"
23
24
  ],
24
25
  "scripts": {
25
26
  "build": "vite build && yarn build:types",
26
27
  "build:types": "tsc --emitDeclarationOnly --noEmit false",
27
- "type-check": "tsc --noEmit",
28
- "test": "jest",
29
28
  "coverage": "yarn test --coverage",
30
- "start": "storybook dev -p 3001"
29
+ "start": "storybook dev -p 3001",
30
+ "test": "jest",
31
+ "type-check": "tsc --noEmit"
31
32
  },
32
33
  "dependencies": {
33
- "@shelf/datetime": "^1.2.1"
34
+ "@shelf/i18n": "13.7.3",
35
+ "@shelf/icons": "^8.1.0-beta.3",
36
+ "react-i18next": "11.8.15"
34
37
  },
35
38
  "devDependencies": {
36
- "@shelf/decision-tree-editor-components": "^1.0.0-beta.0",
37
- "@shelf/i18n": "10.11.0",
38
- "@shelf/types": "^44.82.1",
39
+ "@shelf/decision-tree-editor-components": "^1.0.4-beta.44",
40
+ "@shelf/types": "^51.40.1",
39
41
  "@types/react-dom": "18.0.6",
40
- "i18next": "20.2.2",
41
- "react-i18next": "11.8.15",
42
- "styled-components": "5.3.5"
42
+ "i18next": "21.6.3",
43
+ "react-i18next": "11.8.15"
43
44
  },
44
45
  "peerDependencies": {
45
46
  "@shelf/client-helpers": "4.x.x",
46
- "@shelf/icons": "^7.14.10",
47
+ "@shelf/datetime": "^2.0.0",
48
+ "@shelf/decision-tree-editor-components": "^1.0.4-beta.0",
47
49
  "@shelf/rich-text-editor": "4.x.x",
48
- "@shelf/types": "^44.82.1",
50
+ "@shelf/types": "^50.0.6",
49
51
  "lodash": "4.17.x",
50
- "react": "18.x.x"
52
+ "react": "18.x.x",
53
+ "styled-components": "^5 || ^6"
51
54
  },
52
- "gitHead": "83e2f3b7a0b8997bf14217df9e0a6e199ca24791"
55
+ "gitHead": "a845f16d5f805277439064a3ade8b46a45764944"
53
56
  }
@@ -1,84 +0,0 @@
1
- import { DecisionTree as a } from "@shelf/icons";
2
- import { colors as u } from "@shelf/client-helpers";
3
- import { I18nextProvider as D } from "react-i18next";
4
- import { isEmpty as s } from "lodash";
5
- import { DTContentContainer as C, DTMeta as x, DTIcon as F, DTInternalMeta as S, DTTitle as y, DTDescription as I, CustomFields as M, CustomField as j, FieldName as k, FieldValue as E, DTContent as L } from "./DecisionTreeContent.styled.js";
6
- import R from "../i18next/index.js";
7
- import { convertStepToRenderFormat as $ } from "./helpers.js";
8
- import v from "./components/Question.js";
9
- import w from "./components/Condition.js";
10
- import z from "./components/Solution.js";
11
- import N from "./components/Link.js";
12
- import P from "./components/ContentTable.js";
13
- import Q from "./components/ExportedMeta.js";
14
- import { jsx as o, jsxs as e } from "react/jsx-runtime";
15
- const V = ({
16
- step: r,
17
- variables: t
18
- }) => r.type === "Link" ? /* @__PURE__ */ o(N, {
19
- step: r
20
- }) : r.type === "Solution" ? /* @__PURE__ */ o(z, {
21
- step: r
22
- }) : r.type === "Condition" ? /* @__PURE__ */ o(w, {
23
- step: r,
24
- variables: t
25
- }) : /* @__PURE__ */ o(v, {
26
- step: r,
27
- variables: t
28
- }), b = ({
29
- title: r,
30
- description: t,
31
- tree: d,
32
- exportedBy: l,
33
- exportedAt: p,
34
- createdBy: f,
35
- fields: m,
36
- variables: T
37
- }) => {
38
- const c = $(d);
39
- return /* @__PURE__ */ o(D, {
40
- i18n: R,
41
- children: /* @__PURE__ */ e(C, {
42
- id: "dt-content-container",
43
- children: [/* @__PURE__ */ o(Q, {
44
- exportedBy: l,
45
- exportedAt: p,
46
- createdBy: f
47
- }), /* @__PURE__ */ e(x, {
48
- children: [/* @__PURE__ */ o(F, {
49
- children: /* @__PURE__ */ o(a, {
50
- iconSize: 20,
51
- color: u.$white
52
- })
53
- }), /* @__PURE__ */ e(S, {
54
- children: [/* @__PURE__ */ o(y, {
55
- children: r
56
- }), /* @__PURE__ */ o(I, {
57
- children: t
58
- })]
59
- })]
60
- }), !s(m) && /* @__PURE__ */ o(M, {
61
- children: m?.map(({
62
- name: n,
63
- value: i
64
- }, h) => /* @__PURE__ */ e(j, {
65
- children: [/* @__PURE__ */ e(k, {
66
- children: [n, ": "]
67
- }), /* @__PURE__ */ o(E, {
68
- children: i
69
- })]
70
- }, h))
71
- }), /* @__PURE__ */ o(P, {
72
- tree: c
73
- }), /* @__PURE__ */ o(L, {
74
- children: c.map((n, i) => /* @__PURE__ */ o(V, {
75
- step: n,
76
- variables: T
77
- }, i))
78
- })]
79
- })
80
- });
81
- }, _ = b;
82
- export {
83
- _ as default
84
- };
@@ -1,225 +0,0 @@
1
- import t from "styled-components";
2
- import { colors as i } from "@shelf/client-helpers";
3
- const d = t.div`
4
- margin: 0;
5
- font-family: 'Open Sans', Arial, sans-serif;
6
- color: ${i.$dark};
7
- font-size: 14px;
8
- `, a = t.div`
9
- display: flex;
10
- `, p = t.div`
11
- min-width: 40px;
12
- width: 40px;
13
- height: 40px;
14
- background-color: ${i.$colorDecisionTree};
15
- display: flex;
16
- align-items: center;
17
- justify-content: center;
18
- margin-right: 10px;
19
- `, r = t.div`
20
- display: flex;
21
- flex-direction: column;
22
- `, s = t.div`
23
- font-size: 20px;
24
- line-height: 1.25;
25
- padding: 0 5px 5px;
26
- `, l = t.div`
27
- font-size: 14px;
28
- padding: 0 0 10px 5px;
29
- `, c = t.div`
30
- float: right;
31
- max-width: 100%;
32
- width: 100%;
33
- `, x = t.div`
34
- padding-top: 20px;
35
- `, g = t.div`
36
- font-size: 14px;
37
- font-weight: 700;
38
- display: flex;
39
- justify-content: center;
40
- `, h = t.div`
41
- display: flex;
42
- padding: 10px 0;
43
- `, m = t.div`
44
- page-break-inside: avoid;
45
- `, v = t.div`
46
- display: flex;
47
- width: 20%;
48
- `, f = t.div`
49
- width: 20px;
50
- height: 20px;
51
- min-width: 20px;
52
- background-color: ${(e) => e.color || i.$catchyBlue};
53
- border-radius: 5px;
54
- `, b = t.div`
55
- line-height: 20px;
56
- font-weight: 700;
57
- padding-left: 10px;
58
- margin-bottom: 10px;
59
- margin-right: 50px;
60
- `, u = t.div`
61
- font-size: 20px;
62
- padding-bottom: 10px;
63
- page-break-inside: avoid;
64
- `, w = t.div`
65
- font-size: 14px;
66
- `, k = t.div`
67
- background-color: ${i.$greyBlue};
68
- border-left: 1px solid ${i.$deepBlue};
69
- padding: 20px 15px 15px;
70
- margin: 10px 0;
71
- `, $ = t.div`
72
- font-weight: bold;
73
- padding-bottom: 15px;
74
- line-height: 20px;
75
- `, y = t.div`
76
- padding-bottom: 10px;
77
- `, T = t.div`
78
- display: flex;
79
- page-break-inside: avoid;
80
- padding-bottom: 5px;
81
- `, C = t.div`
82
- background-color: ${i.$white};
83
- padding: 10px 10px 5px;
84
- border-radius: 5px;
85
- margin-bottom: 10px;
86
- line-height: 20px;
87
- page-break-inside: avoid;
88
- `, B = t.div`
89
- padding-right: 5px;
90
- `, D = t.div`
91
- display: flex;
92
- padding-right: 5px;
93
- align-items: center;
94
- `, L = t.img`
95
- width: 14px;
96
- height: 14px;
97
- `, S = t.a`
98
- text-decoration: none;
99
- color: ${i.$deepBlue};
100
- page-break-inside: avoid;
101
- max-width: 90%;
102
- word-wrap: break-word;
103
- `, A = t.span`
104
- ${({
105
- isDeleted: e
106
- }) => e ? "text-decoration: line-through" : ""}
107
- `, I = t.div``, z = t.div`
108
- padding-bottom: 5px;
109
- &:last-child {
110
- padding-bottom: 0;
111
- }
112
- `, N = t.a`
113
- color: ${i.$greyThemeText};
114
- margin-right: 0;
115
- margin-left: auto;
116
- text-decoration: none;
117
- `, F = t.div`
118
- color: ${i.$deepBlue};
119
- margin-right: 0;
120
- margin-left: auto;
121
- word-break: break-all;
122
- align-items: flex-end;
123
- max-width: 80%;
124
- `, M = t.a`
125
- padding: 0 5px;
126
- text-decoration: none;
127
- color: ${i.$deepBlue};
128
- line-height: 20px;
129
- `, Q = t.a`
130
- text-decoration: none;
131
- color: ${i.$deepBlue};
132
- page-break-inside: avoid;
133
- word-break: break-all;
134
- `, j = t.div`
135
- color: ${i.$dark};
136
- line-height: 20px;
137
- margin-right: 0;
138
- margin-left: auto;
139
- `, H = t.div`
140
- display: flex;
141
- flex-direction: column;
142
- padding-bottom: 15px;
143
- float: left;
144
- max-width: 100%;
145
- width: 100%;
146
- margin-top: 10px;
147
- `, P = t.div`
148
- line-height: 20px;
149
- padding-bottom: 5px;
150
- display: flex;
151
- page-break-inside: avoid;
152
- `, V = t.a`
153
- text-decoration: none;
154
- color: ${i.$deepBlue};
155
- line-height: 20px;
156
- `, O = t.div`
157
- margin-right: 5px;
158
- `, R = t.div`
159
- min-height: 19px;
160
- min-width: 20px;
161
- line-height: 20px;
162
- `, U = t.div`
163
- padding-bottom: 25px;
164
- `, W = t.div`
165
- line-height: 20px;
166
- padding-bottom: 5px;
167
- page-break-inside: avoid;
168
- `, q = t.div`
169
- margin-bottom: 5px;
170
- margin-left: 55px;
171
- `, E = t.div`
172
- line-height: 24px;
173
- display: flex;
174
- padding-bottom: 5px;
175
- `, G = t.div`
176
- font-weight: 700;
177
- `, J = t.div`
178
- padding-left: 5px;
179
- `;
180
- export {
181
- T as Answer,
182
- B as AnswerNumber,
183
- S as AnswerTitle,
184
- A as AnswerVariable,
185
- C as AnswerWithAssignments,
186
- L as AssignmentIcon,
187
- D as AssignmentIconBlock,
188
- I as Condition,
189
- w as Content,
190
- H as ContentList,
191
- R as ContentListIcon,
192
- P as ContentListItem,
193
- V as ContentListLink,
194
- O as ContentListNumber,
195
- u as ContentTitle,
196
- E as CustomField,
197
- q as CustomFields,
198
- c as DTContent,
199
- d as DTContentContainer,
200
- l as DTDescription,
201
- p as DTIcon,
202
- r as DTInternalMeta,
203
- a as DTMeta,
204
- s as DTTitle,
205
- G as FieldName,
206
- J as FieldValue,
207
- Q as LinkUrl,
208
- W as MataInfo,
209
- U as MetaBlock,
210
- j as NoLinks,
211
- M as ParentLink,
212
- k as Question,
213
- y as QuestionDescription,
214
- $ as QuestionTitle,
215
- z as Rule,
216
- x as StepContainer,
217
- v as StepHeader,
218
- m as StepHeaderBlock,
219
- N as StepLink,
220
- g as StepNumber,
221
- F as StepParents,
222
- f as StepType,
223
- h as StepTypeContainer,
224
- b as StepTypeTitle
225
- };
@@ -1,73 +0,0 @@
1
- import P from "./StepHeader.js";
2
- import { StepContainer as A, ContentTitle as C, Question as N, AnswerWithAssignments as f, Answer as x, AnswerNumber as m, Condition as u, Rule as D, AnswerTitle as o, AnswerVariable as g, StepLink as v } from "../DecisionTreeContent.styled.js";
3
- import i from "../../i18next/index.js";
4
- import { jsxs as t, jsx as e, Fragment as j } from "react/jsx-runtime";
5
- const I = ({
6
- step: n,
7
- variables: w
8
- }) => {
9
- const s = {
10
- eq: "=",
11
- neq: "\u2260",
12
- contains: i.t("pdf-viewer.exportDTPDF.contains"),
13
- not_contains: i.t("pdf-viewer.exportDTPDF.notContains")
14
- }, a = [...n?.conditions || []];
15
- return /* @__PURE__ */ t(A, {
16
- children: [/* @__PURE__ */ e(P, {
17
- step: n
18
- }), /* @__PURE__ */ e(C, {
19
- children: n.title
20
- }), /* @__PURE__ */ t(N, {
21
- children: [a?.map((r, S) => {
22
- const l = r?.expression?.rules, $ = r?.expression?.joiner;
23
- return l ? /* @__PURE__ */ e(f, {
24
- children: /* @__PURE__ */ t(x, {
25
- children: [/* @__PURE__ */ t(m, {
26
- children: [S + 1, "."]
27
- }), /* @__PURE__ */ e(u, {
28
- children: l.map((d) => {
29
- const p = w?.find((F) => F.id === d.variableId), c = p?.name, h = p?.isDeleted, b = d?.id === l[l.length - 1]?.id, T = h ? ` (${i.t("pdf-viewer.exportDTPDF.deleted")}) [${s[d.operator]}] ${d?.value}` : ` [${s[d.operator]}] ${d?.value}`;
30
- return /* @__PURE__ */ t(j, {
31
- children: [/* @__PURE__ */ e(D, {
32
- children: c && /* @__PURE__ */ t(o, {
33
- href: `#${r?.nextStep?.id}`,
34
- children: [/* @__PURE__ */ e(g, {
35
- isDeleted: h,
36
- children: c
37
- }), T]
38
- })
39
- }), $ && !b && /* @__PURE__ */ e(o, {
40
- href: `#${r?.nextStep?.id}`,
41
- children: i.t("pdf-viewer.exportDTPDF.andOperator")
42
- })]
43
- });
44
- })
45
- }), r?.nextStep?.number && /* @__PURE__ */ t(v, {
46
- href: `#${r.nextStep?.id}`,
47
- children: [i.t("pdf-viewer.exportDTPDF.step"), " ", r.nextStep.number]
48
- })]
49
- })
50
- }, r.id) : null;
51
- }), /* @__PURE__ */ e(f, {
52
- children: /* @__PURE__ */ t(x, {
53
- children: [/* @__PURE__ */ t(m, {
54
- children: [a.length + 1, "."]
55
- }), /* @__PURE__ */ e(u, {
56
- children: /* @__PURE__ */ e(D, {
57
- children: /* @__PURE__ */ e(o, {
58
- href: `#${n?.defaultNextStep?.id}`,
59
- children: i.t("pdf-viewer.exportDTPDF.default")
60
- })
61
- })
62
- }), n?.defaultNextStep?.id && /* @__PURE__ */ t(v, {
63
- href: `#${n.defaultNextStep?.id}`,
64
- children: [i.t("pdf-viewer.exportDTPDF.step"), " ", n.defaultNextStep?.number]
65
- })]
66
- })
67
- })]
68
- })]
69
- });
70
- };
71
- export {
72
- I as default
73
- };
@@ -1,26 +0,0 @@
1
- import { isEmpty as r } from "lodash";
2
- import { colors as i } from "@shelf/client-helpers";
3
- import { ContentList as p, ContentListItem as s, ContentListNumber as l, ContentListIcon as c, ContentListLink as m } from "../DecisionTreeContent.styled.js";
4
- import d from "./StepTypeIcon.js";
5
- import { jsx as o, jsxs as e } from "react/jsx-runtime";
6
- const a = ({
7
- tree: n
8
- }) => /* @__PURE__ */ o(p, {
9
- children: !r(n) && n.map((t) => /* @__PURE__ */ e(s, {
10
- children: [/* @__PURE__ */ e(l, {
11
- children: [t.number, "."]
12
- }), /* @__PURE__ */ o(c, {
13
- children: /* @__PURE__ */ o(d, {
14
- type: t.type,
15
- iconSize: 12,
16
- color: i.$deepBlue
17
- })
18
- }), /* @__PURE__ */ o(m, {
19
- href: `#${t.id}`,
20
- children: t.title || t?.question?.title
21
- })]
22
- }, t.id))
23
- });
24
- export {
25
- a as default
26
- };
@@ -1,29 +0,0 @@
1
- import { MetaBlock as p, MataInfo as e } from "../DecisionTreeContent.styled.js";
2
- import { getDateAndTime as n } from "../helpers.js";
3
- import t from "../../i18next/index.js";
4
- import { jsxs as f, jsx as r } from "react/jsx-runtime";
5
- const c = ({
6
- exportedAt: o,
7
- exportedBy: a,
8
- createdBy: i
9
- }) => /* @__PURE__ */ f(p, {
10
- children: [/* @__PURE__ */ r(e, {
11
- children: t.t("pdf-viewer.exportDTPDF.exportedInfo", {
12
- date: n(o),
13
- exportedBy: a,
14
- interpolation: {
15
- escapeValue: !1
16
- }
17
- })
18
- }), /* @__PURE__ */ r(e, {
19
- children: t.t("pdf-viewer.exportDTPDF.createdInfo", {
20
- createdBy: i,
21
- interpolation: {
22
- escapeValue: !1
23
- }
24
- })
25
- })]
26
- });
27
- export {
28
- c as default
29
- };
@@ -1,18 +0,0 @@
1
- import { StepContainer as i, ContentTitle as n, LinkUrl as t } from "../DecisionTreeContent.styled.js";
2
- import l from "./StepHeader.js";
3
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
4
- const u = ({
5
- step: r
6
- }) => /* @__PURE__ */ o(i, {
7
- children: [/* @__PURE__ */ e(l, {
8
- step: r
9
- }), /* @__PURE__ */ e(n, {
10
- children: r.title
11
- }), r.url && /* @__PURE__ */ e(t, {
12
- href: r.url,
13
- children: r.url
14
- })]
15
- });
16
- export {
17
- u as default
18
- };
@@ -1,55 +0,0 @@
1
- import h from "./StepHeader.js";
2
- import { StepContainer as V, ContentTitle as u, Content as g, Question as b, QuestionTitle as T, QuestionDescription as f, AnswerWithAssignments as x, Answer as o, AnswerNumber as D, AnswerTitle as s, StepLink as w, AssignmentIconBlock as M, AssignmentIcon as F, AnswerVariable as L } from "../DecisionTreeContent.styled.js";
3
- import d from "../../i18next/index.js";
4
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
5
- const S = "data:image/svg;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAM1BMVEVHcEwqWJYrV5crVpcrV5crV5crV5cqV5grV5cuWJcrV5crVpUrV5crWJcqVpgrVpcrV5f4E2OkAAAAEHRSTlMAIbdw6Nb2T90Ph0KhyTVaZXFVxwAAAPZJREFUOMvFlMsWgyAMRAVRjID6/19bEqW8QTeaTUm54jCT4zB8XYerPvAMFRNWDaVNcaGyL1O+gLLZLsdwf7d/zKx0Ku1sntzw2b0sYLXrBRwJk23XmlZjG+4aHTYZCsLLHdFwqDtA8pRbBcILZrmzYIntKPl6KeT2R3ciALzaiocb6KXF8GpWqGD9YNU5curODGASf++bKF0+SK2B8lMA76P4+smkEkqopMEjG2QbpaGVpw0za6F+8EgHNFCM1fjb6TpKw8LygcxRFaW0hV2CMhEPXviOBDWp8dwrj1GdxUkR69e+LrdQsWDVKNoUzz/Fd9Gv6weN4h7TPdxgMQAAAABJRU5ErkJggg==", K = ({
6
- step: n,
7
- variables: a
8
- }) => /* @__PURE__ */ r(V, {
9
- children: [/* @__PURE__ */ e(h, {
10
- step: n
11
- }), /* @__PURE__ */ e(u, {
12
- children: n.title
13
- }), n.content && /* @__PURE__ */ e(g, {
14
- className: "fr-view custom-theme",
15
- dangerouslySetInnerHTML: {
16
- __html: n.content
17
- }
18
- }), /* @__PURE__ */ r(b, {
19
- children: [/* @__PURE__ */ e(T, {
20
- children: n?.question?.title
21
- }), /* @__PURE__ */ e(f, {
22
- children: n?.question?.description
23
- }), n?.question?.answers?.map((t, c) => /* @__PURE__ */ r(x, {
24
- children: [/* @__PURE__ */ r(o, {
25
- children: [/* @__PURE__ */ r(D, {
26
- children: [c + 1, "."]
27
- }), /* @__PURE__ */ e(s, {
28
- href: `#${t.nextStep?.id}`,
29
- children: t?.title
30
- }), t?.nextStep?.number && /* @__PURE__ */ r(w, {
31
- href: `#${t.nextStep?.id}`,
32
- children: [d.t("pdf-viewer.exportDTPDF.step"), " ", t.nextStep.number]
33
- })]
34
- }), t?.assignments && t?.assignments.map((A, p) => {
35
- const i = a?.find((m) => m.id === A.variableId), l = i?.isDeleted;
36
- return i ? /* @__PURE__ */ r(o, {
37
- children: [/* @__PURE__ */ e(M, {
38
- children: /* @__PURE__ */ e(F, {
39
- src: S
40
- })
41
- }), /* @__PURE__ */ r(s, {
42
- href: `#${t.nextStep?.id}`,
43
- children: [/* @__PURE__ */ e(L, {
44
- isDeleted: l,
45
- children: i?.name
46
- }), l ? ` (${d.t("pdf-viewer.exportDTPDF.deleted")})` : "", " =", ` ${A.value}`]
47
- })]
48
- }, p) : null;
49
- })]
50
- }, c))]
51
- })]
52
- });
53
- export {
54
- K as default
55
- };
@@ -1,20 +0,0 @@
1
- import { StepContainer as n, ContentTitle as o, Content as r } from "../DecisionTreeContent.styled.js";
2
- import i from "./StepHeader.js";
3
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
4
- const s = ({
5
- step: t
6
- }) => /* @__PURE__ */ m(n, {
7
- children: [/* @__PURE__ */ e(i, {
8
- step: t
9
- }), /* @__PURE__ */ e(o, {
10
- children: t.title
11
- }), t.content && /* @__PURE__ */ e(r, {
12
- className: "fr-view custom-theme",
13
- dangerouslySetInnerHTML: {
14
- __html: t.content
15
- }
16
- })]
17
- });
18
- export {
19
- s as default
20
- };
@@ -1,46 +0,0 @@
1
- import { toLower as c, get as a, isEmpty as m } from "lodash";
2
- import { colors as i } from "@shelf/client-helpers";
3
- import { StepHeaderBlock as h, StepNumber as S, StepTypeContainer as f, StepHeader as u, StepType as D, StepTypeTitle as T, NoLinks as x, StepParents as y, ParentLink as P } from "../DecisionTreeContent.styled.js";
4
- import t from "../../i18next/index.js";
5
- import { jsxs as r, jsx as o, Fragment as l } from "react/jsx-runtime";
6
- const $ = {
7
- question: i.$catchyBlue,
8
- solution: i.$dark,
9
- link: i.$yellow,
10
- condition: i.$greenCheck
11
- }, L = ({
12
- step: e
13
- }) => {
14
- const n = c(e.type);
15
- return /* @__PURE__ */ r(h, {
16
- id: e.id,
17
- children: [/* @__PURE__ */ r(S, {
18
- children: [t.t("pdf-viewer.exportDTPDF.step"), " ", e.number, e.isFirstStep ? ` - ${t.t("pdf-viewer.exportDTPDF.startingPoint")}` : ""]
19
- }), /* @__PURE__ */ r(f, {
20
- children: [/* @__PURE__ */ r(u, {
21
- children: [/* @__PURE__ */ o(D, {
22
- color: e?.settings?.borderColor || a($, n)
23
- }), /* @__PURE__ */ o(T, {
24
- children: t.t(`pdf-viewer.exportDTPDF.${n}`)
25
- })]
26
- }), m(e.parentSteps) ? /* @__PURE__ */ o(x, {
27
- children: t.t("pdf-viewer.exportDTPDF.noLinks")
28
- }) : /* @__PURE__ */ r(y, {
29
- children: [t.t("pdf-viewer.exportDTPDF.parentSteps"), ":", e.parentSteps.map((p, d) => {
30
- const s = d === e.parentSteps.length - 1;
31
- return /* @__PURE__ */ r(l, {
32
- children: [/* @__PURE__ */ o(P, {
33
- href: `#${p.id}`,
34
- children: p.number
35
- }, d), !s && /* @__PURE__ */ o(l, {
36
- children: "|"
37
- })]
38
- });
39
- })]
40
- })]
41
- })]
42
- });
43
- };
44
- export {
45
- L as default
46
- };
@@ -1,30 +0,0 @@
1
- import { Solution as o, Question as r, Link as u, Condition as i } from "@shelf/icons";
2
- import { jsx as t, Fragment as a } from "react/jsx-runtime";
3
- const s = ({
4
- type: n,
5
- ...e
6
- }) => {
7
- switch (n) {
8
- case "Condition":
9
- return /* @__PURE__ */ t(i, {
10
- ...e
11
- });
12
- case "Link":
13
- return /* @__PURE__ */ t(u, {
14
- ...e
15
- });
16
- case "Question":
17
- return /* @__PURE__ */ t(r, {
18
- ...e
19
- });
20
- case "Solution":
21
- return /* @__PURE__ */ t(o, {
22
- ...e
23
- });
24
- default:
25
- return /* @__PURE__ */ t(a, {});
26
- }
27
- }, d = s;
28
- export {
29
- d as default
30
- };