@shelf/global-renderer 1.0.2 → 1.0.3-beta.1

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 (44) hide show
  1. package/CHANGELOG.md +2398 -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 +3 -3
  22. package/lib/DecisionTreeContent/helpers.js +54 -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/client.js +4 -0
  29. package/lib/_virtual/index.js +4 -0
  30. package/lib/_virtual/index2.js +4 -0
  31. package/lib/_virtual/react-dom.development.js +4 -0
  32. package/lib/_virtual/react-dom.production.min.js +4 -0
  33. package/lib/_virtual/scheduler.development.js +4 -0
  34. package/lib/_virtual/scheduler.production.min.js +4 -0
  35. package/lib/i18next/index.js +18 -0
  36. package/lib/index.js +4 -20383
  37. package/lib/node_modules/react-dom/cjs/react-dom.development.js +12880 -0
  38. package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +5643 -0
  39. package/lib/node_modules/react-dom/client.js +28 -0
  40. package/lib/node_modules/react-dom/index.js +17 -0
  41. package/lib/node_modules/scheduler/cjs/scheduler.development.js +278 -0
  42. package/lib/node_modules/scheduler/cjs/scheduler.production.min.js +231 -0
  43. package/lib/node_modules/scheduler/index.js +12 -0
  44. package/package.json +17 -22
@@ -0,0 +1,12 @@
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
+ };
@@ -9,7 +9,7 @@ export type RenderDTContentData = {
9
9
  title: string;
10
10
  description: string;
11
11
  language: L10n.LanguageCode;
12
- exportedAt: string;
12
+ exportedAt: Date;
13
13
  exportedBy: string;
14
14
  createdBy: string;
15
15
  fields?: {
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ /// <reference types="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
- }) => React.JSX.Element;
6
+ }) => JSX.Element;
7
7
  export default StaticTreeContainer;
@@ -0,0 +1,27 @@
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
+ };
@@ -0,0 +1,26 @@
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
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var r = { exports: {} };
2
+ export {
3
+ r
4
+ };
@@ -0,0 +1,4 @@
1
+ var e = { exports: {} };
2
+ export {
3
+ e as s
4
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var o = {};
2
+ export {
3
+ o as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var r = {};
2
+ export {
3
+ r as __exports
4
+ };
@@ -0,0 +1,18 @@
1
+ import { resources as n } from "@shelf/i18n/lib/bundles/pdf-viewer/index.js";
2
+ import { initReactI18next as e } from "react-i18next";
3
+ import r from "i18next";
4
+ import { defaultInterpolation as i } from "@shelf/i18n";
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
+ };