@shelf/global-renderer 1.0.2-beta.0 → 1.0.2
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 +45 -2383
- package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +11483 -47
- package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
- package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
- package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
- package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
- package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
- package/lib/DecisionTreeContent/helpers.d.ts +4 -4
- package/lib/DecisionTreeContent/types.d.ts +1 -1
- package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
- package/lib/index.js +20383 -4
- package/package.json +22 -17
- package/lib/DecisionTreeContent/DecisionTreeContent.js +0 -84
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +0 -225
- package/lib/DecisionTreeContent/components/Condition.js +0 -73
- package/lib/DecisionTreeContent/components/ContentTable.js +0 -26
- package/lib/DecisionTreeContent/components/ExportedMeta.js +0 -29
- package/lib/DecisionTreeContent/components/Link.js +0 -18
- package/lib/DecisionTreeContent/components/Question.js +0 -55
- package/lib/DecisionTreeContent/components/Solution.js +0 -20
- package/lib/DecisionTreeContent/components/StepHeader.js +0 -46
- package/lib/DecisionTreeContent/components/StepTypeIcon.js +0 -30
- package/lib/DecisionTreeContent/helpers.js +0 -54
- package/lib/DecisionTreeContent/renderDTContent.js +0 -12
- package/lib/DecisionTreeDiagram/StaticTreeContainer.js +0 -27
- package/lib/DecisionTreeDiagram/renderStaticDTDiagram.js +0 -26
- package/lib/_virtual/client.js +0 -4
- package/lib/_virtual/index.js +0 -4
- package/lib/_virtual/index2.js +0 -4
- package/lib/_virtual/react-dom.development.js +0 -4
- package/lib/_virtual/react-dom.production.min.js +0 -4
- package/lib/_virtual/scheduler.development.js +0 -4
- package/lib/_virtual/scheduler.production.min.js +0 -4
- package/lib/i18next/index.js +0 -18
- package/lib/node_modules/react-dom/cjs/react-dom.development.js +0 -12880
- package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +0 -5643
- package/lib/node_modules/react-dom/client.js +0 -28
- package/lib/node_modules/react-dom/index.js +0 -17
- package/lib/node_modules/scheduler/cjs/scheduler.development.js +0 -278
- package/lib/node_modules/scheduler/cjs/scheduler.production.min.js +0 -231
- package/lib/node_modules/scheduler/index.js +0 -12
|
@@ -1,54 +0,0 @@
|
|
|
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) => {
|
|
4
|
-
const m = r.filter(
|
|
5
|
-
(n) => n.linkedSteps?.map((o) => o.id).includes(i.id)
|
|
6
|
-
), s = l(m.map(({ id: n, number: o }) => ({ id: n, number: o })));
|
|
7
|
-
return {
|
|
8
|
-
...i,
|
|
9
|
-
parentSteps: f(s, "number")
|
|
10
|
-
};
|
|
11
|
-
}), k = (r) => {
|
|
12
|
-
if (d(r))
|
|
13
|
-
return [];
|
|
14
|
-
const i = r.find(({ isFirstStep: t }) => !!t), s = (i ? [i, ...r.filter(({ isFirstStep: t }) => !t)] : [...r]).map((t, p) => ({
|
|
15
|
-
...t,
|
|
16
|
-
number: p + 1
|
|
17
|
-
})), n = c(s, "id"), o = s.map((t) => {
|
|
18
|
-
const p = t?.question?.answers, a = t?.conditions;
|
|
19
|
-
if (!g.includes(t?.type) || d(p) && d(a))
|
|
20
|
-
return t;
|
|
21
|
-
const u = p?.map((e) => ({
|
|
22
|
-
...e,
|
|
23
|
-
nextStep: e?.nextStep?.id && n[e.nextStep.id] ? { ...e.nextStep, number: n[e.nextStep.id]?.number } : e.nextStep
|
|
24
|
-
})), S = a?.map((e) => ({
|
|
25
|
-
...e,
|
|
26
|
-
nextStep: e?.nextStep?.id && n[e.nextStep.id] ? { ...e.nextStep, number: n[e.nextStep.id]?.number } : e.nextStep
|
|
27
|
-
}));
|
|
28
|
-
return {
|
|
29
|
-
...t,
|
|
30
|
-
question: { ...t.question, answers: u },
|
|
31
|
-
linkedSteps: x(u?.map((e) => e.nextStep)),
|
|
32
|
-
...a ? { conditions: S } : {},
|
|
33
|
-
...t.defaultNextStep && n[t.defaultNextStep?.id] ? {
|
|
34
|
-
defaultNextStep: {
|
|
35
|
-
...t.defaultNextStep,
|
|
36
|
-
number: n[t.defaultNextStep.id]?.number
|
|
37
|
-
}
|
|
38
|
-
} : {}
|
|
39
|
-
};
|
|
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({
|
|
45
|
-
date: r,
|
|
46
|
-
dateFormat: `${i} ${m}`
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
g as TYPES_TO_LINK,
|
|
51
|
-
k as convertStepToRenderFormat,
|
|
52
|
-
q as getDateAndTime,
|
|
53
|
-
F as getTreeWithParentSteps
|
|
54
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import t from "react";
|
|
2
|
-
import "../node_modules/react-dom/client.js";
|
|
3
|
-
import n from "./DecisionTreeContent.js";
|
|
4
|
-
import i from "../i18next/index.js";
|
|
5
|
-
import { __exports as m } from "../_virtual/client.js";
|
|
6
|
-
const u = (e, o = "#root") => {
|
|
7
|
-
const r = document.querySelector(o);
|
|
8
|
-
e.language && i.changeLanguage(e.language), m.createRoot(r).render(t.createElement(n, e, null));
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
u as renderDTContent
|
|
12
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { I18nextProvider as n } from "react-i18next";
|
|
2
|
-
import { StaticTree as a } from "@shelf/decision-tree-editor-components";
|
|
3
|
-
import t from "../i18next/index.js";
|
|
4
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
5
|
-
const p = ({
|
|
6
|
-
tree: r,
|
|
7
|
-
variables: o
|
|
8
|
-
}) => {
|
|
9
|
-
const i = {
|
|
10
|
-
conditionDefaultTitle: t.t("pdf-viewer.exportDTPDF.conditionDefaultTitle"),
|
|
11
|
-
containsLabel: t.t("pdf-viewer.exportDTPDF.contains"),
|
|
12
|
-
notContainsLabel: t.t("pdf-viewer.exportDTPDF.notContains"),
|
|
13
|
-
andOperator: t.t("pdf-viewer.exportDTPDF.andOperator"),
|
|
14
|
-
orOperator: t.t("pdf-viewer.exportDTPDF.orOperator")
|
|
15
|
-
};
|
|
16
|
-
return /* @__PURE__ */ e(n, {
|
|
17
|
-
i18n: t,
|
|
18
|
-
children: /* @__PURE__ */ e(a, {
|
|
19
|
-
tree: r,
|
|
20
|
-
...i,
|
|
21
|
-
variables: o
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
}, s = p;
|
|
25
|
-
export {
|
|
26
|
-
s as default
|
|
27
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import n from "react";
|
|
2
|
-
import "../node_modules/react-dom/client.js";
|
|
3
|
-
import m from "./StaticTreeContainer.js";
|
|
4
|
-
import a from "../i18next/index.js";
|
|
5
|
-
import { __exports as c } from "../_virtual/client.js";
|
|
6
|
-
const u = ({
|
|
7
|
-
language: r,
|
|
8
|
-
tree: e,
|
|
9
|
-
variables: t,
|
|
10
|
-
containerSelector: o = "#diagram-container"
|
|
11
|
-
}) => {
|
|
12
|
-
const i = document.querySelector(o);
|
|
13
|
-
r && a.changeLanguage(r), c.createRoot(i).render(
|
|
14
|
-
n.createElement(
|
|
15
|
-
m,
|
|
16
|
-
{
|
|
17
|
-
tree: e,
|
|
18
|
-
variables: t
|
|
19
|
-
},
|
|
20
|
-
null
|
|
21
|
-
)
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
u as renderStaticDTDiagram
|
|
26
|
-
};
|
package/lib/_virtual/client.js
DELETED
package/lib/_virtual/index.js
DELETED
package/lib/_virtual/index2.js
DELETED
package/lib/i18next/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { resources as n } from "@shelf/i18n/lib/bundles/pdf-viewer";
|
|
2
|
-
import { initReactI18next as e } from "react-i18next";
|
|
3
|
-
import r from "i18next";
|
|
4
|
-
import { defaultInterpolation as i } from "@shelf/i18n/lib/helpers";
|
|
5
|
-
const t = r.createInstance();
|
|
6
|
-
t.init({
|
|
7
|
-
lng: "en",
|
|
8
|
-
resources: n,
|
|
9
|
-
fallbackLng: "en",
|
|
10
|
-
interpolation: i,
|
|
11
|
-
missingKeyHandler: () => "\u26D4\uFE0F"
|
|
12
|
-
});
|
|
13
|
-
t.use(e);
|
|
14
|
-
const l = t;
|
|
15
|
-
export {
|
|
16
|
-
l as default,
|
|
17
|
-
t as i18next
|
|
18
|
-
};
|