@marimo-team/islands 0.19.8-dev19 → 0.19.8-dev21
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/main.js
CHANGED
|
@@ -51305,7 +51305,7 @@ Database schema: ${c}`), (_a3 = r2.aiFix) == null ? void 0 : _a3.setAiCompletion
|
|
|
51305
51305
|
type: "image",
|
|
51306
51306
|
url: e
|
|
51307
51307
|
}
|
|
51308
|
-
] : e.split(urlRegex).filter((e2) => e2
|
|
51308
|
+
] : e.split(urlRegex).filter((e2) => e2 !== "").map((e2) => urlRegex.test(e2) ? imageRegex.test(e2) || dataImageRegex.test(e2) || knownImageDomains.some((r) => e2.includes(r)) ? {
|
|
51309
51309
|
type: "image",
|
|
51310
51310
|
url: e2
|
|
51311
51311
|
} : {
|
|
@@ -73176,7 +73176,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
73176
73176
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
73177
73177
|
}
|
|
73178
73178
|
}
|
|
73179
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.8-
|
|
73179
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.8-dev21"), showCodeInRunModeAtom = atom(true);
|
|
73180
73180
|
atom(null);
|
|
73181
73181
|
var import_compiler_runtime$88 = require_compiler_runtime();
|
|
73182
73182
|
function useKeydownOnElement(e, r) {
|
package/package.json
CHANGED
|
@@ -609,9 +609,13 @@ export const CustomProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
609
609
|
const isDuplicate =
|
|
610
610
|
KNOWN_PROVIDERS.includes(normalizedName as KnownProviderId) ||
|
|
611
611
|
(customProviders && Object.keys(customProviders).includes(normalizedName));
|
|
612
|
+
const hasInvalidChars = normalizedName.includes(".");
|
|
612
613
|
|
|
613
614
|
const hasValidValues =
|
|
614
|
-
normalizedName.trim() &&
|
|
615
|
+
normalizedName.trim() &&
|
|
616
|
+
newProviderBaseUrl.trim() &&
|
|
617
|
+
!isDuplicate &&
|
|
618
|
+
!hasInvalidChars;
|
|
615
619
|
|
|
616
620
|
const resetForm = () => {
|
|
617
621
|
setNewProviderName("");
|
|
@@ -669,7 +673,12 @@ export const CustomProvidersConfig: React.FC<AiConfigProps> = ({
|
|
|
669
673
|
A provider with this name already exists.
|
|
670
674
|
</p>
|
|
671
675
|
)}
|
|
672
|
-
{
|
|
676
|
+
{hasInvalidChars && (
|
|
677
|
+
<p className="text-xs text-destructive">
|
|
678
|
+
Provider names cannot contain '.' characters.
|
|
679
|
+
</p>
|
|
680
|
+
)}
|
|
681
|
+
{newProviderName && !hasInvalidChars && (
|
|
673
682
|
<p className="text-xs text-muted-secondary">
|
|
674
683
|
Use models with prefix:{" "}
|
|
675
684
|
<Kbd className="inline text-xs">{normalizedName}/</Kbd>
|
|
@@ -76,4 +76,26 @@ describe("parseContent", () => {
|
|
|
76
76
|
url: "https://avatars.githubusercontent.com/u/123",
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
+
|
|
80
|
+
it("preserves newlines between URLs", () => {
|
|
81
|
+
const parts = parseContent("https://marimo.io\nhttps://github.com\n");
|
|
82
|
+
expect(parts).toEqual([
|
|
83
|
+
{ type: "url", url: "https://marimo.io" },
|
|
84
|
+
{ type: "text", value: "\n" },
|
|
85
|
+
{ type: "url", url: "https://github.com" },
|
|
86
|
+
{ type: "text", value: "\n" },
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("preserves whitespace in mixed content", () => {
|
|
91
|
+
const parts = parseContent(
|
|
92
|
+
"Line 1: https://marimo.io\nLine 2: https://github.com",
|
|
93
|
+
);
|
|
94
|
+
expect(parts).toEqual([
|
|
95
|
+
{ type: "text", value: "Line 1: " },
|
|
96
|
+
{ type: "url", url: "https://marimo.io" },
|
|
97
|
+
{ type: "text", value: "\nLine 2: " },
|
|
98
|
+
{ type: "url", url: "https://github.com" },
|
|
99
|
+
]);
|
|
100
|
+
});
|
|
79
101
|
});
|
package/src/utils/url-parser.ts
CHANGED
|
@@ -19,7 +19,7 @@ export function parseContent(text: string): ContentPart[] {
|
|
|
19
19
|
return [{ type: "image", url: text }];
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const parts = text.split(urlRegex).filter((part) => part
|
|
22
|
+
const parts = text.split(urlRegex).filter((part) => part !== "");
|
|
23
23
|
return parts.map((part) => {
|
|
24
24
|
const isUrl = urlRegex.test(part);
|
|
25
25
|
if (isUrl) {
|