@clowder-ai/companion 0.1.0-alpha.19 → 0.1.0-alpha.20

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/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "pluginId": "official.companion",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "0.1.0-alpha.20",
4
4
  "contractVersion": "0.1.0",
5
5
  "name": "猫猫球",
6
6
  "icon": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clowder-ai/companion",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "0.1.0-alpha.20",
4
4
  "description": "The desktop voice body for your Clowder companion",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/plugin.yaml CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "pluginId": "official.companion",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "0.1.0-alpha.20",
4
4
  "contractVersion": "0.1.0",
5
5
  "name": "猫猫球",
6
6
  "icon": {
@@ -44,7 +44,29 @@ export class RecentBubble {
44
44
  for (const [index, row] of this.rows.entries()) {
45
45
  const entry = entries[index];
46
46
  row.hidden = !entry;
47
- row.textContent = entry ? `${String(entry.name).slice(0, 28)}:${String(entry.text).slice(-120)}` : '';
47
+ const speaker = entry ? `${String(entry.name).slice(0, 28)}:` : '';
48
+ const message = entry ? String(entry.text).slice(-120) : '';
49
+ row.textContent = `${speaker}${message}`;
50
+ if (entry && row.ownerDocument?.createElement && typeof row.replaceChildren === 'function') {
51
+ const speakerNode = row.ownerDocument.createElement('span');
52
+ const messageNode = row.ownerDocument.createElement('span');
53
+ const messageText = row.ownerDocument.createElement('bdi');
54
+ speakerNode.className = 'recent-speaker';
55
+ messageNode.className = 'recent-message';
56
+ messageText.className = 'recent-message-text';
57
+ messageText.dir = 'auto';
58
+ speakerNode.textContent = speaker;
59
+ // dir=auto resolves the first strong character. Reversing code points for
60
+ // this hidden-in-the-same-tick probe therefore resolves the latest strong
61
+ // character, which is the edge this compact tail projection must retain.
62
+ messageText.textContent = Array.from(message).reverse().join('');
63
+ messageNode.append(messageText);
64
+ row.replaceChildren(speakerNode, messageNode);
65
+ const direction = row.ownerDocument.defaultView?.getComputedStyle(messageText).direction;
66
+ messageText.dir = direction === 'rtl' ? 'rtl' : 'ltr';
67
+ messageText.textContent = message;
68
+ messageNode.dataset.direction = direction === 'rtl' ? 'rtl' : 'ltr';
69
+ }
48
70
  row.dataset ??= {};
49
71
  row.dataset.role = entry?.role ?? '';
50
72
  }
@@ -73,7 +73,7 @@ button:disabled { opacity: .45; cursor: default; }
73
73
  .floating { position: absolute; z-index: 3; border-radius: 12px; border: 1px solid var(--desktop-line-strong); background: var(--desktop-paper); box-shadow: 0 14px 28px #18171526, 0 2px 5px #1817150f; }
74
74
  .floating { max-height: 500px; overflow: auto; }
75
75
  #bubble { width: 240px; max-height: 80px; overflow: hidden; padding: 8px 11px; pointer-events: none; }
76
- #bubble p { margin: 0; font-size: 11px; line-height: 1.45; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
76
+ #bubble p { margin: 0; display: flex; min-width: 0; font-size: 11px; line-height: 1.45; overflow: hidden; white-space: nowrap; }
77
77
  #bubble p + p { margin-top: 4px; }
78
78
  #bubble [data-role="user"] { color: var(--cafe-text-secondary); }
79
79
  .floating button { border: 0; background: transparent; border-radius: 7px; padding: 8px 11px; font-weight: 400; }
@@ -101,7 +101,11 @@ button:disabled { opacity: .45; cursor: default; }
101
101
  .call-share-context small, .call-share-line small { color: var(--desktop-muted); font-size: 11px; }
102
102
  .call-recent { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--desktop-line); }
103
103
  .call-recent-label { color: var(--desktop-muted); font-size: 11px; letter-spacing: .05em; }
104
- .call-recent p { margin: 4px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 1.45; }
104
+ .call-recent p { margin: 4px 0 0; display: flex; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; line-height: 1.45; }
105
+ .recent-speaker { flex: none; }
106
+ .recent-message { min-width: 0; flex: 1 1 auto; overflow: hidden; direction: rtl; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
107
+ .recent-message[data-direction="rtl"] { direction: ltr; }
108
+ .recent-message-text { unicode-bidi: isolate; }
105
109
  .call-recent p[data-role="user"] { color: var(--desktop-muted); }
106
110
  .call-actions { justify-content: flex-end; }
107
111
  .call-actions #end { min-width: 88px; margin-left: auto; }