@shelf/global-renderer 1.0.3-beta.1 → 1.0.4-beta.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 +15 -0
- package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
- package/lib/DecisionTreeContent/DecisionTreeContent.js +68 -63
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +101 -101
- package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Condition.js +43 -39
- package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
- package/lib/DecisionTreeContent/components/ContentTable.js +29 -24
- package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
- package/lib/DecisionTreeContent/components/ExportedMeta.js +27 -23
- package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Question.js +14 -12
- package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
- package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
- package/lib/DecisionTreeContent/components/StepHeader.js +50 -38
- package/lib/DecisionTreeContent/components/StepTypeIcon.js +17 -14
- package/lib/DecisionTreeContent/helpers.d.ts +3 -3
- package/lib/DecisionTreeContent/helpers.js +17 -17
- package/lib/DecisionTreeContent/types.d.ts +1 -1
- package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
- package/lib/DecisionTreeDiagram/StaticTreeContainer.js +10 -7
- package/lib/_virtual/index.js +2 -2
- package/lib/_virtual/index2.js +1 -1
- package/lib/i18next/index.js +6 -6
- package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/index.js +25 -0
- package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/de.js +7 -0
- package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/en.js +7 -0
- package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/es.js +7 -0
- package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/pl.js +7 -0
- package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/uk.js +7 -0
- package/lib/node_modules/@shelf/i18n/lib/helpers.js +19 -0
- package/lib/node_modules/@shelf/i18n/lib/resources/de/pdf-viewer/index.json.js +50 -0
- package/lib/node_modules/@shelf/i18n/lib/resources/en/pdf-viewer/index.json.js +50 -0
- package/lib/node_modules/@shelf/i18n/lib/resources/es/pdf-viewer/index.json.js +50 -0
- package/lib/node_modules/@shelf/i18n/lib/resources/pl/pdf-viewer/index.json.js +50 -0
- package/lib/node_modules/@shelf/i18n/lib/resources/uk/pdf-viewer/index.json.js +50 -0
- package/lib/node_modules/react-dom/cjs/react-dom.development.js +583 -69
- package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +81 -83
- package/lib/node_modules/react-dom/client.js +3 -5
- package/lib/node_modules/react-dom/index.js +17 -15
- package/lib/node_modules/scheduler/index.js +6 -8
- package/lib/packages/colors/lib/colors.js +12 -0
- package/lib/packages/icons/lib/Containers/IconContainer/IconContainer.js +31 -0
- package/lib/packages/icons/lib/Icons/Condition.js +14 -0
- package/lib/packages/icons/lib/Icons/DecisionTree.js +18 -0
- package/lib/packages/icons/lib/Icons/Link.js +13 -0
- package/lib/packages/icons/lib/Icons/Question.js +18 -0
- package/lib/packages/icons/lib/Icons/Solution.js +14 -0
- package/package.json +13 -8
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { ContentList as
|
|
4
|
-
import
|
|
5
|
-
import { jsx as
|
|
6
|
-
const
|
|
7
|
-
tree:
|
|
8
|
-
}) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
1
|
+
import { $deepBlue as i } from "../../packages/colors/lib/colors.js";
|
|
2
|
+
import p from "lodash";
|
|
3
|
+
import { ContentList as s, ContentListItem as c, ContentListNumber as l, ContentListIcon as m, ContentListLink as d } from "../DecisionTreeContent.styled.js";
|
|
4
|
+
import f from "./StepTypeIcon.js";
|
|
5
|
+
import { jsx as n, jsxs as e } from "react/jsx-runtime";
|
|
6
|
+
const y = ({
|
|
7
|
+
tree: o
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
isEmpty: r
|
|
11
|
+
} = p;
|
|
12
|
+
return /* @__PURE__ */ n(s, {
|
|
13
|
+
children: !r(o) && o.map((t) => /* @__PURE__ */ e(c, {
|
|
14
|
+
children: [/* @__PURE__ */ e(l, {
|
|
15
|
+
children: [t.number, "."]
|
|
16
|
+
}), /* @__PURE__ */ n(m, {
|
|
17
|
+
children: /* @__PURE__ */ n(f, {
|
|
18
|
+
type: t.type,
|
|
19
|
+
iconSize: 12,
|
|
20
|
+
color: i
|
|
21
|
+
})
|
|
22
|
+
}), /* @__PURE__ */ n(d, {
|
|
23
|
+
href: `#${t.id}`,
|
|
24
|
+
children: t.title || t?.question?.title
|
|
25
|
+
})]
|
|
26
|
+
}, t.id))
|
|
27
|
+
});
|
|
28
|
+
};
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
y as default
|
|
26
31
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
declare const _default: ({ exportedAt, exportedBy, createdBy, }: {
|
|
3
|
-
exportedAt:
|
|
3
|
+
exportedAt: string;
|
|
4
4
|
exportedBy: string;
|
|
5
5
|
createdBy: string;
|
|
6
|
-
}) => JSX.Element;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
7
|
export default _default;
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { MetaBlock as p, MataInfo as
|
|
2
|
-
import { getDateAndTime as
|
|
3
|
-
import
|
|
4
|
-
import { jsxs as
|
|
5
|
-
const
|
|
6
|
-
exportedAt:
|
|
7
|
-
exportedBy:
|
|
8
|
-
createdBy:
|
|
9
|
-
}) => /* @__PURE__ */
|
|
10
|
-
children: [/* @__PURE__ */
|
|
11
|
-
children:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { MetaBlock as p, MataInfo as t } from "../DecisionTreeContent.styled.js";
|
|
2
|
+
import { getDateAndTime as d } from "../helpers.js";
|
|
3
|
+
import r from "../../i18next/index.js";
|
|
4
|
+
import { jsxs as l, jsx as e, Fragment as o } from "react/jsx-runtime";
|
|
5
|
+
const x = ({
|
|
6
|
+
exportedAt: a,
|
|
7
|
+
exportedBy: i,
|
|
8
|
+
createdBy: n
|
|
9
|
+
}) => /* @__PURE__ */ l(p, {
|
|
10
|
+
children: [/* @__PURE__ */ e(t, {
|
|
11
|
+
children: /* @__PURE__ */ e(o, {
|
|
12
|
+
children: r.t("pdf-viewer.exportDTPDF.exportedInfo", {
|
|
13
|
+
date: d(a),
|
|
14
|
+
exportedBy: i,
|
|
15
|
+
interpolation: {
|
|
16
|
+
escapeValue: !1
|
|
17
|
+
}
|
|
18
|
+
})
|
|
17
19
|
})
|
|
18
|
-
}), /* @__PURE__ */
|
|
19
|
-
children:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
}), /* @__PURE__ */ e(t, {
|
|
21
|
+
children: /* @__PURE__ */ e(o, {
|
|
22
|
+
children: r.t("pdf-viewer.exportDTPDF.createdInfo", {
|
|
23
|
+
createdBy: n,
|
|
24
|
+
interpolation: {
|
|
25
|
+
escapeValue: !1
|
|
26
|
+
}
|
|
27
|
+
})
|
|
24
28
|
})
|
|
25
29
|
})]
|
|
26
30
|
});
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
x as default
|
|
29
33
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
3
|
import { DTStep } from '../types';
|
|
4
4
|
declare const _default: ({ step, variables, }: {
|
|
5
5
|
step: DTStep;
|
|
6
6
|
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
7
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
8
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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
|
|
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 F, AssignmentIcon as M, AnswerVariable as L } from "../DecisionTreeContent.styled.js";
|
|
3
3
|
import d from "../../i18next/index.js";
|
|
4
|
-
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
5
|
-
const
|
|
4
|
+
import { jsxs as r, jsx as e, Fragment as S } from "react/jsx-runtime";
|
|
5
|
+
const v = "data:image/svg;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAM1BMVEVHcEwqWJYrV5crVpcrV5crV5crV5cqV5grV5cuWJcrV5crVpUrV5crWJcqVpgrVpcrV5f4E2OkAAAAEHRSTlMAIbdw6Nb2T90Ph0KhyTVaZXFVxwAAAPZJREFUOMvFlMsWgyAMRAVRjID6/19bEqW8QTeaTUm54jCT4zB8XYerPvAMFRNWDaVNcaGyL1O+gLLZLsdwf7d/zKx0Ku1sntzw2b0sYLXrBRwJk23XmlZjG+4aHTYZCsLLHdFwqDtA8pRbBcILZrmzYIntKPl6KeT2R3ciALzaiocb6KXF8GpWqGD9YNU5curODGASf++bKF0+SK2B8lMA76P4+smkEkqopMEjG2QbpaGVpw0za6F+8EgHNFCM1fjb6TpKw8LygcxRFaW0hV2CMhEPXviOBDWp8dwrj1GdxUkR69e+LrdQsWDVKNoUzz/Fd9Gv6weN4h7TPdxgMQAAAABJRU5ErkJggg==", W = ({
|
|
6
6
|
step: n,
|
|
7
7
|
variables: a
|
|
8
8
|
}) => /* @__PURE__ */ r(V, {
|
|
@@ -27,16 +27,18 @@ const S = "data:image/svg;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAA
|
|
|
27
27
|
}), /* @__PURE__ */ e(s, {
|
|
28
28
|
href: `#${t.nextStep?.id}`,
|
|
29
29
|
children: t?.title
|
|
30
|
-
}), t?.nextStep?.number && /* @__PURE__ */
|
|
30
|
+
}), t?.nextStep?.number && /* @__PURE__ */ e(w, {
|
|
31
31
|
href: `#${t.nextStep?.id}`,
|
|
32
|
-
children:
|
|
32
|
+
children: /* @__PURE__ */ r(S, {
|
|
33
|
+
children: [d.t("pdf-viewer.exportDTPDF.step"), " ", t.nextStep.number]
|
|
34
|
+
})
|
|
33
35
|
})]
|
|
34
|
-
}), t?.assignments && t?.assignments.map((A,
|
|
35
|
-
const i = a?.find((
|
|
36
|
+
}), t?.assignments && t?.assignments.map((A, m) => {
|
|
37
|
+
const i = a?.find((p) => p.id === A.variableId), l = i?.isDeleted;
|
|
36
38
|
return i ? /* @__PURE__ */ r(o, {
|
|
37
|
-
children: [/* @__PURE__ */ e(
|
|
38
|
-
children: /* @__PURE__ */ e(
|
|
39
|
-
src:
|
|
39
|
+
children: [/* @__PURE__ */ e(F, {
|
|
40
|
+
children: /* @__PURE__ */ e(M, {
|
|
41
|
+
src: v
|
|
40
42
|
})
|
|
41
43
|
}), /* @__PURE__ */ r(s, {
|
|
42
44
|
href: `#${t.nextStep?.id}`,
|
|
@@ -45,11 +47,11 @@ const S = "data:image/svg;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAA
|
|
|
45
47
|
children: i?.name
|
|
46
48
|
}), l ? ` (${d.t("pdf-viewer.exportDTPDF.deleted")})` : "", " =", ` ${A.value}`]
|
|
47
49
|
})]
|
|
48
|
-
},
|
|
50
|
+
}, m) : null;
|
|
49
51
|
})]
|
|
50
52
|
}, c))]
|
|
51
53
|
})]
|
|
52
54
|
});
|
|
53
55
|
export {
|
|
54
|
-
|
|
56
|
+
W as default
|
|
55
57
|
};
|
|
@@ -1,46 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { StepHeaderBlock as
|
|
4
|
-
import
|
|
5
|
-
import { jsxs as
|
|
6
|
-
const
|
|
7
|
-
question:
|
|
8
|
-
solution:
|
|
9
|
-
link:
|
|
10
|
-
condition:
|
|
11
|
-
},
|
|
12
|
-
step:
|
|
1
|
+
import { $catchyBlue as h, $dark as m, $yellow as S, $greenCheck as f } from "../../packages/colors/lib/colors.js";
|
|
2
|
+
import u from "lodash";
|
|
3
|
+
import { StepHeaderBlock as D, StepNumber as T, StepTypeContainer as x, StepHeader as y, StepType as P, StepTypeTitle as $, NoLinks as k, StepParents as w, ParentLink as F } from "../DecisionTreeContent.styled.js";
|
|
4
|
+
import i from "../../i18next/index.js";
|
|
5
|
+
import { jsxs as t, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
6
|
+
const g = {
|
|
7
|
+
question: h,
|
|
8
|
+
solution: m,
|
|
9
|
+
link: S,
|
|
10
|
+
condition: f
|
|
11
|
+
}, j = ({
|
|
12
|
+
step: r
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
href: `#${p.id}`,
|
|
34
|
-
children: p.number
|
|
35
|
-
}, d), !s && /* @__PURE__ */ o(l, {
|
|
36
|
-
children: "|"
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
14
|
+
const {
|
|
15
|
+
get: l,
|
|
16
|
+
isEmpty: c,
|
|
17
|
+
toLower: s
|
|
18
|
+
} = u, o = s(r.type);
|
|
19
|
+
return /* @__PURE__ */ t(D, {
|
|
20
|
+
id: r.id,
|
|
21
|
+
children: [/* @__PURE__ */ e(T, {
|
|
22
|
+
children: /* @__PURE__ */ t(n, {
|
|
23
|
+
children: [i.t("pdf-viewer.exportDTPDF.step"), " ", r.number, r.isFirstStep ? ` - ${i.t("pdf-viewer.exportDTPDF.startingPoint")}` : ""]
|
|
24
|
+
})
|
|
25
|
+
}), /* @__PURE__ */ t(x, {
|
|
26
|
+
children: [/* @__PURE__ */ t(y, {
|
|
27
|
+
children: [/* @__PURE__ */ e(P, {
|
|
28
|
+
color: r?.settings?.borderColor || l(g, o)
|
|
29
|
+
}), /* @__PURE__ */ e($, {
|
|
30
|
+
children: /* @__PURE__ */ e(n, {
|
|
31
|
+
children: i.t(`pdf-viewer.exportDTPDF.${o}`)
|
|
32
|
+
})
|
|
39
33
|
})]
|
|
34
|
+
}), c(r.parentSteps) ? /* @__PURE__ */ e(k, {
|
|
35
|
+
children: /* @__PURE__ */ e(n, {
|
|
36
|
+
children: i.t("pdf-viewer.exportDTPDF.noLinks")
|
|
37
|
+
})
|
|
38
|
+
}) : /* @__PURE__ */ e(w, {
|
|
39
|
+
children: /* @__PURE__ */ t(n, {
|
|
40
|
+
children: [i.t("pdf-viewer.exportDTPDF.parentSteps"), ":", r.parentSteps.map((p, d) => {
|
|
41
|
+
const a = d === r.parentSteps.length - 1;
|
|
42
|
+
return /* @__PURE__ */ t(n, {
|
|
43
|
+
children: [/* @__PURE__ */ e(F, {
|
|
44
|
+
href: `#${p.id}`,
|
|
45
|
+
children: p.number
|
|
46
|
+
}, d), !a && /* @__PURE__ */ e(n, {
|
|
47
|
+
children: "|"
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
40
52
|
})]
|
|
41
53
|
})]
|
|
42
54
|
});
|
|
43
55
|
};
|
|
44
56
|
export {
|
|
45
|
-
|
|
57
|
+
j as default
|
|
46
58
|
};
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "../../packages/icons/lib/Icons/Condition.js";
|
|
2
|
+
import n from "../../packages/icons/lib/Icons/Link.js";
|
|
3
|
+
import m from "../../packages/icons/lib/Icons/Question.js";
|
|
4
|
+
import u from "../../packages/icons/lib/Icons/Solution.js";
|
|
2
5
|
import { jsx as t, Fragment as a } from "react/jsx-runtime";
|
|
3
|
-
const
|
|
4
|
-
type:
|
|
5
|
-
...
|
|
6
|
+
const i = ({
|
|
7
|
+
type: e,
|
|
8
|
+
...r
|
|
6
9
|
}) => {
|
|
7
|
-
switch (
|
|
10
|
+
switch (e) {
|
|
8
11
|
case "Condition":
|
|
9
|
-
return /* @__PURE__ */ t(
|
|
10
|
-
...
|
|
12
|
+
return /* @__PURE__ */ t(o, {
|
|
13
|
+
...r
|
|
11
14
|
});
|
|
12
15
|
case "Link":
|
|
13
|
-
return /* @__PURE__ */ t(
|
|
14
|
-
...
|
|
16
|
+
return /* @__PURE__ */ t(n, {
|
|
17
|
+
...r
|
|
15
18
|
});
|
|
16
19
|
case "Question":
|
|
17
|
-
return /* @__PURE__ */ t(
|
|
18
|
-
...
|
|
20
|
+
return /* @__PURE__ */ t(m, {
|
|
21
|
+
...r
|
|
19
22
|
});
|
|
20
23
|
case "Solution":
|
|
21
|
-
return /* @__PURE__ */ t(
|
|
22
|
-
...
|
|
24
|
+
return /* @__PURE__ */ t(u, {
|
|
25
|
+
...r
|
|
23
26
|
});
|
|
24
27
|
default:
|
|
25
28
|
return /* @__PURE__ */ t(a, {});
|
|
26
29
|
}
|
|
27
|
-
}, d =
|
|
30
|
+
}, d = i;
|
|
28
31
|
export {
|
|
29
32
|
d as default
|
|
30
33
|
};
|
|
@@ -6,9 +6,10 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
6
6
|
number: number;
|
|
7
7
|
}[];
|
|
8
8
|
number: number;
|
|
9
|
+
type: import("@shelf/types-ddb/lib/decision-tree").StepType;
|
|
9
10
|
title?: string | undefined;
|
|
10
11
|
id: string;
|
|
11
|
-
|
|
12
|
+
content?: string | undefined;
|
|
12
13
|
question: {
|
|
13
14
|
id: string;
|
|
14
15
|
title?: string | undefined;
|
|
@@ -34,11 +35,10 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
34
35
|
}) | undefined;
|
|
35
36
|
conditions?: (import("@shelf/types-ddb/lib/decision-tree").Condition[] & import("./types").ConditionType[]) | undefined;
|
|
36
37
|
isFirstStep?: boolean | undefined;
|
|
37
|
-
content?: string | undefined;
|
|
38
38
|
linkedSteps?: {
|
|
39
39
|
id?: string | undefined;
|
|
40
40
|
number?: number | undefined;
|
|
41
41
|
}[] | undefined;
|
|
42
42
|
}[];
|
|
43
43
|
export declare const convertStepToRenderFormat: (tree: DTStepFromApi[]) => DTStep[];
|
|
44
|
-
export declare const getDateAndTime: (date:
|
|
44
|
+
export declare const getDateAndTime: (date: string) => string;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getDateFormatTemplates as
|
|
3
|
-
const g = ["Question", "Condition"],
|
|
1
|
+
import c from "lodash";
|
|
2
|
+
import { getDateFormatTemplates as x, getTimeFormatTemplates as l, getDateWithCustomFormat as f } from "@shelf/datetime";
|
|
3
|
+
const { compact: b, isEmpty: d, mapKeys: T, sortBy: y, uniq: g } = c, F = ["Question", "Condition"], N = (r) => r.map((i) => {
|
|
4
4
|
const m = r.filter(
|
|
5
5
|
(n) => n.linkedSteps?.map((o) => o.id).includes(i.id)
|
|
6
|
-
), s =
|
|
6
|
+
), s = g(m.map(({ id: n, number: o }) => ({ id: n, number: o })));
|
|
7
7
|
return {
|
|
8
8
|
...i,
|
|
9
|
-
parentSteps:
|
|
9
|
+
parentSteps: y(s, "number")
|
|
10
10
|
};
|
|
11
|
-
}),
|
|
11
|
+
}), q = (r) => {
|
|
12
12
|
if (d(r))
|
|
13
13
|
return [];
|
|
14
14
|
const i = r.find(({ isFirstStep: t }) => !!t), s = (i ? [i, ...r.filter(({ isFirstStep: t }) => !t)] : [...r]).map((t, p) => ({
|
|
15
15
|
...t,
|
|
16
16
|
number: p + 1
|
|
17
|
-
})), n =
|
|
17
|
+
})), n = T(s, "id"), o = s.map((t) => {
|
|
18
18
|
const p = t?.question?.answers, a = t?.conditions;
|
|
19
|
-
if (!
|
|
19
|
+
if (!F.includes(t?.type) || d(p) && d(a))
|
|
20
20
|
return t;
|
|
21
21
|
const u = p?.map((e) => ({
|
|
22
22
|
...e,
|
|
@@ -28,7 +28,7 @@ const g = ["Question", "Condition"], F = (r) => r.map((i) => {
|
|
|
28
28
|
return {
|
|
29
29
|
...t,
|
|
30
30
|
question: { ...t.question, answers: u },
|
|
31
|
-
linkedSteps:
|
|
31
|
+
linkedSteps: b(u?.map((e) => e.nextStep)),
|
|
32
32
|
...a ? { conditions: S } : {},
|
|
33
33
|
...t.defaultNextStep && n[t.defaultNextStep?.id] ? {
|
|
34
34
|
defaultNextStep: {
|
|
@@ -38,17 +38,17 @@ const g = ["Question", "Condition"], F = (r) => r.map((i) => {
|
|
|
38
38
|
} : {}
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
return
|
|
42
|
-
},
|
|
43
|
-
const i =
|
|
44
|
-
return
|
|
41
|
+
return N(o);
|
|
42
|
+
}, C = (r) => {
|
|
43
|
+
const i = x()?.medium ?? "MMM d, yyyy", m = l()?.short ?? "h:m a";
|
|
44
|
+
return f({
|
|
45
45
|
date: r,
|
|
46
46
|
dateFormat: `${i} ${m}`
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
F as TYPES_TO_LINK,
|
|
51
|
+
q as convertStepToRenderFormat,
|
|
52
|
+
C as getDateAndTime,
|
|
53
|
+
N as getTreeWithParentSteps
|
|
54
54
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
3
|
declare const StaticTreeContainer: ({ tree, variables, }: {
|
|
4
4
|
tree: DecisionTree.Step[];
|
|
5
5
|
variables: DecisionTree.ContextualVariableDefaults[];
|
|
6
|
-
}) => JSX.Element;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
7
|
export default StaticTreeContainer;
|
|
@@ -13,14 +13,17 @@ const p = ({
|
|
|
13
13
|
andOperator: t.t("pdf-viewer.exportDTPDF.andOperator"),
|
|
14
14
|
orOperator: t.t("pdf-viewer.exportDTPDF.orOperator")
|
|
15
15
|
};
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
return (
|
|
17
|
+
// @ts-expect-error: TODO: upgrade i18n
|
|
18
|
+
/* @__PURE__ */ e(n, {
|
|
19
|
+
i18n: t,
|
|
20
|
+
children: /* @__PURE__ */ e(a, {
|
|
21
|
+
tree: r,
|
|
22
|
+
...i,
|
|
23
|
+
variables: o
|
|
24
|
+
})
|
|
22
25
|
})
|
|
23
|
-
|
|
26
|
+
);
|
|
24
27
|
}, s = p;
|
|
25
28
|
export {
|
|
26
29
|
s as default
|
package/lib/_virtual/index.js
CHANGED
package/lib/_virtual/index2.js
CHANGED
package/lib/i18next/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { resources as
|
|
2
|
-
import { initReactI18next as
|
|
1
|
+
import { resources as e } from "../node_modules/@shelf/i18n/lib/bundles/pdf-viewer/index.js";
|
|
2
|
+
import { initReactI18next as n } from "react-i18next";
|
|
3
3
|
import r from "i18next";
|
|
4
|
-
import { defaultInterpolation as i } from "
|
|
4
|
+
import { defaultInterpolation as i } from "../node_modules/@shelf/i18n/lib/helpers.js";
|
|
5
5
|
const t = r.createInstance();
|
|
6
6
|
t.init({
|
|
7
7
|
lng: "en",
|
|
8
|
-
resources:
|
|
8
|
+
resources: e,
|
|
9
9
|
fallbackLng: "en",
|
|
10
10
|
interpolation: i,
|
|
11
|
-
missingKeyHandler: () => "
|
|
11
|
+
missingKeyHandler: () => "⛔️"
|
|
12
12
|
});
|
|
13
|
-
t.use(
|
|
13
|
+
t.use(n);
|
|
14
14
|
const l = t;
|
|
15
15
|
export {
|
|
16
16
|
l as default,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import o from "./translations/de.js";
|
|
2
|
+
import r from "./translations/en.js";
|
|
3
|
+
import t from "./translations/es.js";
|
|
4
|
+
import n from "./translations/pl.js";
|
|
5
|
+
import a from "./translations/uk.js";
|
|
6
|
+
const l = {
|
|
7
|
+
de: {
|
|
8
|
+
translation: o
|
|
9
|
+
},
|
|
10
|
+
en: {
|
|
11
|
+
translation: r
|
|
12
|
+
},
|
|
13
|
+
es: {
|
|
14
|
+
translation: t
|
|
15
|
+
},
|
|
16
|
+
pl: {
|
|
17
|
+
translation: n
|
|
18
|
+
},
|
|
19
|
+
uk: {
|
|
20
|
+
translation: a
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
l as resources
|
|
25
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { setGlobalLocale as o, format as e } from "@shelf/datetime";
|
|
2
|
+
const p = {
|
|
3
|
+
format(r, t, i = "en") {
|
|
4
|
+
if (o(i), r === void 0)
|
|
5
|
+
return r;
|
|
6
|
+
if (t === "uppercase")
|
|
7
|
+
return r.toUpperCase();
|
|
8
|
+
if (t === "lowercase")
|
|
9
|
+
return r.toLowerCase();
|
|
10
|
+
if (t === "capitalize") {
|
|
11
|
+
const n = r.charAt(0).toUpperCase(), s = r.slice(1);
|
|
12
|
+
return n + s;
|
|
13
|
+
}
|
|
14
|
+
return t === "bold" ? `<b>${r}</b>` : t === "italic" ? `<i>${r}</i>` : t === "datetime" ? e(r, "MMMM D, YYYY h:mm A") : t === "datetimeUTC" ? `${e(r, "MMMM D, YYYY H:mm")} (UTC)` : t === "numeral" ? Number(r).toLocaleString("en-US") : t === "emphatic" ? `<em>${r}</em>` : t === "strong" ? `<strong>${r}</strong>` : r;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
p as defaultInterpolation
|
|
19
|
+
};
|