clay-server 2.25.0 → 2.26.0-beta.1
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.
|
@@ -187,22 +187,18 @@ export function svgToPngDataUrl(svgEl) {
|
|
|
187
187
|
var svgBlob = new Blob([svgStr], { type: "image/svg+xml;charset=utf-8" });
|
|
188
188
|
var url = URL.createObjectURL(svgBlob);
|
|
189
189
|
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
} catch (e) {}
|
|
198
|
-
// Strip any external references (url(), @import) that would taint the canvas
|
|
199
|
-
svgStr = svgStr.replace(/@import\s+url\([^)]*\)[^;]*;?/g, "");
|
|
190
|
+
// Strip all external references that would taint the canvas
|
|
191
|
+
// 1. @import rules
|
|
192
|
+
svgStr = svgStr.replace(/@import\s+[^;]*;?/g, "");
|
|
193
|
+
// 2. CSS url() pointing to external resources (keep data: and fragment-only refs)
|
|
194
|
+
svgStr = svgStr.replace(/url\(\s*['"]?(?!data:|#)([^'")]+)['"]?\s*\)/g, "url()");
|
|
195
|
+
// 3. xlink:href / href attributes pointing to external URLs
|
|
196
|
+
svgStr = svgStr.replace(/(xlink:href|href)\s*=\s*["'](?!#|data:)[^"']*["']/g, '$1=""');
|
|
200
197
|
svgBlob = new Blob([svgStr], { type: "image/svg+xml;charset=utf-8" });
|
|
201
198
|
URL.revokeObjectURL(url);
|
|
202
199
|
url = URL.createObjectURL(svgBlob);
|
|
203
200
|
|
|
204
201
|
var img = new Image();
|
|
205
|
-
img.crossOrigin = "anonymous";
|
|
206
202
|
img.onload = function () {
|
|
207
203
|
var canvas = document.createElement("canvas");
|
|
208
204
|
canvas.width = w;
|
|
@@ -1615,8 +1615,12 @@ function renderSheetTools(listEl) {
|
|
|
1615
1615
|
var isMateDm = document.body.classList.contains("mate-dm-active");
|
|
1616
1616
|
|
|
1617
1617
|
var items = isMateDm ? [
|
|
1618
|
+
{ icon: "brain", label: "Memory", action: "mate-memory" },
|
|
1618
1619
|
{ icon: "book-open", label: "Knowledge", action: "mate-knowledge" },
|
|
1619
|
-
{ icon: "
|
|
1620
|
+
{ icon: "sticky-note", label: "Sticky Notes", action: "mate-sticky" },
|
|
1621
|
+
{ icon: "puzzle", label: "Skills", action: "mate-skills" },
|
|
1622
|
+
{ icon: "calendar-clock", label: "Scheduled Tasks", action: "mate-scheduler" },
|
|
1623
|
+
{ icon: "mic", label: "Debate", action: "mate-debate" }
|
|
1620
1624
|
] : [
|
|
1621
1625
|
{ icon: "folder-tree", label: "Files", action: "files" },
|
|
1622
1626
|
{ icon: "square-terminal", label: "Terminal", action: "terminal" },
|
|
@@ -1641,11 +1645,15 @@ function renderSheetTools(listEl) {
|
|
|
1641
1645
|
setTimeout(function () { openMobileSheet("mate-knowledge"); }, 250);
|
|
1642
1646
|
return;
|
|
1643
1647
|
} else if (item.action === "mate-sticky") {
|
|
1644
|
-
targetId = "sticky-notes-
|
|
1648
|
+
targetId = "mate-sticky-notes-btn";
|
|
1645
1649
|
} else if (item.action === "mate-skills") {
|
|
1646
1650
|
targetId = "mate-skills-btn";
|
|
1651
|
+
} else if (item.action === "mate-memory") {
|
|
1652
|
+
targetId = "mate-memory-btn";
|
|
1647
1653
|
} else if (item.action === "mate-scheduler") {
|
|
1648
1654
|
targetId = "mate-scheduler-btn";
|
|
1655
|
+
} else if (item.action === "mate-debate") {
|
|
1656
|
+
targetId = "mate-debate-btn";
|
|
1649
1657
|
}
|
|
1650
1658
|
if (targetId) {
|
|
1651
1659
|
var targetBtn = document.getElementById(targetId);
|