@shelf/global-renderer 1.0.0 → 1.0.1-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 (57) hide show
  1. package/CHANGELOG.md +2366 -44
  2. package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
  3. package/lib/DecisionTreeContent/DecisionTreeContent.js +84 -0
  4. package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +47 -11483
  5. package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +225 -0
  6. package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
  7. package/lib/DecisionTreeContent/components/Condition.js +73 -0
  8. package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
  9. package/lib/DecisionTreeContent/components/ContentTable.js +26 -0
  10. package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
  11. package/lib/DecisionTreeContent/components/ExportedMeta.js +29 -0
  12. package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
  13. package/lib/DecisionTreeContent/components/Link.js +18 -0
  14. package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
  15. package/lib/DecisionTreeContent/components/Question.js +55 -0
  16. package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
  17. package/lib/DecisionTreeContent/components/Solution.js +20 -0
  18. package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
  19. package/lib/DecisionTreeContent/components/StepHeader.js +46 -0
  20. package/lib/DecisionTreeContent/components/StepTypeIcon.js +30 -0
  21. package/lib/DecisionTreeContent/helpers.d.ts +4 -4
  22. package/lib/DecisionTreeContent/helpers.js +56 -0
  23. package/lib/DecisionTreeContent/renderDTContent.js +12 -0
  24. package/lib/DecisionTreeContent/types.d.ts +1 -1
  25. package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
  26. package/lib/DecisionTreeDiagram/StaticTreeContainer.js +27 -0
  27. package/lib/DecisionTreeDiagram/renderStaticDTDiagram.js +26 -0
  28. package/lib/_virtual/_commonjsHelpers.js +4 -0
  29. package/lib/_virtual/advancedFormat.js +4 -0
  30. package/lib/_virtual/client.js +4 -0
  31. package/lib/_virtual/dayjs.min.js +4 -0
  32. package/lib/_virtual/index.js +4 -0
  33. package/lib/_virtual/index2.js +4 -0
  34. package/lib/_virtual/localeData.js +4 -0
  35. package/lib/_virtual/localizedFormat.js +4 -0
  36. package/lib/_virtual/react-dom.development.js +4 -0
  37. package/lib/_virtual/react-dom.production.min.js +4 -0
  38. package/lib/_virtual/scheduler.development.js +4 -0
  39. package/lib/_virtual/scheduler.production.min.js +4 -0
  40. package/lib/i18next/index.js +18 -0
  41. package/lib/index.js +4 -20383
  42. package/lib/node_modules/@shelf/datetime/lib/getDateFormatTemplates.js +15 -0
  43. package/lib/node_modules/@shelf/datetime/lib/getDateWithCustomFormat.js +10 -0
  44. package/lib/node_modules/@shelf/datetime/lib/getTimeFormatTemplates.js +17 -0
  45. package/lib/node_modules/@shelf/datetime/lib/isDate.js +4 -0
  46. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/dayjs.min.js +295 -0
  47. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/advancedFormat.js +54 -0
  48. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/localeData.js +82 -0
  49. package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/localizedFormat.js +28 -0
  50. package/lib/node_modules/react-dom/cjs/react-dom.development.js +12880 -0
  51. package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +5643 -0
  52. package/lib/node_modules/react-dom/client.js +28 -0
  53. package/lib/node_modules/react-dom/index.js +17 -0
  54. package/lib/node_modules/scheduler/cjs/scheduler.development.js +278 -0
  55. package/lib/node_modules/scheduler/cjs/scheduler.production.min.js +231 -0
  56. package/lib/node_modules/scheduler/index.js +12 -0
  57. package/package.json +16 -19
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { RenderDTContentData } from './types';
3
- declare const DecisionTreeContent: ({ title, description, tree, exportedBy, exportedAt, createdBy, fields, variables, }: RenderDTContentData) => React.JSX.Element;
3
+ declare const DecisionTreeContent: ({ title, description, tree, exportedBy, exportedAt, createdBy, fields, variables, }: RenderDTContentData) => JSX.Element;
4
4
  export default DecisionTreeContent;
@@ -0,0 +1,84 @@
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
+ };