@runtypelabs/persona 3.2.1 → 3.3.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/widget.css CHANGED
@@ -1222,6 +1222,68 @@
1222
1222
  font-size: 0.8125rem;
1223
1223
  }
1224
1224
 
1225
+ /* Code block copy button */
1226
+ .persona-code-block-wrapper {
1227
+ position: relative;
1228
+ margin: 0.5rem 0;
1229
+ }
1230
+
1231
+ .persona-code-block-wrapper pre {
1232
+ margin: 0 !important;
1233
+ border-top-left-radius: 0 !important;
1234
+ border-top-right-radius: 0 !important;
1235
+ }
1236
+
1237
+ .persona-code-block-header {
1238
+ display: flex;
1239
+ align-items: center;
1240
+ justify-content: space-between;
1241
+ background-color: var(--persona-md-code-block-bg, #f3f4f6);
1242
+ border: 1px solid var(--persona-md-code-block-border-color, #e5e7eb);
1243
+ border-bottom: none;
1244
+ border-top-left-radius: var(--persona-md-code-block-border-radius, 0.375rem);
1245
+ border-top-right-radius: var(--persona-md-code-block-border-radius, 0.375rem);
1246
+ padding: 0.25rem 0.5rem 0.25rem 0.75rem;
1247
+ font-size: 0.75rem;
1248
+ color: var(--persona-text-muted, #6b7280);
1249
+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
1250
+ }
1251
+
1252
+ .persona-code-copy-btn {
1253
+ display: inline-flex;
1254
+ align-items: center;
1255
+ gap: 0.25rem;
1256
+ background: none;
1257
+ border: 1px solid transparent;
1258
+ border-radius: 0.25rem;
1259
+ padding: 0.25rem 0.5rem;
1260
+ cursor: pointer;
1261
+ color: var(--persona-text-muted, #6b7280);
1262
+ font-size: 0.75rem;
1263
+ font-family: inherit;
1264
+ line-height: 1;
1265
+ transition: color 0.15s ease, border-color 0.15s ease;
1266
+ }
1267
+
1268
+ .persona-code-copy-btn:hover {
1269
+ color: var(--persona-text, #111827);
1270
+ border-color: var(--persona-md-code-block-border-color, #e5e7eb);
1271
+ }
1272
+
1273
+ .persona-code-copy-btn.persona-code-copied {
1274
+ color: #16a34a;
1275
+ }
1276
+
1277
+ .persona-code-copy-btn.persona-code-copy-generating {
1278
+ cursor: default;
1279
+ opacity: 0.5;
1280
+ }
1281
+
1282
+ .persona-code-copy-btn.persona-code-copy-generating:hover {
1283
+ color: var(--persona-text-muted, #6b7280);
1284
+ border-color: transparent;
1285
+ }
1286
+
1225
1287
  /* Ensure all links in chat bubbles have underlines */
1226
1288
  .vanilla-message-bubble a {
1227
1289
  text-decoration: underline;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/persona",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -480,17 +480,33 @@ export const buildComposer = (context: ComposerBuildContext): ComposerElements =
480
480
  actionsRow.append(leftActions, rightActions);
481
481
  composerForm.append(actionsRow);
482
482
 
483
+ // Apply status indicator config
484
+ const statusConfig = config?.statusIndicator ?? {};
485
+ const alignClass =
486
+ statusConfig.align === "left" ? "persona-text-left"
487
+ : statusConfig.align === "center" ? "persona-text-center"
488
+ : "persona-text-right";
483
489
  const statusText = createElement(
484
490
  "div",
485
- "persona-mt-2 persona-text-right persona-text-xs persona-text-persona-muted"
491
+ `persona-mt-2 ${alignClass} persona-text-xs persona-text-persona-muted`
486
492
  );
487
493
  statusText.setAttribute("data-persona-composer-status", "");
488
494
 
489
- // Apply status indicator config
490
- const statusConfig = config?.statusIndicator ?? {};
491
495
  const isVisible = statusConfig.visible ?? true;
492
496
  statusText.style.display = isVisible ? "" : "none";
493
- statusText.textContent = statusConfig.idleText ?? "Online";
497
+ const idleLabel = statusConfig.idleText ?? "Online";
498
+ if (statusConfig.idleLink) {
499
+ const link = createElement("a");
500
+ link.href = statusConfig.idleLink;
501
+ link.target = "_blank";
502
+ link.rel = "noopener noreferrer";
503
+ link.textContent = idleLabel;
504
+ link.style.color = "inherit";
505
+ link.style.textDecoration = "none";
506
+ statusText.appendChild(link);
507
+ } else {
508
+ statusText.textContent = idleLabel;
509
+ }
494
510
 
495
511
  footer.append(suggestions, composerForm, statusText);
496
512