canvas-ui-sdk 0.3.3 → 0.3.5

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/index.js CHANGED
@@ -27392,8 +27392,13 @@ function generateBakePrompt(theme) {
27392
27392
  lines.push("");
27393
27393
  sections.push(lines.join("\n"));
27394
27394
  }
27395
- sectionNum++;
27396
- {
27395
+ const brandingChanged = theme.branding.iconShape !== defaultBranding.iconShape || theme.branding.iconName !== defaultBranding.iconName || theme.branding.bgColor !== defaultBranding.bgColor || theme.branding.iconColor !== defaultBranding.iconColor || theme.branding.wordmark !== defaultBranding.wordmark;
27396
+ const imageKeys = ["logoLight", "logoDark", "faviconLight", "faviconDark"];
27397
+ const imagesChanged = imageKeys.some(
27398
+ (key) => (theme.images[key] || "") !== (defaultImages[key] || "")
27399
+ );
27400
+ if (brandingChanged || imagesChanged) {
27401
+ sectionNum++;
27397
27402
  const lines = [];
27398
27403
  lines.push(`## ${sectionNum}. Update \`src/lib/theme-config.ts\``);
27399
27404
  lines.push("");
@@ -27412,7 +27417,6 @@ function generateBakePrompt(theme) {
27412
27417
  lines.push(`};`);
27413
27418
  lines.push("");
27414
27419
  lines.push(`export const savedImages: Record<ImageKey, string> = {`);
27415
- const imageKeys = ["logoLight", "logoDark", "faviconLight", "faviconDark"];
27416
27420
  for (const key of imageKeys) {
27417
27421
  lines.push(` ${key}: "${theme.images[key] || ""}",`);
27418
27422
  }
@@ -27474,49 +27478,73 @@ function ExportPanel({ theme }) {
27474
27478
  children: theme.isDirty ? `${overrideCount} variable${overrideCount !== 1 ? "s" : ""} modified` : "No modifications \u2014 using defaults"
27475
27479
  }
27476
27480
  ),
27477
- overrideCount > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
27478
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
27481
+ overrideCount > 0 && (() => {
27482
+ const prompt = generateBakePrompt(theme);
27483
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
27484
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
27485
+ /* @__PURE__ */ jsx(
27486
+ "h3",
27487
+ {
27488
+ style: {
27489
+ fontSize: "13px",
27490
+ fontWeight: 600,
27491
+ color: "#374151",
27492
+ textTransform: "uppercase",
27493
+ letterSpacing: "0.05em"
27494
+ },
27495
+ children: "Bake into source code"
27496
+ }
27497
+ ),
27498
+ /* @__PURE__ */ jsx(
27499
+ "button",
27500
+ {
27501
+ onClick: () => handleCopy(prompt),
27502
+ style: {
27503
+ fontSize: "12px",
27504
+ color: copyStatus === "bake" ? "#059669" : "#1165ef",
27505
+ background: "none",
27506
+ border: "none",
27507
+ cursor: "pointer",
27508
+ fontWeight: 500
27509
+ },
27510
+ children: copyStatus === "bake" ? "Copied!" : "Copy prompt"
27511
+ }
27512
+ )
27513
+ ] }),
27479
27514
  /* @__PURE__ */ jsx(
27480
- "h3",
27515
+ "p",
27481
27516
  {
27482
27517
  style: {
27483
- fontSize: "13px",
27484
- fontWeight: 600,
27485
- color: "#374151",
27486
- textTransform: "uppercase",
27487
- letterSpacing: "0.05em"
27518
+ fontSize: "12px",
27519
+ color: "#6b7280",
27520
+ lineHeight: "1.4"
27488
27521
  },
27489
- children: "Bake into source code"
27522
+ children: "Copies a prompt for Claude Code that updates your source files with the current theme values."
27490
27523
  }
27491
27524
  ),
27492
27525
  /* @__PURE__ */ jsx(
27493
- "button",
27526
+ "pre",
27494
27527
  {
27495
- onClick: () => handleCopy(generateBakePrompt(theme)),
27496
27528
  style: {
27497
- fontSize: "12px",
27498
- color: copyStatus === "bake" ? "#059669" : "#1165ef",
27499
- background: "none",
27500
- border: "none",
27501
- cursor: "pointer",
27502
- fontWeight: 500
27529
+ fontSize: "11px",
27530
+ fontFamily: "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace",
27531
+ background: "#f9fafb",
27532
+ border: "1px solid #e5e7eb",
27533
+ borderRadius: "6px",
27534
+ padding: "12px",
27535
+ maxHeight: "300px",
27536
+ overflow: "auto",
27537
+ whiteSpace: "pre-wrap",
27538
+ wordBreak: "break-word",
27539
+ color: "#374151",
27540
+ lineHeight: "1.5",
27541
+ margin: 0
27503
27542
  },
27504
- children: copyStatus === "bake" ? "Copied!" : "Copy prompt"
27543
+ children: prompt
27505
27544
  }
27506
27545
  )
27507
- ] }),
27508
- /* @__PURE__ */ jsx(
27509
- "p",
27510
- {
27511
- style: {
27512
- fontSize: "12px",
27513
- color: "#6b7280",
27514
- lineHeight: "1.4"
27515
- },
27516
- children: "Copies a prompt for Claude Code that updates your source files with the current theme values."
27517
- }
27518
- )
27519
- ] }),
27546
+ ] });
27547
+ })(),
27520
27548
  theme.isDirty && /* @__PURE__ */ jsx(
27521
27549
  "div",
27522
27550
  {