@wireweave/core 1.4.0-beta.0 → 1.4.0-beta.2

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.cjs CHANGED
@@ -7069,8 +7069,8 @@ img.${prefix}-image {
7069
7069
  .${prefix}-badge-dot.${prefix}-badge-primary { background: var(--${prefix}-primary); border-color: var(--${prefix}-primary); }
7070
7070
 
7071
7071
  .${prefix}-badge-default { }
7072
- .${prefix}-badge-primary { background: var(--${prefix}-primary); color: white; border-color: var(--${prefix}-primary); }
7073
- .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: white; border-color: var(--${prefix}-muted); }
7072
+ .${prefix}-badge-primary { background: var(--${prefix}-primary); color: var(--${prefix}-bg); border-color: var(--${prefix}-primary); }
7073
+ .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: var(--${prefix}-bg); border-color: var(--${prefix}-muted); }
7074
7074
  .${prefix}-badge-success { border-color: var(--${prefix}-success); }
7075
7075
  .${prefix}-badge-warning { border-color: var(--${prefix}-warning); }
7076
7076
  .${prefix}-badge-danger { border-color: var(--${prefix}-danger); }
@@ -8043,20 +8043,12 @@ var BaseRenderer = class {
8043
8043
  }
8044
8044
  /**
8045
8045
  * Build theme configuration based on options
8046
- * If background option is provided, it overrides the theme's default background
8046
+ * Note: background option is NOT applied to theme.colors.background
8047
+ * It's only used for page background in renderPage() to avoid affecting
8048
+ * component colors that use var(--wf-bg)
8047
8049
  */
8048
8050
  buildTheme(options) {
8049
- const baseTheme = options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
8050
- if (options.background !== void 0) {
8051
- return {
8052
- ...baseTheme,
8053
- colors: {
8054
- ...baseTheme.colors,
8055
- background: options.background
8056
- }
8057
- };
8058
- }
8059
- return baseTheme;
8051
+ return options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
8060
8052
  }
8061
8053
  /**
8062
8054
  * Render a wireframe document to HTML and CSS
@@ -55682,7 +55674,10 @@ var HtmlRenderer = class extends BaseRenderer {
55682
55674
  const title = node.title ? `<title>${this.escapeHtml(node.title)}</title>
55683
55675
  ` : "";
55684
55676
  const commonStyles = this.buildCommonStyles(node);
55685
- const viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
55677
+ let viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
55678
+ if (this.context.options.background) {
55679
+ viewportStyle += `; background: ${this.context.options.background}`;
55680
+ }
55686
55681
  const combinedStyle = commonStyles ? `${viewportStyle}; ${commonStyles}` : viewportStyle;
55687
55682
  const dataAttrs = `data-viewport-width="${viewport.width}" data-viewport-height="${viewport.height}" data-viewport-label="${viewport.label}"`;
55688
55683
  return `<div class="${classes}" style="${combinedStyle}" ${dataAttrs}>
package/dist/index.js CHANGED
@@ -6929,8 +6929,8 @@ img.${prefix}-image {
6929
6929
  .${prefix}-badge-dot.${prefix}-badge-primary { background: var(--${prefix}-primary); border-color: var(--${prefix}-primary); }
6930
6930
 
6931
6931
  .${prefix}-badge-default { }
6932
- .${prefix}-badge-primary { background: var(--${prefix}-primary); color: white; border-color: var(--${prefix}-primary); }
6933
- .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: white; border-color: var(--${prefix}-muted); }
6932
+ .${prefix}-badge-primary { background: var(--${prefix}-primary); color: var(--${prefix}-bg); border-color: var(--${prefix}-primary); }
6933
+ .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: var(--${prefix}-bg); border-color: var(--${prefix}-muted); }
6934
6934
  .${prefix}-badge-success { border-color: var(--${prefix}-success); }
6935
6935
  .${prefix}-badge-warning { border-color: var(--${prefix}-warning); }
6936
6936
  .${prefix}-badge-danger { border-color: var(--${prefix}-danger); }
@@ -7903,20 +7903,12 @@ var BaseRenderer = class {
7903
7903
  }
7904
7904
  /**
7905
7905
  * Build theme configuration based on options
7906
- * If background option is provided, it overrides the theme's default background
7906
+ * Note: background option is NOT applied to theme.colors.background
7907
+ * It's only used for page background in renderPage() to avoid affecting
7908
+ * component colors that use var(--wf-bg)
7907
7909
  */
