@beda.software/web-item-controls 0.1.25 → 0.1.26
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.
|
@@ -44,22 +44,16 @@ import "../utils/yup-locale.js";
|
|
|
44
44
|
import "antd/es/layout/layout";
|
|
45
45
|
import "antd/es/layout/Sider";
|
|
46
46
|
import "../components/Wizard/styles.js";
|
|
47
|
-
import { GroupWizardVertical as I, GroupWizard as
|
|
47
|
+
import { GroupWizardVertical as I, GroupWizard as e, GroupWizardWithTooltips as G } from "./GroupWizard/index.js";
|
|
48
48
|
import "../readonly-controls/GroupWizard/styles.js";
|
|
49
49
|
import "./ImageAnnotation/styles.js";
|
|
50
|
-
import "
|
|
51
|
-
import "rehype-raw";
|
|
52
|
-
import "remark-directive";
|
|
53
|
-
import "remark-gfm";
|
|
54
|
-
import "../components/RenderImage/cache.js";
|
|
55
|
-
import "../components/RenderImage/styles.js";
|
|
56
|
-
import "../readonly-controls/MarkdownRender/styles.js";
|
|
50
|
+
import "../readonly-controls/MarkdownRender/index.js";
|
|
57
51
|
import { QuestionReference as T } from "./Reference/index.js";
|
|
58
52
|
import "./GroupTable/RenderFormItemReadOnly/styles.js";
|
|
59
53
|
import { GroupTabs as x } from "./GroupTabs/index.js";
|
|
60
54
|
import { ImageAnnotation as W } from "./ImageAnnotation/index.js";
|
|
61
55
|
import { InlineChoice as o } from "./InlineChoice/index.js";
|
|
62
|
-
import { InlineReference as
|
|
56
|
+
import { InlineReference as m } from "./InlineReference/index.js";
|
|
63
57
|
import { QuestionInputInsideText as z } from "./InsideText/index.js";
|
|
64
58
|
import { MDEditorControl as R } from "./MDEditorControl/index.js";
|
|
65
59
|
import "@mdxeditor/editor";
|
|
@@ -78,7 +72,7 @@ import { QuestionEmail as E, QuestionString as M, QuestionText as q } from "./St
|
|
|
78
72
|
import { TextWithMacroFill as A } from "./TextWithMacroFill/index.js";
|
|
79
73
|
import { TimeRangePickerControl as F } from "./TimeRangePickerControl/index.js";
|
|
80
74
|
import { UploadFileControl as U } from "./UploadFileControl/index.js";
|
|
81
|
-
const
|
|
75
|
+
const ar = {
|
|
82
76
|
text: q,
|
|
83
77
|
string: M,
|
|
84
78
|
decimal: k,
|
|
@@ -93,14 +87,14 @@ const fr = {
|
|
|
93
87
|
reference: T,
|
|
94
88
|
quantity: S,
|
|
95
89
|
attachment: U
|
|
96
|
-
},
|
|
90
|
+
}, dr = l, sr = {
|
|
97
91
|
phoneWidget: y,
|
|
98
92
|
email: E,
|
|
99
93
|
passwordWidget: v,
|
|
100
94
|
slider: B,
|
|
101
95
|
"solid-radio-button": P,
|
|
102
96
|
"inline-choice": o,
|
|
103
|
-
"inline-reference":
|
|
97
|
+
"inline-reference": m,
|
|
104
98
|
"text-with-macro": A,
|
|
105
99
|
"radio-button": o,
|
|
106
100
|
"check-box": o,
|
|
@@ -109,8 +103,8 @@ const fr = {
|
|
|
109
103
|
"audio-recorder-uploader": p,
|
|
110
104
|
barcode: n,
|
|
111
105
|
// reference-radio-button is deprecated, use inline-reference instead
|
|
112
|
-
"reference-radio-button":
|
|
113
|
-
},
|
|
106
|
+
"reference-radio-button": m
|
|
107
|
+
}, ur = {
|
|
114
108
|
col: C,
|
|
115
109
|
row: h,
|
|
116
110
|
gtable: t,
|
|
@@ -122,9 +116,9 @@ const fr = {
|
|
|
122
116
|
"sub-card": c,
|
|
123
117
|
"blood-pressure": a,
|
|
124
118
|
"time-range-picker": F,
|
|
125
|
-
wizard:
|
|
119
|
+
wizard: e,
|
|
126
120
|
"wizard-with-tooltips": G,
|
|
127
|
-
"wizard-navigation-group":
|
|
121
|
+
"wizard-navigation-group": e,
|
|
128
122
|
"wizard-vertical": I,
|
|
129
123
|
"group-tabs": x,
|
|
130
124
|
"group-table": w,
|
|
@@ -132,8 +126,8 @@ const fr = {
|
|
|
132
126
|
"image-annotation": W
|
|
133
127
|
};
|
|
134
128
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
dr as groupItemComponent,
|
|
130
|
+
ur as itemControlGroupItemComponents,
|
|
131
|
+
sr as itemControlQuestionItemComponents,
|
|
132
|
+
ar as questionItemComponents
|
|
139
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/readonly-controls/MarkdownRender/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/readonly-controls/MarkdownRender/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAyB5C,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,2CAgDxD;AAED,wBAAgB,qBAAqB,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,iBAAiB,2CAWpF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,2CAMvD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAapD"}
|
|
@@ -1,78 +1,88 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { isValidElement as
|
|
4
|
-
import
|
|
1
|
+
import { jsx as t, Fragment as p, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import c from "classnames";
|
|
3
|
+
import { isValidElement as g } from "react";
|
|
4
|
+
import h from "react-markdown";
|
|
5
5
|
import k from "rehype-raw";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { S as
|
|
14
|
-
import {
|
|
15
|
-
|
|
6
|
+
import v, { defaultSchema as o } from "rehype-sanitize";
|
|
7
|
+
import x from "remark-directive";
|
|
8
|
+
import y from "remark-gfm";
|
|
9
|
+
import { useFieldController as w } from "../../components/BaseQuestionnaireResponseForm/hooks.js";
|
|
10
|
+
import { RenderImage as R } from "../../components/RenderImage/index.js";
|
|
11
|
+
import { RenderImageCacheProvider as S } from "../../components/RenderImage/cache.js";
|
|
12
|
+
import i from "../ReadonlyWidgets.module.scss.js";
|
|
13
|
+
import { S as b } from "../ReadonlyWidgets.styles.js";
|
|
14
|
+
import { S as s } from "./styles.js";
|
|
15
|
+
import { remarkRestoreUnsupportedDirectives as M, remarkAdmonition as C } from "./utils.js";
|
|
16
|
+
var d;
|
|
17
|
+
const D = {
|
|
18
|
+
...o,
|
|
19
|
+
tagNames: [...o.tagNames ?? [], "u"],
|
|
20
|
+
attributes: {
|
|
21
|
+
...o.attributes,
|
|
22
|
+
div: [...((d = o.attributes) == null ? void 0 : d.div) ?? [], "className"]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function m({
|
|
16
26
|
text: n
|
|
17
27
|
}) {
|
|
18
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ t(S, { children: /* @__PURE__ */ t(s.WrapperMDRender, { children: /* @__PURE__ */ t(h, { rehypePlugins: [k, [v, D]], remarkPlugins: [y, x, M, C], components: {
|
|
19
29
|
img({
|
|
20
30
|
src: r,
|
|
21
|
-
alt:
|
|
31
|
+
alt: e
|
|
22
32
|
}) {
|
|
23
|
-
return r ? /* @__PURE__ */
|
|
33
|
+
return r ? /* @__PURE__ */ t(R, { src: r, alt: e }) : null;
|
|
24
34
|
},
|
|
25
35
|
p({
|
|
26
36
|
children: r
|
|
27
37
|
}) {
|
|
28
|
-
return
|
|
38
|
+
return g(r) && typeof r.type != "string" && r.type.name === "img" ? r : /* @__PURE__ */ t("p", { children: r });
|
|
29
39
|
},
|
|
30
40
|
u(r) {
|
|
31
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ t("span", { style: {
|
|
32
42
|
textDecoration: "underline"
|
|
33
43
|
}, ...r });
|
|
34
44
|
},
|
|
35
45
|
div: ({
|
|
36
46
|
className: r,
|
|
37
|
-
children:
|
|
38
|
-
}) => r && typeof r == "string" && (r != null && r.startsWith("admonition")) ? /* @__PURE__ */
|
|
47
|
+
children: e
|
|
48
|
+
}) => r && typeof r == "string" && (r != null && r.startsWith("admonition")) ? /* @__PURE__ */ t("div", { className: r, children: /* @__PURE__ */ t("div", { className: "admonition-content", children: e }) }) : /* @__PURE__ */ t("div", { children: e }),
|
|
39
49
|
table: ({
|
|
40
50
|
children: r
|
|
41
|
-
}) => /* @__PURE__ */
|
|
51
|
+
}) => /* @__PURE__ */ t("div", { className: "md-render-table-wrapper", children: /* @__PURE__ */ t("table", { children: r }) })
|
|
42
52
|
}, children: n || "-" }) }) });
|
|
43
53
|
}
|
|
44
|
-
function
|
|
54
|
+
function V({
|
|
45
55
|
parentPath: n,
|
|
46
56
|
questionItem: r
|
|
47
57
|
}) {
|
|
48
58
|
const {
|
|
49
|
-
linkId:
|
|
50
|
-
text:
|
|
51
|
-
} = r,
|
|
52
|
-
value:
|
|
53
|
-
} =
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
59
|
+
linkId: e,
|
|
60
|
+
text: u
|
|
61
|
+
} = r, l = [...n, e, 0, "value", "string"], {
|
|
62
|
+
value: a
|
|
63
|
+
} = w(l, r);
|
|
64
|
+
return /* @__PURE__ */ f(b.Question, { className: c(i.question, i.column, "form__question"), children: [
|
|
65
|
+
/* @__PURE__ */ t("span", { className: i.questionText, children: u }),
|
|
66
|
+
a ? /* @__PURE__ */ t(m, { text: a }) : null
|
|
57
67
|
] });
|
|
58
68
|
}
|
|
59
|
-
function
|
|
69
|
+
function $(n) {
|
|
60
70
|
const {
|
|
61
71
|
questionItem: r
|
|
62
72
|
} = n, {
|
|
63
|
-
text:
|
|
73
|
+
text: e
|
|
64
74
|
} = r;
|
|
65
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ t(p, { children: e ? /* @__PURE__ */ t(m, { text: e }) : null });
|
|
66
76
|
}
|
|
67
|
-
function
|
|
77
|
+
function B(n) {
|
|
68
78
|
const {
|
|
69
79
|
questionItem: r
|
|
70
|
-
} = n,
|
|
71
|
-
return /* @__PURE__ */
|
|
80
|
+
} = n, e = r == null ? void 0 : r.text;
|
|
81
|
+
return /* @__PURE__ */ t(p, { children: e && /* @__PURE__ */ t(s.CardWrapper, { children: /* @__PURE__ */ t(m, { text: e }) }) });
|
|
72
82
|
}
|
|
73
83
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
B as MarkdownCard,
|
|
85
|
+
$ as MarkdownDisplay,
|
|
86
|
+
m as MarkdownRender,
|
|
87
|
+
V as MarkdownRenderControl
|
|
78
88
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beda.software/web-item-controls",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"react-select": "^5.7.3",
|
|
49
49
|
"recharts": "^3.8.0",
|
|
50
50
|
"rehype-raw": "^7.0.0",
|
|
51
|
+
"rehype-sanitize": "^6.0.0",
|
|
51
52
|
"remark-directive": "^4.0.0",
|
|
52
53
|
"remark-gfm": "^4.0.1",
|
|
53
54
|
"yup": "^1.7.0"
|