@marimo-team/islands 0.23.9-dev4 → 0.23.9-dev41
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/dist/{ConnectedDataExplorerComponent-OzrfMM5L.js → ConnectedDataExplorerComponent-CyV83R2m.js} +4 -4
- package/dist/assets/__vite-browser-external-Ci2ZQfXU.js +1 -0
- package/dist/assets/{worker-CpBbwbQo.js → worker-ip3AI_sN.js} +2 -2
- package/dist/{chat-ui-BDI3FMI8.js → chat-ui-ChD4VvCo.js} +3060 -3033
- package/dist/{code-visibility-VZebNmSs.js → code-visibility-s3OWNKLN.js} +1634 -1314
- package/dist/{formats-DQ5qjo_Q.js → formats-DHxc-FdY.js} +1 -1
- package/dist/{glide-data-editor-DqRY9naW.js → glide-data-editor-BOmK9ETQ.js} +2 -2
- package/dist/{html-to-image-CiSinpSR.js → html-to-image-BHv7CEU_.js} +2145 -2153
- package/dist/{input-CZD2z6X2.js → input-_2sjvfne.js} +1 -1
- package/dist/main.js +1522 -1556
- package/dist/{mermaid-IU93XzmY.js → mermaid-lXOw5Py9.js} +2 -2
- package/dist/{process-output-5qJjMRKh.js → process-output-BvySRgli.js} +33 -25
- package/dist/{reveal-component-DZtPMEoM.js → reveal-component-DCO6zm_5.js} +17 -17
- package/dist/{spec-a6DaqW__.js → spec-B96zNUEA.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{toDate-ZVVIBmdk.js → toDate-x-WRDCH7.js} +1 -1
- package/dist/{useAsyncData-C008zUPi.js → useAsyncData-iRgKDT5s.js} +1 -1
- package/dist/{useDeepCompareMemoize-BrA3_n61.js → useDeepCompareMemoize-CkQ57VS2.js} +1 -1
- package/dist/{useLifecycle-BNaoJ5a4.js → useLifecycle-BBO9PIph.js} +1 -1
- package/dist/{useTheme-7O0YWlE5.js → useTheme-DHIrRQOe.js} +34 -21
- package/dist/{vega-component-DJNmOdUj.js → vega-component-Dq-SH463.js} +5 -5
- package/package.json +1 -1
- package/src/components/ai/__tests__/ai-utils.test.ts +43 -38
- package/src/components/ai/ai-model-dropdown.tsx +2 -2
- package/src/components/app-config/ai-config.tsx +147 -16
- package/src/components/app-config/user-config-form.tsx +37 -1
- package/src/components/chat/__tests__/chat-utils.test.ts +269 -0
- package/src/components/chat/chat-panel.tsx +38 -5
- package/src/components/chat/chat-utils.ts +14 -58
- package/src/components/data-table/TableBottomBar.tsx +27 -6
- package/src/components/data-table/TableTopBar.tsx +7 -1
- package/src/components/data-table/__tests__/TableBottomBar.test.tsx +73 -0
- package/src/components/data-table/__tests__/column-explorer.test.tsx +128 -0
- package/src/components/data-table/__tests__/data-table.test.tsx +52 -1
- package/src/components/data-table/__tests__/header-items.test.tsx +257 -1
- package/src/components/data-table/__tests__/useColumnVisibility.test.ts +42 -0
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +98 -26
- package/src/components/data-table/column-header.tsx +19 -12
- package/src/components/data-table/columns.tsx +3 -4
- package/src/components/data-table/data-table.tsx +37 -0
- package/src/components/data-table/export-actions.tsx +36 -18
- package/src/components/data-table/header-items.tsx +58 -17
- package/src/components/data-table/hooks/use-column-visibility.ts +56 -0
- package/src/components/data-table/pagination.tsx +16 -3
- package/src/components/data-table/schemas.ts +2 -2
- package/src/components/data-table/table-explorer-panel/table-explorer-panel.tsx +16 -6
- package/src/components/databases/display.tsx +2 -0
- package/src/components/datasources/__tests__/utils.test.ts +82 -0
- package/src/components/datasources/utils.ts +16 -15
- package/src/components/editor/actions/pair-with-agent-modal.tsx +1 -0
- package/src/components/editor/actions/useCellActionButton.tsx +3 -3
- package/src/components/editor/actions/useNotebookActions.tsx +5 -2
- package/src/components/editor/cell/code/cell-editor.tsx +7 -4
- package/src/components/editor/chrome/types.ts +13 -6
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +6 -4
- package/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx +10 -1
- package/src/components/editor/chrome/wrapper/sidebar.tsx +7 -5
- package/src/components/editor/errors/auto-fix.tsx +3 -3
- package/src/components/editor/errors/mangled-local-chip.tsx +50 -0
- package/src/components/editor/navigation/__tests__/navigation.test.ts +15 -0
- package/src/components/editor/navigation/navigation.ts +5 -0
- package/src/components/editor/output/MarimoErrorOutput.tsx +110 -27
- package/src/components/editor/output/MarimoTracebackOutput.tsx +55 -37
- package/src/components/editor/renderers/cell-array.tsx +27 -24
- package/src/components/editor/renderers/slides-layout/slides-layout.tsx +1 -1
- package/src/components/slides/reveal-component.tsx +3 -3
- package/src/components/slides/slide-form.tsx +11 -3
- package/src/components/static-html/static-banner.tsx +28 -22
- package/src/core/ai/__tests__/model-registry.test.ts +72 -60
- package/src/core/ai/model-registry.ts +33 -28
- package/src/core/cells/__tests__/actions.test.ts +48 -0
- package/src/core/cells/actions.ts +5 -6
- package/src/core/codemirror/__tests__/setup.test.ts +29 -0
- package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
- package/src/core/codemirror/cm.ts +3 -2
- package/src/core/codemirror/completion/hints.ts +4 -1
- package/src/core/codemirror/format.ts +1 -0
- package/src/core/codemirror/keymaps/vim.ts +63 -0
- package/src/core/codemirror/language/languages/sql/sql.ts +1 -0
- package/src/core/codemirror/language/languages/sql/utils.ts +2 -0
- package/src/core/config/__tests__/config-schema.test.ts +4 -0
- package/src/core/config/config-schema.ts +4 -0
- package/src/core/config/config.ts +16 -0
- package/src/css/app/Cell.css +0 -1
- package/src/plugins/impl/DataTablePlugin.tsx +94 -33
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +1 -0
- package/src/plugins/impl/chat/ChatPlugin.tsx +7 -1
- package/src/plugins/impl/chat/__tests__/chat-ui.test.ts +278 -0
- package/src/plugins/impl/chat/chat-ui.tsx +106 -59
- package/src/plugins/impl/chat/types.ts +5 -0
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +8 -6
- package/src/stories/dataframe.stories.tsx +1 -0
- package/src/utils/__tests__/json-parser.test.ts +1 -69
- package/src/utils/__tests__/local-variables.test.ts +132 -0
- package/src/utils/json/json-parser.ts +0 -30
- package/src/utils/local-variables.ts +67 -0
- package/dist/assets/__vite-browser-external-CAdMKBac.js +0 -1
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { expect, it } from "vitest";
|
|
3
|
-
import {
|
|
4
|
-
jsonParseWithSpecialChar,
|
|
5
|
-
jsonToMarkdown,
|
|
6
|
-
jsonToTSV,
|
|
7
|
-
} from "../json/json-parser";
|
|
3
|
+
import { jsonParseWithSpecialChar, jsonToMarkdown } from "../json/json-parser";
|
|
8
4
|
|
|
9
5
|
it("can jsonParseWithSpecialChar happy path", () => {
|
|
10
6
|
expect(jsonParseWithSpecialChar('"hello"')).toEqual("hello");
|
|
@@ -72,70 +68,6 @@ it("can parse bigInts", () => {
|
|
|
72
68
|
});
|
|
73
69
|
});
|
|
74
70
|
|
|
75
|
-
it("can convert json to tsv with en-US locale", () => {
|
|
76
|
-
const locale = "en-US";
|
|
77
|
-
|
|
78
|
-
expect(jsonToTSV([], locale)).toEqual("");
|
|
79
|
-
|
|
80
|
-
expect(jsonToTSV([{ a: 1, b: 2 }], locale)).toEqual("a\tb\n1\t2");
|
|
81
|
-
|
|
82
|
-
expect(
|
|
83
|
-
jsonToTSV(
|
|
84
|
-
[
|
|
85
|
-
{ a: 1, b: 2 },
|
|
86
|
-
{ a: 3, b: 4 },
|
|
87
|
-
],
|
|
88
|
-
locale,
|
|
89
|
-
),
|
|
90
|
-
).toEqual("a\tb\n1\t2\n3\t4");
|
|
91
|
-
|
|
92
|
-
// Does not handle sparse arrays
|
|
93
|
-
expect(jsonToTSV([{ a: 1 }, { a: 2, b: 3 }], locale)).toMatchInlineSnapshot(
|
|
94
|
-
'"a\n1\n2"',
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
// Handles special characters
|
|
98
|
-
expect(
|
|
99
|
-
jsonToTSV([{ a: "hello\tworld", b: "new\nline" }], locale),
|
|
100
|
-
).toMatchInlineSnapshot('"a\tb\nhello\tworld\tnew\nline"');
|
|
101
|
-
|
|
102
|
-
// Handles floats with en-US locale (uses . as decimal separator)
|
|
103
|
-
expect(jsonToTSV([{ a: 1.5, b: 2.7 }], locale)).toEqual("a\tb\n1.5\t2.7");
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it("can convert json to tsv with de-DE locale", () => {
|
|
107
|
-
const locale = "de-DE";
|
|
108
|
-
|
|
109
|
-
// Handles floats with de-DE locale (uses , as decimal separator)
|
|
110
|
-
expect(jsonToTSV([{ a: 1.5, b: 2.7 }], locale)).toEqual("a\tb\n1,5\t2,7");
|
|
111
|
-
|
|
112
|
-
// Handles integers (no change)
|
|
113
|
-
expect(jsonToTSV([{ a: 1, b: 2 }], locale)).toEqual("a\tb\n1\t2");
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("can convert json to tsv with fr-FR locale", () => {
|
|
117
|
-
const locale = "fr-FR";
|
|
118
|
-
|
|
119
|
-
// Handles floats with fr-FR locale (uses , as decimal separator)
|
|
120
|
-
expect(jsonToTSV([{ a: 3.14, b: 2.123_45 }], locale)).toEqual(
|
|
121
|
-
"a\tb\n3,14\t2,12345",
|
|
122
|
-
);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("handles null and undefined values in TSV", () => {
|
|
126
|
-
const locale = "en-US";
|
|
127
|
-
|
|
128
|
-
expect(jsonToTSV([{ a: null, b: undefined, c: 1 }], locale)).toEqual(
|
|
129
|
-
"a\tb\tc\n\t\t1",
|
|
130
|
-
);
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it("handles NaN values in TSV", () => {
|
|
134
|
-
const locale = "en-US";
|
|
135
|
-
|
|
136
|
-
expect(jsonToTSV([{ a: Number.NaN, b: 1 }], locale)).toEqual("a\tb\nNaN\t1");
|
|
137
|
-
});
|
|
138
|
-
|
|
139
71
|
it("can convert json to markdown - basic table", () => {
|
|
140
72
|
expect(jsonToMarkdown([])).toMatchInlineSnapshot(`""`);
|
|
141
73
|
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import {
|
|
4
|
+
containsMangledLocal,
|
|
5
|
+
splitMangledLocals,
|
|
6
|
+
unmangleLocal,
|
|
7
|
+
} from "../local-variables";
|
|
8
|
+
|
|
9
|
+
describe("unmangleLocal", () => {
|
|
10
|
+
it("extracts the cell id and original name", () => {
|
|
11
|
+
expect(unmangleLocal("_cell_Hbol_a")).toEqual({
|
|
12
|
+
cellId: "Hbol",
|
|
13
|
+
name: "_a",
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("handles names with multiple underscore segments", () => {
|
|
18
|
+
expect(unmangleLocal("_cell_Hbol_a_b")).toEqual({
|
|
19
|
+
cellId: "Hbol",
|
|
20
|
+
name: "_a_b",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("returns null for non-mangled strings", () => {
|
|
25
|
+
expect(unmangleLocal("just_a_variable")).toBeNull();
|
|
26
|
+
expect(unmangleLocal("_private")).toBeNull();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("handles the single-underscore local", () => {
|
|
30
|
+
// `_` is a valid local name (variables.py:62-63), mangling to
|
|
31
|
+
// `_cell_<id>_` with no trailing suffix.
|
|
32
|
+
expect(unmangleLocal("_cell_Hbol_")).toEqual({
|
|
33
|
+
cellId: "Hbol",
|
|
34
|
+
name: "_",
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("handles UUID-style cell ids", () => {
|
|
39
|
+
// External / VSCode notebooks use `external_prefix()` which is a
|
|
40
|
+
// `uuid4()` (hyphenated).
|
|
41
|
+
expect(
|
|
42
|
+
unmangleLocal("_cell_c9bf9e57-1685-4c89-bafb-ff5af830be8a_a"),
|
|
43
|
+
).toEqual({
|
|
44
|
+
cellId: "c9bf9e57-1685-4c89-bafb-ff5af830be8a",
|
|
45
|
+
name: "_a",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("does not match marimo cell file paths", () => {
|
|
50
|
+
// The compiled cell file is `__marimo__cell_<id>_.py` (two leading
|
|
51
|
+
// underscores, trailing `_` with no name); it must not be confused with a
|
|
52
|
+
// mangled local.
|
|
53
|
+
expect(unmangleLocal("__marimo__cell_Hbol_.py")).toBeNull();
|
|
54
|
+
expect(unmangleLocal("/tmp/marimo_42/__marimo__cell_Hbol_.py")).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe("splitMangledLocals", () => {
|
|
59
|
+
it("returns a single text segment when nothing matches", () => {
|
|
60
|
+
expect(splitMangledLocals("plain text")).toEqual(["plain text"]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("splits a NameError message", () => {
|
|
64
|
+
expect(splitMangledLocals("name '_cell_Hbol_a' is not defined")).toEqual([
|
|
65
|
+
"name '",
|
|
66
|
+
{ cellId: "Hbol", name: "_a" },
|
|
67
|
+
"' is not defined",
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("handles multiple mangled names in one string", () => {
|
|
72
|
+
expect(splitMangledLocals("_cell_AAAA_x and _cell_BBBB_y")).toEqual([
|
|
73
|
+
{ cellId: "AAAA", name: "_x" },
|
|
74
|
+
" and ",
|
|
75
|
+
{ cellId: "BBBB", name: "_y" },
|
|
76
|
+
]);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("leaves the cell file path alone", () => {
|
|
80
|
+
const path = "/tmp/marimo_42/__marimo__cell_Hbol_.py";
|
|
81
|
+
expect(splitMangledLocals(path)).toEqual([path]);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("ignores `_cell_...` substrings preceded by `_`", () => {
|
|
85
|
+
// Mirrors `(?<!_)` in `variables.py`: a leading `_` (e.g. inside
|
|
86
|
+
// `__marimo__cell_<id>_<...>`) means this is not a mangle the compiler
|
|
87
|
+
// produced, so we must not demangle it.
|
|
88
|
+
const text = "see __marimo__cell_Hbol_a for details";
|
|
89
|
+
expect(splitMangledLocals(text)).toEqual([text]);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("splits a UUID-style cell id", () => {
|
|
93
|
+
expect(
|
|
94
|
+
splitMangledLocals(
|
|
95
|
+
"name '_cell_c9bf9e57-1685-4c89-bafb-ff5af830be8a_a' is not defined",
|
|
96
|
+
),
|
|
97
|
+
).toEqual([
|
|
98
|
+
"name '",
|
|
99
|
+
{
|
|
100
|
+
cellId: "c9bf9e57-1685-4c89-bafb-ff5af830be8a",
|
|
101
|
+
name: "_a",
|
|
102
|
+
},
|
|
103
|
+
"' is not defined",
|
|
104
|
+
]);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("splits the single-underscore local", () => {
|
|
108
|
+
expect(splitMangledLocals("name '_cell_Hbol_' is not defined")).toEqual([
|
|
109
|
+
"name '",
|
|
110
|
+
{ cellId: "Hbol", name: "_" },
|
|
111
|
+
"' is not defined",
|
|
112
|
+
]);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe("containsMangledLocal", () => {
|
|
117
|
+
it("detects mangled names", () => {
|
|
118
|
+
expect(containsMangledLocal("name '_cell_Hbol_a' is not defined")).toBe(
|
|
119
|
+
true,
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("ignores the cell file path", () => {
|
|
124
|
+
expect(containsMangledLocal("/tmp/marimo_42/__marimo__cell_Hbol_.py")).toBe(
|
|
125
|
+
false,
|
|
126
|
+
);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("ignores `_cell_...` substrings preceded by `_`", () => {
|
|
130
|
+
expect(containsMangledLocal("see __marimo__cell_Hbol_a")).toBe(false);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
@@ -66,36 +66,6 @@ export function jsonParseWithSpecialChar<T = unknown>(
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
* Formats a value for TSV export, respecting user's locale for numbers
|
|
71
|
-
*/
|
|
72
|
-
function formatValueForTSV(value: unknown, locale: string): string {
|
|
73
|
-
if (value === null || value === undefined) {
|
|
74
|
-
return "";
|
|
75
|
-
}
|
|
76
|
-
if (typeof value === "number" && !Number.isNaN(value)) {
|
|
77
|
-
// Use toLocaleString to format numbers according to user's locale
|
|
78
|
-
// This will use the appropriate decimal separator (e.g., "," in European locales)
|
|
79
|
-
return value.toLocaleString(locale, {
|
|
80
|
-
useGrouping: false,
|
|
81
|
-
maximumFractionDigits: 20,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return String(value);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function jsonToTSV(json: Record<string, unknown>[], locale: string) {
|
|
88
|
-
if (json.length === 0) {
|
|
89
|
-
return "";
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const keys = Object.keys(json[0]);
|
|
93
|
-
const values = json.map((row) =>
|
|
94
|
-
keys.map((key) => formatValueForTSV(row[key], locale)).join("\t"),
|
|
95
|
-
);
|
|
96
|
-
return `${keys.join("\t")}\n${values.join("\n")}`;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
69
|
/**
|
|
100
70
|
* Converts JSON data to a Markdown table format
|
|
101
71
|
* Detects URLs and converts them to markdown links [url](url)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import type { CellId } from "@/core/cells/ids";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The marimo compiler rewrites underscore-prefixed references inside a cell
|
|
6
|
+
* (which Python would treat as module-private) into `_cell_<cell_id>_<name>`
|
|
7
|
+
* so each cell gets its own private namespace. When such a reference fails at
|
|
8
|
+
* runtime (`NameError: name '_cell_Hbol_a' is not defined`), the mangled name
|
|
9
|
+
* leaks into the error UI. These helpers undo that mangling for display.
|
|
10
|
+
*
|
|
11
|
+
* Mirrors `marimo/_ast/variables.py`.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Matches `_cell_<cell_id><name>` for normal ids and UUIDs. The `[\w-]`
|
|
15
|
+
// id class admits hyphens; the `_\w*` name group admits the bare `_`
|
|
16
|
+
// local; the `(?<!_)` lookbehind skips `__marimo__cell_...` paths.
|
|
17
|
+
// Mirrors `_MANGLED_LOCAL_IN_TEXT_RE` in `variables.py`.
|
|
18
|
+
const MANGLED_LOCAL_BODY = String.raw`_cell_([^\W_][\w-]*?)(_\w*)`;
|
|
19
|
+
const MANGLED_LOCAL_PATTERN = String.raw`(?<!_)${MANGLED_LOCAL_BODY}`;
|
|
20
|
+
// Strict (whole-string) form for `unmangleLocal`; the leading `^` makes the
|
|
21
|
+
// lookbehind trivially satisfied, so use the bare body.
|
|
22
|
+
const ANCHORED_RE = new RegExp(`^${MANGLED_LOCAL_BODY}$`);
|
|
23
|
+
const UNANCHORED_RE = new RegExp(MANGLED_LOCAL_PATTERN);
|
|
24
|
+
const GLOBAL_RE = new RegExp(MANGLED_LOCAL_PATTERN, "g");
|
|
25
|
+
|
|
26
|
+
export interface UnmangledLocal {
|
|
27
|
+
cellId: CellId;
|
|
28
|
+
/** The original underscore-prefixed name, e.g. "_a". */
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function unmangleLocal(mangled: string): UnmangledLocal | null {
|
|
33
|
+
const match = ANCHORED_RE.exec(mangled);
|
|
34
|
+
if (!match) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return { cellId: match[1] as CellId, name: match[2] };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type MangledSegment = string | UnmangledLocal;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Split a plain text string into alternating literal text and unmangled-local
|
|
44
|
+
* segments, so callers can render mixed React content.
|
|
45
|
+
*/
|
|
46
|
+
export function splitMangledLocals(text: string): MangledSegment[] {
|
|
47
|
+
const segments: MangledSegment[] = [];
|
|
48
|
+
GLOBAL_RE.lastIndex = 0;
|
|
49
|
+
let lastIndex = 0;
|
|
50
|
+
let match: RegExpExecArray | null = GLOBAL_RE.exec(text);
|
|
51
|
+
while (match !== null) {
|
|
52
|
+
if (match.index > lastIndex) {
|
|
53
|
+
segments.push(text.slice(lastIndex, match.index));
|
|
54
|
+
}
|
|
55
|
+
segments.push({ cellId: match[1] as CellId, name: match[2] });
|
|
56
|
+
lastIndex = match.index + match[0].length;
|
|
57
|
+
match = GLOBAL_RE.exec(text);
|
|
58
|
+
}
|
|
59
|
+
if (lastIndex < text.length) {
|
|
60
|
+
segments.push(text.slice(lastIndex));
|
|
61
|
+
}
|
|
62
|
+
return segments;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function containsMangledLocal(text: string): boolean {
|
|
66
|
+
return UNANCHORED_RE.test(text);
|
|
67
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./worker-CpBbwbQo.js";var t=e(((e,t)=>{t.exports={}}));export default t();
|