7908
7910
  buildTheme(options) {
7909
- const baseTheme = options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
7910
- if (options.background !== void 0) {
7911
- return {
7912
- ...baseTheme,
7913
- colors: {
7914
- ...baseTheme.colors,
7915
- background: options.background
7916
- }
7917
- };
7918
- }
7919
- return baseTheme;
7911
+ return options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
7920
7912
  }
7921
7913
  /**
7922
7914
  * Render a wireframe document to HTML and CSS
@@ -55542,7 +55534,10 @@ var HtmlRenderer = class extends BaseRenderer {
55542
55534
  const title = node.title ? `<title>${this.escapeHtml(node.title)}</title>
55543
55535
  ` : "";
55544
55536
  const commonStyles = this.buildCommonStyles(node);
55545
- const viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
55537
+ let viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
55538
+ if (this.context.options.background) {
55539
+ viewportStyle += `; background: ${this.context.options.background}`;
55540
+ }
55546
55541
  const combinedStyle = commonStyles ? `${viewportStyle}; ${commonStyles}` : viewportStyle;
55547
55542
  const dataAttrs = `data-viewport-width="${viewport.width}" data-viewport-height="${viewport.height}" data-viewport-label="${viewport.label}"`;
55548
55543
  return `<div class="${classes}" style="${combinedStyle}" ${dataAttrs}>
package/dist/renderer.cjs CHANGED
@@ -749,8 +749,8 @@ img.${prefix}-image {
749
749
  .${prefix}-badge-dot.${prefix}-badge-primary { background: var(--${prefix}-primary); border-color: var(--${prefix}-primary); }
750
750
 
751
751
  .${prefix}-badge-default { }
752
- .${prefix}-badge-primary { background: var(--${prefix}-primary); color: white; border-color: var(--${prefix}-primary); }
753
- .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: white; border-color: var(--${prefix}-muted); }
752
+ .${prefix}-badge-primary { background: var(--${prefix}-primary); color: var(--${prefix}-bg); border-color: var(--${prefix}-primary); }
753
+ .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: var(--${prefix}-bg); border-color: var(--${prefix}-muted); }
754
754
  .${prefix}-badge-success { border-color: var(--${prefix}-success); }
755
755
  .${prefix}-badge-warning { border-color: var(--${prefix}-warning); }
756
756
  .${prefix}-badge-danger { border-color: var(--${prefix}-danger); }
@@ -1723,20 +1723,12 @@ var BaseRenderer = class {
1723
1723
  }
1724
1724
  /**
1725
1725
  * Build theme configuration based on options
1726
- * If background option is provided, it overrides the theme's default background
1726
+ * Note: background option is NOT applied to theme.colors.background
1727
+ * It's only used for page background in renderPage() to avoid affecting
1728
+ * component colors that use var(--wf-bg)
1727
1729
  */
1728
1730
  buildTheme(options) {
1729
- const baseTheme = options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
1730
- if (options.background !== void 0) {
1731
- return {
1732
- ...baseTheme,
1733
- colors: {
1734
- ...baseTheme.colors,
1735
- background: options.background
1736
- }
1737
- };
1738
- }
1739
- return baseTheme;
1731
+ return options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
1740
1732
  }
1741
1733
  /**
1742
1734
  * Render a wireframe document to HTML and CSS
@@ -49333,7 +49325,10 @@ var HtmlRenderer = class extends BaseRenderer {
49333
49325
  const title = node.title ? `<title>${this.escapeHtml(node.title)}</title>
49334
49326
  ` : "";
49335
49327
  const commonStyles = this.buildCommonStyles(node);
49336
- const viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
49328
+ let viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
49329
+ if (this.context.options.background) {
49330
+ viewportStyle += `; background: ${this.context.options.background}`;
49331
+ }
49337
49332
  const combinedStyle = commonStyles ? `${viewportStyle}; ${commonStyles}` : viewportStyle;
49338
49333
  const dataAttrs = `data-viewport-width="${viewport.width}" data-viewport-height="${viewport.height}" data-viewport-label="${viewport.label}"`;
49339
49334
  return `<div class="${classes}" style="${combinedStyle}" ${dataAttrs}>
@@ -123,7 +123,9 @@ declare abstract class BaseRenderer {
123
123
  constructor(options?: RenderOptions);
124
124
  /**
125
125
  * Build theme configuration based on options
126
- * If background option is provided, it overrides the theme's default background
126
+ * Note: background option is NOT applied to theme.colors.background
127
+ * It's only used for page background in renderPage() to avoid affecting
128
+ * component colors that use var(--wf-bg)
127
129
  */
