@gendive/chatllm 0.17.13 → 0.17.14
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/react/index.js +34 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +34 -3
- package/dist/react/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -7104,6 +7104,37 @@ var DeepResearchProgressUI = ({ progress }) => {
|
|
|
7104
7104
|
// src/react/components/PollCard.tsx
|
|
7105
7105
|
var import_react13 = require("react");
|
|
7106
7106
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
7107
|
+
var renderInlineMarkdown = (text) => {
|
|
7108
|
+
const parts = [];
|
|
7109
|
+
let remaining = text;
|
|
7110
|
+
let key = 0;
|
|
7111
|
+
while (remaining.length > 0) {
|
|
7112
|
+
const match = remaining.match(
|
|
7113
|
+
/(\*\*(.+?)\*\*|__(.+?)__|`(.+?)`|~~(.+?)~~|\*(.+?)\*|_(.+?)_)/
|
|
7114
|
+
);
|
|
7115
|
+
if (!match || match.index === void 0) {
|
|
7116
|
+
parts.push(remaining);
|
|
7117
|
+
break;
|
|
7118
|
+
}
|
|
7119
|
+
if (match.index > 0) {
|
|
7120
|
+
parts.push(remaining.slice(0, match.index));
|
|
7121
|
+
}
|
|
7122
|
+
const fullMatch = match[0];
|
|
7123
|
+
if (match[2] || match[3]) {
|
|
7124
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("strong", { children: match[2] || match[3] }, key++));
|
|
7125
|
+
} else if (match[4]) {
|
|
7126
|
+
parts.push(
|
|
7127
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { style: { backgroundColor: "var(--chatllm-bg-tertiary, #f1f5f9)", padding: "1px 4px", borderRadius: "3px", fontSize: "0.9em" }, children: match[4] }, key++)
|
|
7128
|
+
);
|
|
7129
|
+
} else if (match[5]) {
|
|
7130
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("s", { children: match[5] }, key++));
|
|
7131
|
+
} else if (match[6] || match[7]) {
|
|
7132
|
+
parts.push(/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("em", { children: match[6] || match[7] }, key++));
|
|
7133
|
+
}
|
|
7134
|
+
remaining = remaining.slice(match.index + fullMatch.length);
|
|
7135
|
+
}
|
|
7136
|
+
return parts.length === 1 && typeof parts[0] === "string" ? parts[0] : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: parts });
|
|
7137
|
+
};
|
|
7107
7138
|
var stripMarkdown = (text) => text.replace(/\*\*(.+?)\*\*/g, "$1").replace(/__(.+?)__/g, "$1").replace(/\*(.+?)\*/g, "$1").replace(/_(.+?)_/g, "$1").replace(/`(.+?)`/g, "$1").replace(/~~(.+?)~~/g, "$1");
|
|
7108
7139
|
var PollCard = ({
|
|
7109
7140
|
questions,
|
|
@@ -7262,7 +7293,7 @@ var PollCard = ({
|
|
|
7262
7293
|
fontWeight: 600,
|
|
7263
7294
|
color: "var(--chatllm-text, #1e293b)"
|
|
7264
7295
|
},
|
|
7265
|
-
children:
|
|
7296
|
+
children: renderInlineMarkdown(currentQuestion.question)
|
|
7266
7297
|
}
|
|
7267
7298
|
),
|
|
7268
7299
|
currentQuestion.multiSelect && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -7330,7 +7361,7 @@ var PollCard = ({
|
|
|
7330
7361
|
color: "var(--chatllm-text, #1e293b)",
|
|
7331
7362
|
lineHeight: "1.4"
|
|
7332
7363
|
},
|
|
7333
|
-
children:
|
|
7364
|
+
children: renderInlineMarkdown(option.label)
|
|
7334
7365
|
}
|
|
7335
7366
|
),
|
|
7336
7367
|
option.description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -7342,7 +7373,7 @@ var PollCard = ({
|
|
|
7342
7373
|
marginTop: "2px",
|
|
7343
7374
|
lineHeight: "1.3"
|
|
7344
7375
|
},
|
|
7345
|
-
children:
|
|
7376
|
+
children: renderInlineMarkdown(option.description)
|
|
7346
7377
|
}
|
|
7347
7378
|
)
|
|
7348
7379
|
] })
|