pi-studio 0.5.33 → 0.5.34
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/CHANGELOG.md +8 -0
- package/client/studio-client.js +27 -0
- package/client/studio.css +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `pi-studio` are documented here.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.5.34] — 2026-03-27
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Preview-side fenced `text`/`plaintext` blocks now soft-wrap long lines instead of forcing horizontal scrolling, while code/diff blocks keep their existing scrollable behavior.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Preview annotation pills once again render inline math within long `[an: ...]` notes instead of leaving `$...$` / `\(...\)` fragments as literal text.
|
|
14
|
+
|
|
7
15
|
## [0.5.33] — 2026-03-27
|
|
8
16
|
|
|
9
17
|
### Changed
|
package/client/studio-client.js
CHANGED
|
@@ -1697,6 +1697,32 @@
|
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
1699
|
|
|
1700
|
+
async function renderAnnotationMathInElement(targetEl) {
|
|
1701
|
+
if (!targetEl || typeof targetEl.querySelectorAll !== "function") return;
|
|
1702
|
+
|
|
1703
|
+
const markers = Array.from(targetEl.querySelectorAll(".annotation-preview-marker")).filter((node) => {
|
|
1704
|
+
const text = typeof node.textContent === "string" ? node.textContent : "";
|
|
1705
|
+
return /\\\(|\\\[|\$\$?|\\[A-Za-z]+/.test(text);
|
|
1706
|
+
});
|
|
1707
|
+
if (markers.length === 0) return;
|
|
1708
|
+
|
|
1709
|
+
let mathJax;
|
|
1710
|
+
try {
|
|
1711
|
+
mathJax = await ensureMathJax();
|
|
1712
|
+
} catch (error) {
|
|
1713
|
+
console.error("Annotation MathJax load failed:", error);
|
|
1714
|
+
appendMathFallbackNotice(targetEl, MATHJAX_UNAVAILABLE_MESSAGE);
|
|
1715
|
+
return;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
try {
|
|
1719
|
+
await mathJax.typesetPromise(markers);
|
|
1720
|
+
} catch (error) {
|
|
1721
|
+
console.error("Annotation math render failed:", error);
|
|
1722
|
+
appendMathFallbackNotice(targetEl, MATHJAX_RENDER_FAIL_MESSAGE);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1700
1726
|
function applyPreviewAnnotationPlaceholdersToElement(targetEl, placeholders) {
|
|
1701
1727
|
if (!targetEl || !Array.isArray(placeholders) || placeholders.length === 0) return;
|
|
1702
1728
|
if (typeof document.createTreeWalker !== "function") return;
|
|
@@ -2258,6 +2284,7 @@
|
|
|
2258
2284
|
finishPreviewRender(targetEl);
|
|
2259
2285
|
targetEl.innerHTML = sanitizeRenderedHtml(renderedHtml, markdown);
|
|
2260
2286
|
applyPreviewAnnotationPlaceholdersToElement(targetEl, previewPrepared.placeholders);
|
|
2287
|
+
await renderAnnotationMathInElement(targetEl);
|
|
2261
2288
|
decoratePdfEmbeds(targetEl);
|
|
2262
2289
|
await renderPdfPreviewsInElement(targetEl);
|
|
2263
2290
|
const annotationMode = (pane === "source" || pane === "response")
|
package/client/studio.css
CHANGED
|
@@ -742,6 +742,22 @@
|
|
|
742
742
|
color: var(--md-codeblock);
|
|
743
743
|
}
|
|
744
744
|
|
|
745
|
+
.rendered-markdown pre.text,
|
|
746
|
+
.rendered-markdown pre.plaintext,
|
|
747
|
+
.rendered-markdown pre.sourceCode.txt {
|
|
748
|
+
white-space: pre-wrap;
|
|
749
|
+
overflow-x: hidden;
|
|
750
|
+
overflow-wrap: anywhere;
|
|
751
|
+
word-break: break-word;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.rendered-markdown pre.text code,
|
|
755
|
+
.rendered-markdown pre.plaintext code,
|
|
756
|
+
.rendered-markdown pre.sourceCode.txt code,
|
|
757
|
+
.rendered-markdown pre.sourceCode.txt code > span {
|
|
758
|
+
white-space: inherit;
|
|
759
|
+
}
|
|
760
|
+
|
|
745
761
|
.rendered-markdown :not(pre) > code {
|
|
746
762
|
background: rgba(127, 127, 127, 0.13);
|
|
747
763
|
border: 1px solid var(--md-codeblock-border);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-studio",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.34",
|
|
4
4
|
"description": "Two-pane browser workspace for pi with prompt/response editing, annotations, critiques, prompt/response history, and live Markdown/LaTeX/code preview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|