@bian-womp/spark-workbench 0.2.91 → 0.2.92
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/lib/cjs/index.cjs +5 -4
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/thumbnail-utils.d.ts +4 -0
- package/lib/cjs/src/misc/thumbnail-utils.d.ts.map +1 -1
- package/lib/esm/index.js +5 -4
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/thumbnail-utils.d.ts +4 -0
- package/lib/esm/src/misc/thumbnail-utils.d.ts.map +1 -1
- package/package.json +4 -4
package/lib/cjs/index.cjs
CHANGED
|
@@ -3369,16 +3369,16 @@ function extractNodes(viewport, visibleBounds, options = {}) {
|
|
|
3369
3369
|
* Creates SVG element with dot pattern background (matching React Flow)
|
|
3370
3370
|
*/
|
|
3371
3371
|
function createSVGElement(width, height, options = {}) {
|
|
3372
|
-
const { exportBackgroundPattern = true, backgroundPatternColor = "#f1f1f1" } = options;
|
|
3372
|
+
const { exportBackgroundPattern = true, backgroundPatternColor = "#f1f1f1", backgroundColor = "#ffffff", } = options;
|
|
3373
3373
|
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3374
3374
|
svg.setAttribute("width", String(width));
|
|
3375
3375
|
svg.setAttribute("height", String(height));
|
|
3376
3376
|
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
3377
|
-
// Create background rectangle with
|
|
3377
|
+
// Create background rectangle with configurable background color
|
|
3378
3378
|
const bgRect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
3379
3379
|
bgRect.setAttribute("width", String(width));
|
|
3380
3380
|
bgRect.setAttribute("height", String(height));
|
|
3381
|
-
bgRect.setAttribute("fill",
|
|
3381
|
+
bgRect.setAttribute("fill", backgroundColor);
|
|
3382
3382
|
svg.appendChild(bgRect);
|
|
3383
3383
|
// Create dot pattern if enabled
|
|
3384
3384
|
if (exportBackgroundPattern) {
|
|
@@ -3501,7 +3501,7 @@ function renderContentToSVG(group, nodes, edges, transformX, transformY, options
|
|
|
3501
3501
|
* @returns Promise resolving to SVG data URL string, or null if capture fails
|
|
3502
3502
|
*/
|
|
3503
3503
|
async function captureCanvasThumbnail(containerElement, options = {}) {
|
|
3504
|
-
const { ignoreViewport = true, padding = 40, exportHandles = true, exportNodeTitle = true, exportBackgroundPattern = true, nodeBackgroundColor, backgroundPatternColor, } = options;
|
|
3504
|
+
const { ignoreViewport = true, padding = 40, exportHandles = true, exportNodeTitle = true, exportBackgroundPattern = true, nodeBackgroundColor, backgroundPatternColor, backgroundColor, } = options;
|
|
3505
3505
|
if (!containerElement) {
|
|
3506
3506
|
console.warn("[flowThumbnail] Container element is null");
|
|
3507
3507
|
return null;
|
|
@@ -3584,6 +3584,7 @@ async function captureCanvasThumbnail(containerElement, options = {}) {
|
|
|
3584
3584
|
const { svg, group } = createSVGElement(contentWidth, contentHeight, {
|
|
3585
3585
|
exportBackgroundPattern,
|
|
3586
3586
|
backgroundPatternColor,
|
|
3587
|
+
backgroundColor,
|
|
3587
3588
|
});
|
|
3588
3589
|
// Render content with options
|
|
3589
3590
|
renderContentToSVG(group, nodes, edges, -contentMinX, -contentMinY, {
|