@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.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
  3. package/lib/DecisionTreeContent/DecisionTreeContent.js +68 -63
  4. package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +101 -101
  5. package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
  6. package/lib/DecisionTreeContent/components/Condition.js +43 -39
  7. package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
  8. package/lib/DecisionTreeContent/components/ContentTable.js +29 -24
  9. package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
  10. package/lib/DecisionTreeContent/components/ExportedMeta.js +27 -23
  11. package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
  12. package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
  13. package/lib/DecisionTreeContent/components/Question.js +14 -12
  14. package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
  15. package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
  16. package/lib/DecisionTreeContent/components/StepHeader.js +50 -38
  17. package/lib/DecisionTreeContent/components/StepTypeIcon.js +17 -14
  18. package/lib/DecisionTreeContent/helpers.d.ts +3 -3
  19. package/lib/DecisionTreeContent/helpers.js +17 -17
  20. package/lib/DecisionTreeContent/types.d.ts +1 -1
  21. package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
  22. package/lib/DecisionTreeDiagram/StaticTreeContainer.js +10 -7
  23. package/lib/_virtual/index.js +2 -2
  24. package/lib/_virtual/index2.js +1 -1
  25. package/lib/i18next/index.js +6 -6
  26. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/index.js +25 -0
  27. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/de.js +7 -0
  28. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/en.js +7 -0
  29. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/es.js +7 -0
  30. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/pl.js +7 -0
  31. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/uk.js +7 -0
  32. package/lib/node_modules/@shelf/i18n/lib/helpers.js +19 -0
  33. package/lib/node_modules/@shelf/i18n/lib/resources/de/pdf-viewer/index.json.js +50 -0
  34. package/lib/node_modules/@shelf/i18n/lib/resources/en/pdf-viewer/index.json.js +50 -0
  35. package/lib/node_modules/@shelf/i18n/lib/resources/es/pdf-viewer/index.json.js +50 -0
  36. package/lib/node_modules/@shelf/i18n/lib/resources/pl/pdf-viewer/index.json.js +50 -0
  37. package/lib/node_modules/@shelf/i18n/lib/resources/uk/pdf-viewer/index.json.js +50 -0
  38. package/lib/node_modules/react-dom/cjs/react-dom.development.js +583 -69
  39. package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +81 -83
  40. package/lib/node_modules/react-dom/client.js +3 -5
  41. package/lib/node_modules/react-dom/index.js +17 -15
  42. package/lib/node_modules/scheduler/index.js +6 -8
  43. package/lib/packages/colors/lib/colors.js +12 -0
  44. package/lib/packages/icons/lib/Containers/IconContainer/IconContainer.js +31 -0
  45. package/lib/packages/icons/lib/Icons/Condition.js +14 -0
  46. package/lib/packages/icons/lib/Icons/DecisionTree.js +18 -0
  47. package/lib/packages/icons/lib/Icons/Link.js +13 -0
  48. package/lib/packages/icons/lib/Icons/Question.js +18 -0
  49. package/lib/packages/icons/lib/Icons/Solution.js +14 -0
  50. package/package.json +13 -8
@@ -1,26 +1,31 @@
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
- });
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
- a as default
30
+ y as default
26
31
  };
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  declare const _default: ({ exportedAt, exportedBy, createdBy, }: {
3
- exportedAt: Date;
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 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
- }
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__ */ r(e, {
19
- children: t.t("pdf-viewer.exportDTPDF.createdInfo", {
20
- createdBy: i,
21
- interpolation: {
22
- escapeValue: !1
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
- c as default
32
+ x as default
29
33
  };
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DTStep } from '../types';
3
3
  declare const _default: ({ step }: {
4
4
  step: DTStep;
5
- }) => JSX.Element;
5
+ }) => React.JSX.Element;
6
6
  export default _default;
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
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 M, AssignmentIcon as F, AnswerVariable as L } from "../DecisionTreeContent.styled.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 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 S = "data:image/svg;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAM1BMVEVHcEwqWJYrV5crVpcrV5crV5crV5cqV5grV5cuWJcrV5crVpUrV5crWJcqVpgrVpcrV5f4E2OkAAAAEHRSTlMAIbdw6Nb2T90Ph0KhyTVaZXFVxwAAAPZJREFUOMvFlMsWgyAMRAVRjID6/19bEqW8QTeaTUm54jCT4zB8XYerPvAMFRNWDaVNcaGyL1O+gLLZLsdwf7d/zKx0Ku1sntzw2b0sYLXrBRwJk23XmlZjG+4aHTYZCsLLHdFwqDtA8pRbBcILZrmzYIntKPl6KeT2R3ciALzaiocb6KXF8GpWqGD9YNU5curODGASf++bKF0+SK2B8lMA76P4+smkEkqopMEjG2QbpaGVpw0za6F+8EgHNFCM1fjb6TpKw8LygcxRFaW0hV2CMhEPXviOBDWp8dwrj1GdxUkR69e+LrdQsWDVKNoUzz/Fd9Gv6weN4h7TPdxgMQAAAABJRU5ErkJggg==", K = ({
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__ */ r(w, {
30
+ }), t?.nextStep?.number && /* @__PURE__ */ e(w, {
31
31
  href: `#${t.nextStep?.id}`,
32
- children: [d.t("pdf-viewer.exportDTPDF.step"), " ", t.nextStep.number]
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, p) => {
35
- const i = a?.find((m) => m.id === A.variableId), l = i?.isDeleted;
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(M, {
38
- children: /* @__PURE__ */ e(F, {
39
- src: S
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
- }, p) : null;
50
+ }, m) : null;
49
51
  })]
50
52
  }, c))]
51
53
  })]
52
54
  });
