@work-graph/cli 0.2.8 → 0.2.9

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.
@@ -77,6 +77,16 @@ export function createPublicSiteServer() {
77
77
  return;
78
78
  }
79
79
 
80
+ if (url.pathname === '/assets/workgraph-logo.svg') {
81
+ serveFile(response, join(PUBLIC_ROOT, 'assets', 'workgraph-logo.svg'), 'image/svg+xml; charset=utf-8');
82
+ return;
83
+ }
84
+
85
+ if (url.pathname === '/assets/workgraph-emblem.svg') {
86
+ serveFile(response, join(PUBLIC_ROOT, 'assets', 'workgraph-emblem.svg'), 'image/svg+xml; charset=utf-8');
87
+ return;
88
+ }
89
+
80
90
  if (url.pathname === '/assets/design-tokens-workgraph-dark.css') {
81
91
  serveFile(response, DESIGN_TOKENS_WG_CSS_PATH, 'text/css; charset=utf-8');
82
92
  return;
@@ -10,6 +10,7 @@ const { PUBLIC_ROOT } = resolveInstallLayout({
10
10
  });
11
11
 
12
12
  const ICONS_BOLD_DIR = join(PUBLIC_ROOT, 'assets', 'icons', 'bold');
13
+ const ICONS_FILL_DIR = join(PUBLIC_ROOT, 'assets', 'icons', 'fill');
13
14
 
14
15
  /** @type {Map<string, string>} */
15
16
  const svgCache = new Map();
@@ -27,20 +28,22 @@ export const NAV_VIEW_ICON_FILES = {
27
28
  };
28
29
 
29
30
  const THEME_ICON_FILES = {
30
- moon: 'moon-bold.svg',
31
- sun: 'sun-bold.svg',
31
+ moon: 'moon-fill.svg',
32
+ sun: 'sun-fill.svg',
32
33
  };
33
34
 
34
35
  /**
35
36
  * @param {string} fileName
37
+ * @param {'bold' | 'fill'} [variant]
36
38
  * @returns {string}
37
39
  */
38
- export function readPublicIconSvg(fileName) {
39
- const cacheKey = fileName;
40
+ export function readPublicIconSvg(fileName, variant = 'bold') {
41
+ const cacheKey = `${variant}:${fileName}`;
40
42
  if (svgCache.has(cacheKey)) {
41
43
  return svgCache.get(cacheKey);
42
44
  }
43
- const source = readFileSync(join(ICONS_BOLD_DIR, fileName), 'utf8');
45
+ const root = variant === 'fill' ? ICONS_FILL_DIR : ICONS_BOLD_DIR;
46
+ const source = readFileSync(join(root, fileName), 'utf8');
44
47
  svgCache.set(cacheKey, source);
45
48
  return source;
46
49
  }
@@ -60,10 +63,11 @@ export function normalizeInlineSvg(rawSvg, { className = 'wg-icon', size = 18 }
60
63
  /**
61
64
  * @param {string} fileName
62
65
  * @param {{ className?: string, size?: number }} [options]
66
+ * @param {'bold' | 'fill'} [variant]
63
67
  * @returns {string}
64
68
  */
65
- export function renderInlineIcon(fileName, options = {}) {
66
- return normalizeInlineSvg(readPublicIconSvg(fileName), options);
69
+ export function renderInlineIcon(fileName, options = {}, variant = 'bold') {
70
+ return normalizeInlineSvg(readPublicIconSvg(fileName, variant), options);
67
71
  }
68
72
 
69
73
  /**
@@ -83,14 +87,16 @@ export function renderNavViewIcon(view, options = {}) {
83
87
 
84
88
  /**
85
89
  * @param {'moon' | 'sun'} kind
90
+ * @param {{ className?: string, size?: number }} [options]
86
91
  * @returns {string}
87
92
  */
88
- export function renderThemeIcon(kind) {
93
+ export function renderThemeIcon(kind, options = {}) {
89
94
  const fileName = THEME_ICON_FILES[kind];
90
95
  return renderInlineIcon(fileName, {
91
96
  className: 'header-theme-toggle-icon',
92
97
  size: 18,
93
- });
98
+ ...options,
99
+ }, 'fill');
94
100
  }
95
101
 
96
102
  export function getPublicIconsRoot() {