@box/box-ai-content-answers 0.150.0 → 0.152.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.
- package/dist/chunks/markdown.module.js +19 -0
- package/dist/esm/lib/components/answer/answer.js +123 -127
- package/dist/esm/lib/components/answer/messages.js +4 -0
- package/dist/esm/lib/components/answer/thumb-buttons.js +31 -31
- package/dist/esm/lib/components/common/inline-citation.js +47 -0
- package/dist/esm/lib/components/common/markdown-react.js +81 -59
- package/dist/esm/lib/components/common/markdown.js +723 -721
- package/dist/esm/lib/utils/inlineCitationsUtils.js +36 -0
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/bn-IN.properties +2 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/da-DK.properties +2 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/de-DE.properties +2 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-AU.properties +2 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-CA.properties +2 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-GB.properties +2 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +79 -78
- package/dist/i18n/en-x-pseudo.properties +80 -78
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-419.properties +2 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/es-ES.properties +2 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fi-FI.properties +2 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-CA.properties +2 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/fr-FR.properties +2 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/hi-IN.properties +2 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/it-IT.properties +2 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/ja-JP.properties +2 -0
- package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/ko-KR.properties +2 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nb-NO.properties +2 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/nl-NL.properties +2 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pl-PL.properties +2 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/pt-BR.properties +2 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/ru-RU.properties +2 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/sv-SE.properties +2 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/tr-TR.properties +2 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-CN.properties +2 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/i18n/zh-TW.properties +2 -0
- package/dist/styles/markdown.css +1 -7
- package/dist/styles/markdown2.css +7 -0
- package/dist/types/lib/components/answer/answer.d.ts +1 -2
- package/dist/types/lib/components/answer/messages.d.ts +5 -0
- package/dist/types/lib/components/answer/stories/shared.d.ts +15 -3
- package/dist/types/lib/components/common/inline-citation.d.ts +7 -0
- package/dist/types/lib/utils/inlineCitationsUtils.d.ts +17 -0
- package/package.json +3 -3
- package/dist/esm/lib/utils/getBoxLinks.js +0 -13
- package/dist/types/lib/utils/getBoxLinks.d.ts +0 -15
|
@@ -1,99 +1,121 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import d from "react-markdown";
|
|
2
|
+
import h from "remark-gfm";
|
|
3
|
+
import { isBoxCitation as f } from "../../utils/inlineCitationsUtils.js";
|
|
4
|
+
import u from "./inline-citation.js";
|
|
5
|
+
import { s as t } from "../../../../chunks/markdown.module.js";
|
|
6
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
|
7
|
+
const N = ({
|
|
5
8
|
children: e,
|
|
6
|
-
className:
|
|
9
|
+
className: o
|
|
7
10
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
className: "hljs",
|
|
11
|
+
const r = o ? o.replace("language-", "") : "", s = (i) => i.trim().split(/\r?\n/).map((a, m) => /* @__PURE__ */ c("div", {
|
|
12
|
+
className: "hljs-line",
|
|
11
13
|
children: [/* @__PURE__ */ n("span", {
|
|
12
|
-
className: "hljs-
|
|
13
|
-
children:
|
|
14
|
+
className: "hljs-line-number",
|
|
15
|
+
children: m + 1
|
|
16
|
+
}), /* @__PURE__ */ n("span", {
|
|
17
|
+
className: "hljs-line-content",
|
|
18
|
+
children: a
|
|
19
|
+
})]
|
|
20
|
+
}, `line-${a.substring(0, 20)}-${Date.now()}`));
|
|
21
|
+
return /* @__PURE__ */ c("div", {
|
|
22
|
+
className: t.hljs,
|
|
23
|
+
children: [/* @__PURE__ */ n("span", {
|
|
24
|
+
className: t.hljsLanguage,
|
|
25
|
+
children: r || "auto"
|
|
14
26
|
}), /* @__PURE__ */ n("code", {
|
|
15
|
-
children:
|
|
16
|
-
className: "hljs-line",
|
|
17
|
-
children: [/* @__PURE__ */ n("span", {
|
|
18
|
-
className: "hljs-line-number",
|
|
19
|
-
children: l + 1
|
|
20
|
-
}), /* @__PURE__ */ n("span", {
|
|
21
|
-
className: "hljs-line-content",
|
|
22
|
-
children: c
|
|
23
|
-
})]
|
|
24
|
-
}, `line-${c.substring(0, 20)}-${Date.now()}`)))(e)
|
|
27
|
+
children: s(e)
|
|
25
28
|
})]
|
|
26
29
|
});
|
|
27
|
-
},
|
|
30
|
+
}, k = ({
|
|
28
31
|
children: e
|
|
29
32
|
}) => /* @__PURE__ */ n("div", {
|
|
30
|
-
className:
|
|
33
|
+
className: t.tableWrapper,
|
|
31
34
|
children: /* @__PURE__ */ n("table", {
|
|
32
35
|
children: e
|
|
33
36
|
})
|
|
34
|
-
}),
|
|
37
|
+
}), b = ({
|
|
35
38
|
href: e,
|
|
36
|
-
children:
|
|
37
|
-
}) => /* @__PURE__ */
|
|
38
|
-
children: [
|
|
39
|
-
}),
|
|
39
|
+
children: o
|
|
40
|
+
}) => /* @__PURE__ */ c("span", {
|
|
41
|
+
children: [o, " (", e, ")"]
|
|
42
|
+
}), g = ({
|
|
40
43
|
children: e
|
|
41
44
|
}) => /* @__PURE__ */ n("blockquote", {
|
|
42
|
-
className:
|
|
45
|
+
className: t.blockquote,
|
|
43
46
|
children: e
|
|
44
|
-
}),
|
|
47
|
+
}), j = ({
|
|
45
48
|
children: e
|
|
46
49
|
}) => /* @__PURE__ */ n("ol", {
|
|
47
|
-
className:
|
|
50
|
+
className: t.orderedList,
|
|
48
51
|
children: e
|
|
49
|
-
}),
|
|
52
|
+
}), x = ({
|
|
50
53
|
children: e
|
|
51
54
|
}) => {
|
|
52
|
-
var
|
|
53
|
-
const
|
|
55
|
+
var r;
|
|
56
|
+
const o = ((r = e == null ? void 0 : e.toString().match(/^(\d+)/)) == null ? void 0 : r[1]) || e;
|
|
54
57
|
return /* @__PURE__ */ n("span", {
|
|
55
|
-
className:
|
|
56
|
-
children:
|
|
58
|
+
className: t.footnote,
|
|
59
|
+
children: o
|
|
57
60
|
});
|
|
58
|
-
},
|
|
59
|
-
code:
|
|
60
|
-
table:
|
|
61
|
-
blockquote:
|
|
62
|
-
ol:
|
|
63
|
-
sup:
|
|
61
|
+
}, C = {
|
|
62
|
+
code: N,
|
|
63
|
+
table: k,
|
|
64
|
+
blockquote: g,
|
|
65
|
+
ol: j,
|
|
66
|
+
sup: x,
|
|
64
67
|
// Handle footnote references
|
|
68
|
+
// Custom paragraph component to handle inline elements properly
|
|
69
|
+
p: ({
|
|
70
|
+
children: e
|
|
71
|
+
}) => /* @__PURE__ */ n("div", {
|
|
72
|
+
className: t.inlineParagraph,
|
|
73
|
+
children: e
|
|
74
|
+
}),
|
|
65
75
|
// Handle footnote references that might be rendered as links
|
|
66
76
|
a: (e) => {
|
|
67
|
-
var
|
|
68
|
-
if ((
|
|
69
|
-
const
|
|
77
|
+
var r, s, i, l;
|
|
78
|
+
if ((r = e.href) != null && r.startsWith("#user-content-fn")) {
|
|
79
|
+
const a = ((i = (s = e.children) == null ? void 0 : s.toString().match(/^(\d+)/)) == null ? void 0 : i[1]) || e.children;
|
|
70
80
|
return /* @__PURE__ */ n("a", {
|
|
71
|
-
className:
|
|
81
|
+
className: t.footnoteReference,
|
|
72
82
|
href: e.href,
|
|
73
|
-
children:
|
|
83
|
+
children: a
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (e.href && f(e.href)) {
|
|
87
|
+
const a = ((l = e.children) == null ? void 0 : l.toString()) || "";
|
|
88
|
+
return /* @__PURE__ */ n("span", {
|
|
89
|
+
style: {
|
|
90
|
+
display: "inline-block"
|
|
91
|
+
},
|
|
92
|
+
children: /* @__PURE__ */ n(u, {
|
|
93
|
+
fileName: a,
|
|
94
|
+
href: e.href
|
|
95
|
+
})
|
|
74
96
|
});
|
|
75
97
|
}
|
|
76
|
-
return /* @__PURE__ */ n(
|
|
98
|
+
return /* @__PURE__ */ n(b, {
|
|
77
99
|
href: e.href,
|
|
78
100
|
children: e.children
|
|
79
101
|
});
|
|
80
102
|
}
|
|
81
|
-
},
|
|
103
|
+
}, y = ({
|
|
82
104
|
children: e
|
|
83
105
|
}) => /* @__PURE__ */ n("div", {
|
|
84
|
-
className:
|
|
85
|
-
children: /* @__PURE__ */ n(
|
|
86
|
-
components:
|
|
87
|
-
remarkPlugins: [
|
|
106
|
+
className: t.markdownContent,
|
|
107
|
+
children: /* @__PURE__ */ n(d, {
|
|
108
|
+
components: C,
|
|
109
|
+
remarkPlugins: [h],
|
|
88
110
|
children: e
|
|
89
111
|
})
|
|
90
112
|
});
|
|
91
113
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
114
|
+
g as Blockquote,
|
|
115
|
+
N as CodeBlock,
|
|
116
|
+
x as Footnote,
|
|
117
|
+
b as Link,
|
|
118
|
+
j as Ol,
|
|
119
|
+
k as Table,
|
|
120
|
+
y as default
|
|
99
121
|
};
|