53
55
  export {
54
- K as default
56
+ W as default
55
57
  };
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DTStep } from '../types';
3
3
  declare const _default: ({ step }: {
4
4
  step: DTStep;
5
- }) => JSX.Element;
5
+ }) => React.JSX.Element;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DTStep } from '../types';
3
3
  declare const _default: ({ step }: {
4
4
  step: DTStep;
5
- }) => JSX.Element;
5
+ }) => React.JSX.Element;
6
6
  export default _default;
@@ -1,46 +1,58 @@
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
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 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
- });
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
- L as default
57
+ j as default
46
58
  };
@@ -1,30 +1,33 @@
1
- import { Solution as o, Question as r, Link as u, Condition as i } from "@shelf/icons";
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 s = ({
4
- type: n,
5
- ...e
6
+ const i = ({
7
+ type: e,
8
+ ...r
6
9
  }) => {
7
- switch (n) {
10
+ switch (e) {
8
11
  case "Condition":
9
- return /* @__PURE__ */ t(i, {
10
- ...e
12
+ return /* @__PURE__ */ t(o, {
13
+ ...r
11
14
  });
12
15
  case "Link":
13
- return /* @__PURE__ */ t(u, {
14
- ...e
16
+ return /* @__PURE__ */ t(n, {
17
+ ...r
15
18
  });
16
19
  case "Question":
17
- return /* @__PURE__ */ t(r, {
18
- ...e
20
+ return /* @__PURE__ */ t(m, {
21
+ ...r
19
22
  });
20
23
  case "Solution":
21
- return /* @__PURE__ */ t(o, {
22
- ...e
24
+ return /* @__PURE__ */ t(u, {
25
+ ...r
23
26
  });
24
27
  default:
25
28
  return /* @__PURE__ */ t(a, {});
26
29
  }
27
- }, d = s;
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
- type: import("@shelf/types-ddb/lib/decision-tree").StepType;
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: Date) => string;
44
+ export declare const getDateAndTime: (date: string) => string;
@@ -1,22 +1,22 @@
1
- import { isEmpty as d, mapKeys as c, compact as x, uniq as l, sortBy as f } from "lodash";
2
- import { getDateFormatTemplates as b, getTimeFormatTemplates as T, getDateWithCustomFormat as y } from "@shelf/datetime";
3
- const g = ["Question", "Condition"], F = (r) => r.map((i) => {
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 = l(m.map(({ id: n, number: o }) => ({ id: n, number: o })));
6
+ ), s = g(m.map(({ id: n, number: o }) => ({ id: n, number: o })));
7
7
  return {
8
8
  ...i,
9
- parentSteps: f(s, "number")
9
+ parentSteps: y(s, "number")
10
10
  };
11
- }), k = (r) => {
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 = c(s, "id"), o = s.map((t) => {
17
+ })), n = T(s, "id"), o = s.map((t) => {
18
18
  const p = t?.question?.answers, a = t?.conditions;
19
- if (!g.includes(t?.type) || d(p) && d(a))
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: x(u?.map((e) => e.nextStep)),
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 F(o);
42
- }, q = (r) => {
43
- const i = b()?.medium ?? "MMM d, yyyy", m = T()?.short ?? "h:m a";
44
- return y({
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
- g as TYPES_TO_LINK,
51
- k as convertStepToRenderFormat,
52
- q as getDateAndTime,
53
- F as getTreeWithParentSteps
50
+ F as TYPES_TO_LINK,
51
+ q as convertStepToRenderFormat,
52
+ C as getDateAndTime,
53
+ N as getTreeWithParentSteps
54
54
  };
@@ -9,7 +9,7 @@ export type RenderDTContentData = {
9
9
  title: string;
10
10
  description: string;
11
11
  language: L10n.LanguageCode;
12
- exportedAt: Date;
12
+ exportedAt: string;
13
13
  exportedBy: string;
14
14
  createdBy: string;
15
15
  fields?: {
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
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 /* @__PURE__ */ e(n, {
17
- i18n: t,
18
- children: /* @__PURE__ */ e(a, {
19
- tree: r,
20
- ...i,
21
- variables: o
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
@@ -1,4 +1,4 @@
1
- var r = { exports: {} };
1
+ var e = { exports: {} };
2
2
  export {
3
- r
3
+ e as __module
4
4
  };
@@ -1,4 +1,4 @@
1
1
  var e = { exports: {} };
2
2
  export {
3
- e as s
3
+ e as __module
4
4
  };
@@ -1,16 +1,16 @@
1
- import { resources as n } from "@shelf/i18n/lib/bundles/pdf-viewer/index.js";
2
- import { initReactI18next as e } from "react-i18next";
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 "@shelf/i18n";
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: n,
8
+ resources: e,
9
9
  fallbackLng: "en",
10
10
  interpolation: i,
11
- missingKeyHandler: () => "\u26D4\uFE0F"
11
+ missingKeyHandler: () => "⛔️"
12
12
  });
13
- t.use(e);
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,7 @@
1
+ import e from "../../../resources/de/pdf-viewer/index.json.js";
2
+ const d = {
3
+ "pdf-viewer": e
4
+ };
5
+ export {
6
+ d as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../../../resources/en/pdf-viewer/index.json.js";
2
+ const f = {
3
+ "pdf-viewer": e
4
+ };
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../../../resources/es/pdf-viewer/index.json.js";
2
+ const f = {
3
+ "pdf-viewer": e
4
+ };
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../../../resources/pl/pdf-viewer/index.json.js";
2
+ const r = {
3
+ "pdf-viewer": e
4
+ };
5
+ export {
6
+ r as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../../../resources/uk/pdf-viewer/index.json.js";
2
+ const f = {
3
+ "pdf-viewer": e
4
+ };
5
+ export {
6
+ f as default
7
+ };
@@ -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
+ };