128
130
  protected buildTheme(options: RenderOptions): ThemeConfig;
129
131
  /**
@@ -123,7 +123,9 @@ declare abstract class BaseRenderer {
123
123
  constructor(options?: RenderOptions);
124
124
  /**
125
125
  * Build theme configuration based on options
126
- * If background option is provided, it overrides the theme's default background
126
+ * Note: background option is NOT applied to theme.colors.background
127
+ * It's only used for page background in renderPage() to avoid affecting
128
+ * component colors that use var(--wf-bg)
127
129
  */
128
130
  protected buildTheme(options: RenderOptions): ThemeConfig;
129
131
  /**
package/dist/renderer.js CHANGED
@@ -711,8 +711,8 @@ img.${prefix}-image {
711
711
  .${prefix}-badge-dot.${prefix}-badge-primary { background: var(--${prefix}-primary); border-color: var(--${prefix}-primary); }
712
712
 
713
713
  .${prefix}-badge-default { }
714
- .${prefix}-badge-primary { background: var(--${prefix}-primary); color: white; border-color: var(--${prefix}-primary); }
715
- .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: white; border-color: var(--${prefix}-muted); }
714
+ .${prefix}-badge-primary { background: var(--${prefix}-primary); color: var(--${prefix}-bg); border-color: var(--${prefix}-primary); }
715
+ .${prefix}-badge-secondary { background: var(--${prefix}-muted); color: var(--${prefix}-bg); border-color: var(--${prefix}-muted); }
716
716
  .${prefix}-badge-success { border-color: var(--${prefix}-success); }
717
717
  .${prefix}-badge-warning { border-color: var(--${prefix}-warning); }
718
718
  .${prefix}-badge-danger { border-color: var(--${prefix}-danger); }
@@ -1685,20 +1685,12 @@ var BaseRenderer = class {
1685
1685
  }
1686
1686
  /**
1687
1687
  * Build theme configuration based on options
1688
- * If background option is provided, it overrides the theme's default background
1688
+ * Note: background option is NOT applied to theme.colors.background
1689
+ * It's only used for page background in renderPage() to avoid affecting
1690
+ * component colors that use var(--wf-bg)
1689
1691
  */
1690
1692
  buildTheme(options) {
1691
- const baseTheme = options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
1692
- if (options.background !== void 0) {
1693
- return {
1694
- ...baseTheme,
1695
- colors: {
1696
- ...baseTheme.colors,
1697
- background: options.background
1698
- }
1699
- };
1700
- }
1701
- return baseTheme;
1693
+ return options.theme === "dark" ? { ...darkTheme } : { ...defaultTheme };
1702
1694
  }
1703
1695
  /**
1704
1696
  * Render a wireframe document to HTML and CSS
@@ -49295,7 +49287,10 @@ var HtmlRenderer = class extends BaseRenderer {
49295
49287
  const title = node.title ? `<title>${this.escapeHtml(node.title)}</title>
49296
49288
  ` : "";
49297
49289
  const commonStyles = this.buildCommonStyles(node);
49298
- const viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
49290
+ let viewportStyle = `position: relative; width: ${viewport.width}px; height: ${viewport.height}px; overflow: hidden`;
49291
+ if (this.context.options.background) {
49292
+ viewportStyle += `; background: ${this.context.options.background}`;
49293
+ }
49299
49294
  const combinedStyle = commonStyles ? `${viewportStyle}; ${commonStyles}` : viewportStyle;
49300
49295
  const dataAttrs = `data-viewport-width="${viewport.width}" data-viewport-height="${viewport.height}" data-viewport-label="${viewport.label}"`;
49301
49296
  return `<div class="${classes}" style="${combinedStyle}" ${dataAttrs}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireweave/core",
3
- "version": "1.4.0-beta.0",
3
+ "version": "1.4.0-beta.2",
4
4
  "description": "Core parser and renderer for wireweave",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",