@pi-archimedes/image-paste 2.4.0 → 2.5.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/preview.ts +1 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-archimedes/image-paste",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -15,8 +15,8 @@
15
15
  "@earendil-works/pi-tui": ">=0.1.0"
16
16
  },
17
17
  "devDependencies": {
18
- "@earendil-works/pi-coding-agent": "^0.84.2",
19
- "@earendil-works/pi-tui": "^0.84.2",
18
+ "@earendil-works/pi-coding-agent": "^0.84.4",
19
+ "@earendil-works/pi-tui": "^0.84.4",
20
20
  "typescript": "^6.0.0"
21
21
  },
22
22
  "pi": {
package/src/preview.ts CHANGED
@@ -12,10 +12,6 @@ interface PreviewDetails {
12
12
  export function registerImagePreview(pi: ExtensionAPI): void {
13
13
  pi.registerMessageRenderer<PreviewDetails>(CUSTOM_TYPE, (message, _options, theme) => {
14
14
  try {
15
- // Theme.fg is runtime-available but not exposed in the Theme type definition
16
- const fg = (theme as any).fg?.bind(theme) as ((color: string, text: string) => string) | undefined;
17
- if (!fg) return undefined;
18
-
19
15
  // Extract image data from content array
20
16
  const content = message.content;
21
17
  if (!Array.isArray(content) || content.length === 0) return undefined;
@@ -28,7 +24,7 @@ export function registerImagePreview(pi: ExtensionAPI): void {
28
24
  container.addChild(new Spacer(1));
29
25
  container.addChild(
30
26
  new Image(item.data, item.mimeType, {
31
- fallbackColor: (text: string) => fg("toolOutput", text),
27
+ fallbackColor: (text: string) => theme.fg("toolOutput", text),
32
28
  }, {
33
29
  maxWidthCells: 60,
34
30
  }),