pi-studio 0.1.6 → 0.1.8
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/README.md +1 -0
- package/index.ts +14 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,6 +72,7 @@ pi -e https://github.com/omaclaren/pi-studio
|
|
|
72
72
|
|
|
73
73
|
- Local-only server (`127.0.0.1`) with rotating session tokens.
|
|
74
74
|
- One studio request at a time.
|
|
75
|
+
- Pi Studio is currently optimized for markdown workflows (model responses, plans, and notes), including fenced code blocks. Pure code files are supported, but highlighting is tuned for markdown and fenced blocks rather than full-file language mode.
|
|
75
76
|
- Studio URLs include a token query parameter; avoid sharing full Studio URLs.
|
|
76
77
|
- Preview panes render markdown via `pandoc` (`gfm+tex_math_dollars` → HTML5 + MathML), including pandoc code syntax highlighting, sanitized in-browser with `dompurify`.
|
|
77
78
|
- Preview rendering normalizes Obsidian wiki-image syntax (`![[path]]`, `![[path|alt]]`) into standard markdown images.
|
package/index.ts
CHANGED
|
@@ -1569,8 +1569,8 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
|
|
|
1569
1569
|
<button id="sendEditorBtn" type="button">Send to pi editor</button>
|
|
1570
1570
|
<button id="copyDraftBtn" type="button">Copy editor text</button>
|
|
1571
1571
|
<select id="highlightSelect" aria-label="Editor syntax highlighting">
|
|
1572
|
-
<option value="off"
|
|
1573
|
-
<option value="on">Highlight markdown: On</option>
|
|
1572
|
+
<option value="off">Highlight markdown: Off</option>
|
|
1573
|
+
<option value="on" selected>Highlight markdown: On</option>
|
|
1574
1574
|
</select>
|
|
1575
1575
|
</div>
|
|
1576
1576
|
</div>
|
|
@@ -1595,8 +1595,8 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
|
|
|
1595
1595
|
<option value="off">Auto-update response: Off</option>
|
|
1596
1596
|
</select>
|
|
1597
1597
|
<select id="responseHighlightSelect" aria-label="Response markdown highlighting">
|
|
1598
|
-
<option value="off"
|
|
1599
|
-
<option value="on">Highlight markdown: On</option>
|
|
1598
|
+
<option value="off">Highlight markdown: Off</option>
|
|
1599
|
+
<option value="on" selected>Highlight markdown: On</option>
|
|
1600
1600
|
</select>
|
|
1601
1601
|
<button id="pullLatestBtn" type="button" title="Fetch the latest assistant response when auto-update is off.">Get latest response</button>
|
|
1602
1602
|
<button id="loadResponseBtn" type="button">Load response into editor</button>
|
|
@@ -2454,11 +2454,14 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
|
|
|
2454
2454
|
}
|
|
2455
2455
|
|
|
2456
2456
|
function readStoredToggle(storageKey) {
|
|
2457
|
-
if (!window.localStorage) return
|
|
2457
|
+
if (!window.localStorage) return null;
|
|
2458
2458
|
try {
|
|
2459
|
-
|
|
2459
|
+
const value = window.localStorage.getItem(storageKey);
|
|
2460
|
+
if (value === "on") return true;
|
|
2461
|
+
if (value === "off") return false;
|
|
2462
|
+
return null;
|
|
2460
2463
|
} catch {
|
|
2461
|
-
return
|
|
2464
|
+
return null;
|
|
2462
2465
|
}
|
|
2463
2466
|
}
|
|
2464
2467
|
|
|
@@ -3232,12 +3235,12 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
|
|
|
3232
3235
|
refreshResponseUi();
|
|
3233
3236
|
setActivePane("left");
|
|
3234
3237
|
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3238
|
+
const storedEditorHighlightEnabled = readStoredEditorHighlightEnabled();
|
|
3239
|
+
const initialHighlightEnabled = storedEditorHighlightEnabled ?? Boolean(highlightSelect && highlightSelect.value === "on");
|
|
3237
3240
|
setEditorHighlightEnabled(initialHighlightEnabled);
|
|
3238
3241
|
|
|
3239
|
-
const
|
|
3240
|
-
|
|
3242
|
+
const storedResponseHighlightEnabled = readStoredResponseHighlightEnabled();
|
|
3243
|
+
const initialResponseHighlightEnabled = storedResponseHighlightEnabled ?? Boolean(responseHighlightSelect && responseHighlightSelect.value === "on");
|
|
3241
3244
|
setResponseHighlightEnabled(initialResponseHighlightEnabled);
|
|
3242
3245
|
|
|
3243
3246
|
setEditorView(editorView);
|