@marimo-team/islands 0.23.14-dev16 → 0.23.14-dev19

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.
@@ -1,27 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { SQLParser } from "@marimo-team/smart-cells";
4
-
5
- export type SnippetLanguage = "python" | "sql";
6
-
7
- export interface SnippetDisplay {
8
- language: SnippetLanguage;
9
- value: string;
10
- }
11
-
12
- const sqlParser = new SQLParser();
13
-
14
- /**
15
- * Decide how a snippet's code should be shown in the panel.
16
- *
17
- * SQL cells are stored as python `mo.sql(...)`. Unwrap the inner query and
18
- * highlight it as SQL, matching how the cell renders once the snippet is
19
- * inserted. Everything else stays python.
20
- */
21
- export function getSnippetDisplay(code: string): SnippetDisplay {
22
- if (sqlParser.isSupported(code)) {
23
- const { code: query } = sqlParser.transformIn(code);
24
- return { language: "sql", value: query };
25
- }
26
- return { language: "python", value: code };
27
- }