llmasaservice-ui 0.7.4 → 0.7.5
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/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/ChatPanel.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -248,15 +248,15 @@ var ChatPanel = ({
|
|
|
248
248
|
actions.forEach((action, index) => {
|
|
249
249
|
const regex = new RegExp(action.pattern, "gmi");
|
|
250
250
|
newResponse = newResponse.replace(regex, (match, ...groups) => {
|
|
251
|
-
var _a, _b
|
|
251
|
+
var _a, _b;
|
|
252
252
|
console.log("action match", match, groups);
|
|
253
253
|
const matchIndex = groups[groups.length - 2];
|
|
254
254
|
const buttonId = `button-${messages.length}-${index}-${matchIndex}`;
|
|
255
255
|
let html = match;
|
|
256
256
|
if (action.type === "button" || action.type === "callback") {
|
|
257
|
-
html = `<button id="${buttonId}"
|
|
257
|
+
html = `<button id="${buttonId}" ${action.style ? 'class=" ' + action.style + '"' : ""}">${(_a = action.markdown) != null ? _a : match}</button>`;
|
|
258
258
|
} else if (action.type === "markdown" || action.type === "html") {
|
|
259
|
-
html = (
|
|
259
|
+
html = (_b = action.markdown) != null ? _b : "";
|
|
260
260
|
}
|
|
261
261
|
html = html.replace(new RegExp("\\$match", "g"), match);
|
|
262
262
|
groups.forEach((group, index2) => {
|
package/dist/index.mjs
CHANGED
|
@@ -214,15 +214,15 @@ var ChatPanel = ({
|
|
|
214
214
|
actions.forEach((action, index) => {
|
|
215
215
|
const regex = new RegExp(action.pattern, "gmi");
|
|
216
216
|
newResponse = newResponse.replace(regex, (match, ...groups) => {
|
|
217
|
-
var _a, _b
|
|
217
|
+
var _a, _b;
|
|
218
218
|
console.log("action match", match, groups);
|
|
219
219
|
const matchIndex = groups[groups.length - 2];
|
|
220
220
|
const buttonId = `button-${messages.length}-${index}-${matchIndex}`;
|
|
221
221
|
let html = match;
|
|
222
222
|
if (action.type === "button" || action.type === "callback") {
|
|
223
|
-
html = `<button id="${buttonId}"
|
|
223
|
+
html = `<button id="${buttonId}" ${action.style ? 'class=" ' + action.style + '"' : ""}">${(_a = action.markdown) != null ? _a : match}</button>`;
|
|
224
224
|
} else if (action.type === "markdown" || action.type === "html") {
|
|
225
|
-
html = (
|
|
225
|
+
html = (_b = action.markdown) != null ? _b : "";
|
|
226
226
|
}
|
|
227
227
|
html = html.replace(new RegExp("\\$match", "g"), match);
|
|
228
228
|
groups.forEach((group, index2) => {
|
package/package.json
CHANGED
package/src/ChatPanel.tsx
CHANGED
|
@@ -178,7 +178,7 @@ const ChatPanel: React.FC<ChatPanelProps & ExtraProps> = ({
|
|
|
178
178
|
|
|
179
179
|
let html = match;
|
|
180
180
|
if (action.type === "button" || action.type === "callback") {
|
|
181
|
-
html = `<button id="${buttonId}" style="
|
|
181
|
+
html = `<button id="${buttonId}" ${action.style ? 'class=" ' + action.style + '"' : ''}">${
|
|
182
182
|
action.markdown ?? match
|
|
183
183
|
}</button>`;
|
|
184
184
|
} else if (action.type === "markdown" || action.type === "html") {
|