feat: edit print templates on the printer page and store them on presets

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-03 22:45:56 -04:00
co-authored by Cursor
parent 1337d9833d
commit c03ffc0833
18 changed files with 904 additions and 293 deletions
@@ -38,4 +38,55 @@ public class MarkdownTablePasteService
_logger.LogError(ex, "Unexpected error initializing paste-markdown for editor {EditorId}", editorId ?? "unknown");
}
}
public async Task<string?> GetValueAsync(string editorId)
{
try
{
return await _jsRuntime.InvokeAsync<string?>("markdownTablePaste.getValue", editorId);
}
catch (JSDisconnectedException)
{
return null;
}
catch (JSException ex)
{
_logger.LogWarning(ex, "Failed to read markdown editor {EditorId}", editorId);
return null;
}
}
public async Task<bool> SetValueAsync(string editorId, string text)
{
try
{
return await _jsRuntime.InvokeAsync<bool>("markdownTablePaste.setValue", editorId, text);
}
catch (JSDisconnectedException)
{
return false;
}
catch (JSException ex)
{
_logger.LogWarning(ex, "Failed to set markdown editor {EditorId}", editorId);
return false;
}
}
public async Task<bool> InsertAtCursorAsync(string editorId, string text)
{
try
{
return await _jsRuntime.InvokeAsync<bool>("markdownTablePaste.insertAtCursor", editorId, text);
}
catch (JSDisconnectedException)
{
return false;
}
catch (JSException ex)
{
_logger.LogWarning(ex, "Failed to insert into markdown editor {EditorId}", editorId);
return false;
}
}
}