@diagrammo/dgmo 0.25.5 → 0.27.0

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.
Files changed (139) hide show
  1. package/README.md +3 -3
  2. package/dist/advanced.cjs +4255 -2756
  3. package/dist/advanced.d.cts +285 -59
  4. package/dist/advanced.d.ts +285 -59
  5. package/dist/advanced.js +4253 -2750
  6. package/dist/auto.cjs +4051 -2589
  7. package/dist/auto.js +124 -122
  8. package/dist/auto.mjs +4051 -2589
  9. package/dist/cli.cjs +172 -170
  10. package/dist/editor.cjs +4 -0
  11. package/dist/editor.js +4 -0
  12. package/dist/highlight.cjs +4 -0
  13. package/dist/highlight.js +4 -0
  14. package/dist/index.cjs +4076 -2591
  15. package/dist/index.d.cts +33 -8
  16. package/dist/index.d.ts +33 -8
  17. package/dist/index.js +4076 -2591
  18. package/dist/internal.cjs +4255 -2756
  19. package/dist/internal.d.cts +285 -59
  20. package/dist/internal.d.ts +285 -59
  21. package/dist/internal.js +4253 -2750
  22. package/dist/map-data/PROVENANCE.json +1 -1
  23. package/dist/map-data/airport-collisions.json +1 -0
  24. package/dist/map-data/airports.json +1 -0
  25. package/docs/language-reference.md +68 -18
  26. package/gallery/fixtures/boxes-and-lines-diverging.dgmo +15 -0
  27. package/gallery/fixtures/map-choropleth-diverging.dgmo +9 -0
  28. package/gallery/fixtures/map-region-values.dgmo +13 -0
  29. package/gallery/fixtures/map-subnational-zoom.dgmo +12 -0
  30. package/gallery/fixtures/map-tagged-legs.dgmo +16 -0
  31. package/gallery/fixtures/map-undirected-edges.dgmo +12 -0
  32. package/package.json +1 -1
  33. package/src/advanced.ts +3 -6
  34. package/src/auto/index.ts +1 -1
  35. package/src/boxes-and-lines/layout.ts +146 -26
  36. package/src/boxes-and-lines/parser.ts +43 -8
  37. package/src/boxes-and-lines/renderer.ts +223 -96
  38. package/src/boxes-and-lines/types.ts +9 -2
  39. package/src/c4/layout.ts +14 -32
  40. package/src/c4/parser.ts +9 -5
  41. package/src/c4/renderer.ts +34 -39
  42. package/src/class/layout.ts +118 -18
  43. package/src/class/parser.ts +35 -1
  44. package/src/class/renderer.ts +58 -2
  45. package/src/class/types.ts +3 -0
  46. package/src/cli.ts +4 -4
  47. package/src/completion-types.ts +0 -1
  48. package/src/completion.ts +106 -51
  49. package/src/cycle/layout.ts +55 -72
  50. package/src/cycle/renderer.ts +11 -6
  51. package/src/d3.ts +78 -117
  52. package/src/diagnostics.ts +16 -0
  53. package/src/echarts.ts +46 -33
  54. package/src/editor/keywords.ts +4 -0
  55. package/src/er/layout.ts +114 -22
  56. package/src/er/parser.ts +28 -1
  57. package/src/er/renderer.ts +55 -2
  58. package/src/er/types.ts +3 -0
  59. package/src/gantt/renderer.ts +46 -38
  60. package/src/gantt/resolver.ts +9 -2
  61. package/src/graph/edge-spline.ts +29 -0
  62. package/src/graph/flowchart-parser.ts +35 -2
  63. package/src/graph/flowchart-renderer.ts +80 -52
  64. package/src/graph/layout.ts +206 -23
  65. package/src/graph/notes.ts +21 -0
  66. package/src/graph/state-parser.ts +26 -1
  67. package/src/graph/state-renderer.ts +80 -52
  68. package/src/graph/types.ts +13 -0
  69. package/src/index.ts +1 -1
  70. package/src/infra/layout.ts +46 -26
  71. package/src/infra/parser.ts +1 -1
  72. package/src/infra/renderer.ts +16 -7
  73. package/src/journey-map/layout.ts +38 -49
  74. package/src/journey-map/renderer.ts +22 -45
  75. package/src/kanban/renderer.ts +15 -6
  76. package/src/label-layout.ts +3 -3
  77. package/src/map/completion.ts +77 -22
  78. package/src/map/context-labels.ts +57 -12
  79. package/src/map/data/PROVENANCE.json +1 -1
  80. package/src/map/data/airport-collisions.json +1 -0
  81. package/src/map/data/airports.json +1 -0
  82. package/src/map/data/types.ts +19 -0
  83. package/src/map/layout.ts +1196 -90
  84. package/src/map/legend-band.ts +2 -2
  85. package/src/map/load-data.ts +10 -1
  86. package/src/map/parser.ts +61 -32
  87. package/src/map/renderer.ts +284 -12
  88. package/src/map/resolved-types.ts +15 -1
  89. package/src/map/resolver.ts +132 -12
  90. package/src/map/types.ts +28 -8
  91. package/src/migrate/embedded.ts +9 -7
  92. package/src/mindmap/text-wrap.ts +13 -14
  93. package/src/org/layout.ts +19 -17
  94. package/src/org/renderer.ts +11 -4
  95. package/src/palettes/color-utils.ts +82 -21
  96. package/src/palettes/index.ts +0 -19
  97. package/src/palettes/registry.ts +1 -1
  98. package/src/palettes/types.ts +2 -2
  99. package/src/pert/layout.ts +48 -40
  100. package/src/pert/parser.ts +0 -14
  101. package/src/pert/renderer.ts +30 -43
  102. package/src/pyramid/renderer.ts +4 -5
  103. package/src/raci/renderer.ts +42 -70
  104. package/src/render.ts +1 -1
  105. package/src/ring/renderer.ts +1 -2
  106. package/src/sequence/parser.ts +100 -22
  107. package/src/sequence/renderer.ts +75 -50
  108. package/src/sitemap/layout.ts +27 -19
  109. package/src/sitemap/renderer.ts +12 -5
  110. package/src/tech-radar/renderer.ts +11 -35
  111. package/src/utils/arrow-markers.ts +51 -0
  112. package/src/utils/fit-canvas.ts +64 -0
  113. package/src/utils/legend-constants.ts +8 -54
  114. package/src/utils/legend-d3.ts +10 -7
  115. package/src/utils/legend-layout.ts +7 -4
  116. package/src/utils/legend-types.ts +10 -4
  117. package/src/utils/note-box/constants.ts +25 -0
  118. package/src/utils/note-box/index.ts +11 -0
  119. package/src/utils/note-box/metrics.ts +90 -0
  120. package/src/utils/note-box/svg.ts +331 -0
  121. package/src/utils/notes/bounds.ts +30 -0
  122. package/src/utils/notes/build.ts +131 -0
  123. package/src/utils/notes/index.ts +18 -0
  124. package/src/utils/notes/model.ts +19 -0
  125. package/src/utils/notes/parse.ts +131 -0
  126. package/src/utils/notes/place.ts +177 -0
  127. package/src/utils/notes/resolve.ts +88 -0
  128. package/src/utils/number-format.ts +36 -0
  129. package/src/utils/parsing.ts +41 -0
  130. package/src/utils/reserved-key-registry.ts +4 -0
  131. package/src/utils/text-measure.ts +122 -0
  132. package/src/wireframe/layout.ts +4 -2
  133. package/src/wireframe/renderer.ts +8 -6
  134. package/src/palettes/dracula.ts +0 -68
  135. package/src/palettes/gruvbox.ts +0 -85
  136. package/src/palettes/monokai.ts +0 -68
  137. package/src/palettes/one-dark.ts +0 -70
  138. package/src/palettes/rose-pine.ts +0 -84
  139. package/src/palettes/solarized.ts +0 -77
@@ -0,0 +1,122 @@
1
+ // ============================================================
2
+ // Shared text measurement
3
+ // ============================================================
4
+ // One source of truth for "how wide is this string?" Before this
5
+ // module, ~30 renderers/layouts each carried their own char-width
6
+ // estimate (7.5px, 7px, 0.6·fontSize, 0.58, 0.55 …). The drift meant
7
+ // the same label measured differently per chart type — a label could
8
+ // fit inside an org node but overflow an infra node. All sizing,
9
+ // wrapping, and truncation now route through the per-glyph table here.
10
+
11
+ // Helvetica character width ratios (fraction of fontSize). Replaces the
12
+ // naive `chars * 0.6 * fontSize` estimate with per-character widths.
13
+ // prettier-ignore
14
+ const CHAR_W: Record<string, number> = {
15
+ ' ':.28,'!': .28,'"': .36,'#': .56,'$': .56,'%': .89,'&': .67,"'":.19,
16
+ '(':.33,')':.33,'*': .39,'+':.58,',':.28,'-':.33,'.':.28,'/':.28,
17
+ '0':.56,'1':.56,'2':.56,'3':.56,'4':.56,'5':.56,'6':.56,'7':.56,'8':.56,'9':.56,
18
+ ':':.28,';':.28,'<':.58,'=':.58,'>':.58,'?':.56,'@':1.02,
19
+ A:.67,B:.67,C:.72,D:.72,E:.67,F:.61,G:.78,H:.72,I:.28,J:.50,K:.67,L:.56,M:.83,
20
+ N:.72,O:.78,P:.67,Q:.78,R:.72,S:.67,T:.61,U:.72,V:.67,W:.94,X:.67,Y:.67,Z:.61,
21
+ a:.56,b:.56,c:.50,d:.56,e:.56,f:.28,g:.56,h:.56,i:.22,j:.22,k:.50,l:.22,m:.83,
22
+ n:.56,o:.56,p:.56,q:.56,r:.33,s:.50,t:.28,u:.56,v:.50,w:.72,x:.50,y:.50,z:.50,
23
+ };
24
+ const DEFAULT_W = 0.56;
25
+
26
+ /**
27
+ * Average glyph-width ratio (fraction of fontSize). Only for the rare
28
+ * call site that needs a single scalar (e.g. estimating a max char count
29
+ * up front). Prefer {@link measureText} / {@link wrapTextToWidth} —
30
+ * they account for actual glyph widths.
31
+ */
32
+ export const CHAR_WIDTH_RATIO = DEFAULT_W;
33
+
34
+ /** Estimate rendered text width using Helvetica proportional character widths. */
35
+ export function measureText(text: string, fontSize: number): number {
36
+ let w = 0;
37
+ for (let i = 0; i < text.length; i++) {
38
+ // charAt returns '' for out-of-bounds, never undefined.
39
+ w += (CHAR_W[text.charAt(i)] ?? DEFAULT_W) * fontSize;
40
+ }
41
+ return w;
42
+ }
43
+
44
+ /**
45
+ * Truncate text with a trailing ellipsis to fit within maxWidth.
46
+ * Returns the original text if it already fits, or '' if even the
47
+ * ellipsis alone won't fit.
48
+ */
49
+ export function truncateText(
50
+ text: string,
51
+ fontSize: number,
52
+ maxWidth: number
53
+ ): string {
54
+ if (measureText(text, fontSize) <= maxWidth) return text;
55
+ const ellipsis = '…';
56
+ const ellipsisW = measureText(ellipsis, fontSize);
57
+ if (ellipsisW > maxWidth) return '';
58
+ let lo = 0;
59
+ let hi = text.length;
60
+ while (lo < hi) {
61
+ const mid = Math.ceil((lo + hi) / 2);
62
+ if (measureText(text.slice(0, mid), fontSize) + ellipsisW <= maxWidth) {
63
+ lo = mid;
64
+ } else {
65
+ hi = mid - 1;
66
+ }
67
+ }
68
+ return lo === 0 ? ellipsis : text.slice(0, lo) + ellipsis;
69
+ }
70
+
71
+ /**
72
+ * Greedy word-wrap to a pixel width using accurate glyph measurement.
73
+ *
74
+ * - Splits on whitespace; a word that alone exceeds `maxWidth` is kept
75
+ * whole unless `hardBreak` is set, in which case it is broken at the
76
+ * character boundary that fits.
77
+ * - Returns at least one line (`['']` for empty input).
78
+ */
79
+ export function wrapTextToWidth(
80
+ text: string,
81
+ fontSize: number,
82
+ maxWidth: number,
83
+ opts?: { hardBreak?: boolean }
84
+ ): string[] {
85
+ const words = text.split(/\s+/).filter((w) => w.length > 0);
86
+ if (words.length === 0) return [''];
87
+ const hardBreak = opts?.hardBreak ?? false;
88
+ const lines: string[] = [];
89
+ let current = '';
90
+ const pushWord = (word: string) => {
91
+ const test = current ? `${current} ${word}` : word;
92
+ if (measureText(test, fontSize) <= maxWidth || !current) {
93
+ current = test;
94
+ } else {
95
+ lines.push(current);
96
+ current = word;
97
+ }
98
+ };
99
+ for (const word of words) {
100
+ if (hardBreak && measureText(word, fontSize) > maxWidth) {
101
+ // Break the over-long word into width-fitting chunks.
102
+ if (current) {
103
+ lines.push(current);
104
+ current = '';
105
+ }
106
+ let chunk = '';
107
+ for (const ch of word) {
108
+ if (chunk && measureText(chunk + ch, fontSize) > maxWidth) {
109
+ lines.push(chunk);
110
+ chunk = ch;
111
+ } else {
112
+ chunk += ch;
113
+ }
114
+ }
115
+ current = chunk;
116
+ continue;
117
+ }
118
+ pushWord(word);
119
+ }
120
+ if (current) lines.push(current);
121
+ return lines.length > 0 ? lines : [''];
122
+ }
@@ -3,6 +3,7 @@
3
3
  // ============================================================
4
4
 
5
5
  import type { Writable } from '../utils/brand';
6
+ import { measureText } from '../utils/text-measure';
6
7
  import type {
7
8
  WireframeElement,
8
9
  ParsedWireframe,
@@ -16,8 +17,9 @@ import type {
16
17
  const DESKTOP_WIDTH = 1200;
17
18
  const MOBILE_WIDTH = 375;
18
19
 
19
- const CHAR_WIDTH = 7.5;
20
20
  const LABEL_PADDING = 16;
21
+ /** Font size for label-field label text — matches renderer's renderText (13px). */
22
+ const LABEL_FIELD_FONT_SIZE = 13;
21
23
 
22
24
  /** Element type-specific heights */
23
25
  const ELEMENT_HEIGHTS: Record<string, number> = {
@@ -466,7 +468,7 @@ function computeFieldAlignX(children: readonly WireframeElement[]): number {
466
468
  ) {
467
469
  // In-bounds by length-check above.
468
470
  const labelEl = child.children[0]!;
469
- const labelWidth = labelEl.label.length * CHAR_WIDTH;
471
+ const labelWidth = measureText(labelEl.label, LABEL_FIELD_FONT_SIZE);
470
472
  maxLabelWidth = Math.max(maxLabelWidth, labelWidth);
471
473
  labelFieldCount++;
472
474
  }
@@ -7,6 +7,7 @@ import { FONT_FAMILY } from '../fonts';
7
7
  import type { PaletteColors } from '../palettes';
8
8
  import { contrastText, mix, shapeFill } from '../palettes/color-utils';
9
9
  import { TITLE_FONT_SIZE, TITLE_FONT_WEIGHT } from '../utils/title-constants';
10
+ import { measureText } from '../utils/text-measure';
10
11
  import type { WireframeElement, ParsedWireframe } from './types';
11
12
  import type { WireframeLayout, WireframeLayoutNode } from './layout';
12
13
  import { ScaleContext } from '../utils/scaling';
@@ -386,7 +387,7 @@ function renderTextInput(
386
387
  // Cursor line
387
388
  if (el.fieldVariant !== 'password') {
388
389
  const textWidth = Math.min(
389
- (el.label || 'Text input').length * 7 + 14,
390
+ measureText(el.label || 'Text input', 13) + 14,
390
391
  node.width - 20
391
392
  );
392
393
  g.append('line')
@@ -711,19 +712,20 @@ function renderNav(
711
712
  .attr('font-weight', isActive ? '600' : 'normal')
712
713
  .text(child.label);
713
714
 
715
+ const labelW = measureText(child.label, 13);
716
+
714
717
  // Active underline
715
718
  if (isActive) {
716
- const textW = child.label.length * 7.5;
717
719
  g.append('line')
718
720
  .attr('x1', x)
719
721
  .attr('y1', node.height - 4)
720
- .attr('x2', x + textW)
722
+ .attr('x2', x + labelW)
721
723
  .attr('y2', node.height - 4)
722
724
  .attr('stroke', palette.primary)
723
725
  .attr('stroke-width', 2);
724
726
  }
725
727
 
726
- x += child.label.length * 7.5 + 24;
728
+ x += labelW + 24;
727
729
  }
728
730
  }
729
731
 
@@ -748,7 +750,7 @@ function renderTabs(
748
750
  let x = 0;
749
751
  for (const child of el.children) {
750
752
  const isActive = child.states.includes('active');
751
- const tabW = child.label.length * 7.5 + 24;
753
+ const tabW = measureText(child.label, 13) + 24;
752
754
 
753
755
  if (isActive) {
754
756
  // Active tab bottom border
@@ -884,7 +886,7 @@ function renderTableCell(
884
886
  const isGhost = stateStr === 'ghost';
885
887
  const isDestructive = stateStr === 'destructive';
886
888
  const fill = isDestructive ? palette.destructive : palette.primary;
887
- const btnW = Math.min(label.length * 7 + 16, maxW);
889
+ const btnW = Math.min(measureText(label, 10) + 16, maxW);
888
890
  const btnH = 20;
889
891
  const by = y + (rowH - btnH) / 2;
890
892
 
@@ -1,68 +0,0 @@
1
- import type { PaletteConfig } from './types';
2
- import { registerPalette } from './registry';
3
-
4
- // ============================================================
5
- // Dracula Palette Definition
6
- // https://draculatheme.com/contribute
7
- // ============================================================
8
-
9
- export const draculaPalette: PaletteConfig = {
10
- id: 'dracula',
11
- name: 'Dracula',
12
- light: {
13
- bg: '#f8f8f2', // foreground as light bg
14
- surface: '#f0f0ec',
15
- overlay: '#e8e8e2',
16
- border: '#d8d8d2',
17
- text: '#282a36', // background as light text
18
- textMuted: '#44475a', // current line
19
- textOnFillLight: '#f8f8f2',
20
- textOnFillDark: '#282a36',
21
- primary: '#6272a4', // comment
22
- secondary: '#bd93f9', // purple
23
- accent: '#bd93f9', // purple
24
- destructive: '#ff5555', // red
25
- colors: {
26
- red: '#ff5555',
27
- orange: '#ffb86c',
28
- yellow: '#f1fa8c',
29
- green: '#50fa7b',
30
- blue: '#6272a4', // comment blue
31
- purple: '#bd93f9',
32
- teal: '#5ac8b8', // muted cyan toward green
33
- cyan: '#8be9fd',
34
- gray: '#6272a4',
35
- black: '#282a36',
36
- white: '#f0f0ec',
37
- },
38
- },
39
- dark: {
40
- bg: '#282a36', // background
41
- surface: '#343746', // between bg and current line
42
- overlay: '#44475a', // current line
43
- border: '#6272a4', // comment
44
- text: '#f8f8f2', // foreground
45
- textMuted: '#bcc2d4', // muted foreground
46
- textOnFillLight: '#f8f8f2',
47
- textOnFillDark: '#282a36',
48
- primary: '#bd93f9', // purple (Dracula's signature)
49
- secondary: '#8be9fd', // cyan
50
- accent: '#ff79c6', // pink
51
- destructive: '#ff5555', // red
52
- colors: {
53
- red: '#ff5555',
54
- orange: '#ffb86c',
55
- yellow: '#f1fa8c',
56
- green: '#50fa7b',
57
- blue: '#6272a4', // comment blue
58
- purple: '#bd93f9',
59
- teal: '#5ac8b8', // muted cyan toward green
60
- cyan: '#8be9fd',
61
- gray: '#6272a4',
62
- black: '#343746',
63
- white: '#f8f8f2',
64
- },
65
- },
66
- };
67
-
68
- registerPalette(draculaPalette);
@@ -1,85 +0,0 @@
1
- import type { PaletteConfig } from './types';
2
- import { registerPalette } from './registry';
3
-
4
- // ============================================================
5
- // Gruvbox Palette Definition
6
- // ============================================================
7
-
8
- // Official Gruvbox colors: https://github.com/morhetz/gruvbox
9
- //
10
- // Neutrals:
11
- // dark0 #282828 | dark1 #3c3836 | dark2 #504945 | dark3 #665c54
12
- // light0 #fbf1c7 | light1 #ebdbb2 | light2 #d5c4a1 | light3 #bdae93
13
- // gray #928374
14
- //
15
- // Accents (bright / neutral / faded):
16
- // Red #fb4934 / #cc241d / #9d0006
17
- // Green #b8bb26 / #98971a / #79740e
18
- // Yellow #fabd2f / #d79921 / #b57614
19
- // Blue #83a598 / #458588 / #076678
20
- // Purple #d3869b / #b16286 / #8f3f71
21
- // Aqua #8ec07c / #689d6a / #427b58
22
- // Orange #fe8019 / #d65d0e / #af3a03
23
- //
24
- // Light mode uses faded accents, dark mode uses bright accents.
25
-
26
- export const gruvboxPalette: PaletteConfig = {
27
- id: 'gruvbox',
28
- name: 'Gruvbox',
29
- light: {
30
- bg: '#fbf1c7', // light0
31
- surface: '#ebdbb2', // light1
32
- overlay: '#d5c4a1', // light2
33
- border: '#bdae93', // light3
34
- text: '#3c3836', // dark1
35
- textMuted: '#7c6f64', // dark4
36
- textOnFillLight: '#fbf1c7', // light0
37
- textOnFillDark: '#282828', // dark0
38
- primary: '#076678', // faded blue
39
- secondary: '#427b58', // faded aqua
40
- accent: '#8f3f71', // faded purple
41
- destructive: '#9d0006', // faded red
42
- colors: {
43
- red: '#9d0006', // faded
44
- orange: '#af3a03', // faded
45
- yellow: '#b57614', // faded
46
- green: '#79740e', // faded
47
- blue: '#076678', // faded
48
- purple: '#8f3f71', // faded
49
- teal: '#427b58', // faded aqua
50
- cyan: '#427b58', // faded aqua
51
- gray: '#928374',
52
- black: '#3c3836',
53
- white: '#ebdbb2',
54
- },
55
- },
56
- dark: {
57
- bg: '#282828', // dark0
58
- surface: '#3c3836', // dark1
59
- overlay: '#504945', // dark2
60
- border: '#665c54', // dark3
61
- text: '#ebdbb2', // light1
62
- textMuted: '#a89984', // light4
63
- textOnFillLight: '#fbf1c7', // light0
64
- textOnFillDark: '#282828', // dark0
65
- primary: '#83a598', // bright blue
66
- secondary: '#8ec07c', // bright aqua
67
- accent: '#d3869b', // bright purple
68
- destructive: '#fb4934', // bright red
69
- colors: {
70
- red: '#fb4934', // bright
71
- orange: '#fe8019', // bright
72
- yellow: '#fabd2f', // bright
73
- green: '#b8bb26', // bright
74
- blue: '#83a598', // bright
75
- purple: '#d3869b', // bright
76
- teal: '#8ec07c', // bright aqua
77
- cyan: '#8ec07c', // bright aqua
78
- gray: '#928374',
79
- black: '#3c3836',
80
- white: '#ebdbb2',
81
- },
82
- },
83
- };
84
-
85
- registerPalette(gruvboxPalette);
@@ -1,68 +0,0 @@
1
- import type { PaletteConfig } from './types';
2
- import { registerPalette } from './registry';
3
-
4
- // ============================================================
5
- // Monokai Palette Definition
6
- // Based on Monokai / Monokai Pro color scheme
7
- // ============================================================
8
-
9
- export const monokaiPalette: PaletteConfig = {
10
- id: 'monokai',
11
- name: 'Monokai',
12
- light: {
13
- bg: '#fafaf8',
14
- surface: '#f0efe8',
15
- overlay: '#e6e5de',
16
- border: '#d4d3cc',
17
- text: '#272822', // classic Monokai bg as text
18
- textMuted: '#75715e', // comment
19
- textOnFillLight: '#fafaf8',
20
- textOnFillDark: '#272822',
21
- primary: '#49483e', // line highlight
22
- secondary: '#f92672', // pink
23
- accent: '#a6e22e', // green
24
- destructive: '#f92672', // pink/red
25
- colors: {
26
- red: '#f92672', // Monokai pink-red
27
- orange: '#fd971f',
28
- yellow: '#e6db74',
29
- green: '#a6e22e',
30
- blue: '#5c7eab', // derived true blue
31
- purple: '#ae81ff',
32
- teal: '#4ea8a6', // muted from cyan
33
- cyan: '#66d9ef',
34
- gray: '#75715e', // comment
35
- black: '#272822',
36
- white: '#f0efe8',
37
- },
38
- },
39
- dark: {
40
- bg: '#272822', // classic background
41
- surface: '#2d2e27',
42
- overlay: '#3e3d32', // line highlight
43
- border: '#49483e',
44
- text: '#f8f8f2', // foreground
45
- textMuted: '#a6a28c', // brightened comment
46
- textOnFillLight: '#f8f8f2',
47
- textOnFillDark: '#272822',
48
- primary: '#a6e22e', // green
49
- secondary: '#66d9ef', // cyan
50
- accent: '#f92672', // pink
51
- destructive: '#f92672', // pink/red
52
- colors: {
53
- red: '#f92672',
54
- orange: '#fd971f',
55
- yellow: '#e6db74',
56
- green: '#a6e22e',
57
- blue: '#5c7eab', // derived true blue
58
- purple: '#ae81ff',
59
- teal: '#4ea8a6', // muted from cyan
60
- cyan: '#66d9ef',
61
- gray: '#75715e', // comment
62
- black: '#2d2e27',
63
- white: '#f8f8f2',
64
- },
65
- },
66
- };
67
-
68
- registerPalette(monokaiPalette);
@@ -1,70 +0,0 @@
1
- import type { PaletteConfig } from './types';
2
- import { registerPalette } from './registry';
3
-
4
- // ============================================================
5
- // One Dark Palette Definition
6
- // Based on Atom's One Dark theme
7
- // ============================================================
8
-
9
- export const oneDarkPalette: PaletteConfig = {
10
- id: 'one-dark',
11
- name: 'One Dark',
12
- light: {
13
- // One Light variant (Atom's light counterpart)
14
- bg: '#fafafa',
15
- surface: '#f0f0f0',
16
- overlay: '#e5e5e5',
17
- border: '#d0d0d0',
18
- text: '#383a42',
19
- textMuted: '#696c77',
20
- textOnFillLight: '#fafafa',
21
- textOnFillDark: '#181a1f', // Tightened from #383a42 — the light Text token fails 3:1 on saturated blue/teal
22
- primary: '#4078f2',
23
- secondary: '#a626a4',
24
- accent: '#0184bc',
25
- destructive: '#e45649',
26
- colors: {
27
- red: '#e45649',
28
- orange: '#c18401',
29
- yellow: '#c18401',
30
- green: '#50a14f',
31
- blue: '#4078f2',
32
- purple: '#a626a4',
33
- teal: '#0184bc',
34
- cyan: '#0997b3',
35
- gray: '#696c77',
36
- black: '#383a42',
37
- white: '#f0f0f0',
38
- },
39
- },
40
- dark: {
41
- // One Dark (Atom's dark theme)
42
- bg: '#282c34',
43
- surface: '#21252b',
44
- overlay: '#2c313a',
45
- border: '#3e4451',
46
- text: '#abb2bf',
47
- textMuted: '#5c6370',
48
- textOnFillLight: '#fafafa',
49
- textOnFillDark: '#21252b',
50
- primary: '#61afef',
51
- secondary: '#c678dd',
52
- accent: '#56b6c2',
53
- destructive: '#e06c75',
54
- colors: {
55
- red: '#e06c75',
56
- orange: '#d19a66',
57
- yellow: '#e5c07b',
58
- green: '#98c379',
59
- blue: '#61afef',
60
- purple: '#c678dd',
61
- teal: '#56b6c2',
62
- cyan: '#56b6c2',
63
- gray: '#5c6370',
64
- black: '#21252b',
65
- white: '#abb2bf',
66
- },
67
- },
68
- };
69
-
70
- registerPalette(oneDarkPalette);
@@ -1,84 +0,0 @@
1
- import type { PaletteConfig } from './types';
2
- import { registerPalette } from './registry';
3
-
4
- // ============================================================
5
- // Rosé Pine Palette Definition
6
- // ============================================================
7
-
8
- // Official Rosé Pine colors: https://rosepinetheme.com/palette
9
- //
10
- // Dawn (light):
11
- // Base #faf4ed | Surface #fffaf3 | Overlay #f2e9e1
12
- // Muted #9893a5 | Subtle #797593 | Text #575279
13
- // Highlight Med #dfdad9
14
- //
15
- // Moon (dark):
16
- // Base #232136 | Surface #2a273f | Overlay #393552
17
- // Muted #6e6a86 | Subtle #908caa | Text #e0def4
18
- // Highlight Med #44415a
19
- //
20
- // Accents (Dawn / Moon):
21
- // Love #b4637a / #eb6f92 | Gold #ea9d34 / #f6c177
22
- // Rose #d7827e / #ea9a97 | Pine #286983 / #3e8fb0
23
- // Foam #56949f / #9ccfd8 | Iris #907aa9 / #c4a7e7
24
-
25
- export const rosePinePalette: PaletteConfig = {
26
- id: 'rose-pine',
27
- name: 'Rosé Pine',
28
- light: {
29
- bg: '#faf4ed', // Dawn Base
30
- surface: '#fffaf3', // Dawn Surface
31
- overlay: '#f2e9e1', // Dawn Overlay
32
- border: '#dfdad9', // Dawn Highlight Med
33
- text: '#575279', // Dawn Text
34
- textMuted: '#9893a5', // Dawn Muted
35
- textOnFillLight: '#faf4ed', // Dawn Base
36
- textOnFillDark: '#191724', // Rosé Pine Main Base (deep dark)
37
- primary: '#286983', // Dawn Pine
38
- secondary: '#56949f', // Dawn Foam
39
- accent: '#907aa9', // Dawn Iris
40
- destructive: '#b4637a', // Dawn Love
41
- colors: {
42
- red: '#b4637a', // Love
43
- orange: '#d7827e', // Rose
44
- yellow: '#ea9d34', // Gold
45
- green: '#286983', // Pine
46
- blue: '#56949f', // Foam
47
- purple: '#907aa9', // Iris
48
- teal: '#286983', // Pine
49
- cyan: '#56949f', // Foam
50
- gray: '#9893a5', // Muted
51
- black: '#575279',
52
- white: '#fffaf3',
53
- },
54
- },
55
- dark: {
56
- bg: '#232136', // Moon Base
57
- surface: '#2a273f', // Moon Surface
58
- overlay: '#393552', // Moon Overlay
59
- border: '#44415a', // Moon Highlight Med
60
- text: '#e0def4', // Moon Text
61
- textMuted: '#908caa', // Moon Subtle
62
- textOnFillLight: '#e0def4', // Moon Text
63
- textOnFillDark: '#191724', // Rosé Pine Main Base
64
- primary: '#3e8fb0', // Moon Pine
65
- secondary: '#9ccfd8', // Moon Foam
66
- accent: '#c4a7e7', // Moon Iris
67
- destructive: '#eb6f92', // Moon Love
68
- colors: {
69
- red: '#eb6f92', // Love
70
- orange: '#ea9a97', // Rose
71
- yellow: '#f6c177', // Gold
72
- green: '#3e8fb0', // Pine
73
- blue: '#9ccfd8', // Foam
74
- purple: '#c4a7e7', // Iris
75
- teal: '#3e8fb0', // Pine
76
- cyan: '#9ccfd8', // Foam
77
- gray: '#6e6a86', // Muted
78
- black: '#2a273f',
79
- white: '#e0def4',
80
- },
81
- },
82
- };
83
-
84
- registerPalette(rosePinePalette);
@@ -1,77 +0,0 @@
1
- import type { PaletteConfig } from './types';
2
- import { registerPalette } from './registry';
3
-
4
- // ============================================================
5
- // Solarized Palette Definition
6
- // ============================================================
7
-
8
- // Official Solarized colors: https://ethanschoonover.com/solarized/
9
- //
10
- // Base tones:
11
- // base03 #002b36 | base02 #073642 | base01 #586e75 | base00 #657b83
12
- // base0 #839496 | base1 #93a1a1 | base2 #eee8d5 | base3 #fdf6e3
13
- //
14
- // Accent colors:
15
- // yellow #b58900 | orange #cb4b16 | red #dc322f | magenta #d33682
16
- // violet #6c71c4 | blue #268bd2 | cyan #2aa198 | green #859900
17
-
18
- export const solarizedPalette: PaletteConfig = {
19
- id: 'solarized',
20
- name: 'Solarized',
21
- light: {
22
- bg: '#fdf6e3', // base3
23
- surface: '#eee8d5', // base2
24
- overlay: '#eee8d5', // base2 (muted/secondary backgrounds)
25
- border: '#93a1a1', // base1
26
- text: '#657b83', // base00
27
- textMuted: '#93a1a1', // base1
28
- textOnFillLight: '#fdf6e3', // base3
29
- textOnFillDark: '#002b36', // base03
30
- primary: '#268bd2', // blue
31
- secondary: '#2aa198', // cyan
32
- accent: '#6c71c4', // violet
33
- destructive: '#dc322f', // red
34
- colors: {
35
- red: '#dc322f',
36
- orange: '#cb4b16',
37
- yellow: '#b58900',
38
- green: '#859900',
39
- blue: '#268bd2',
40
- purple: '#6c71c4',
41
- teal: '#2aa198',
42
- cyan: '#2aa198', // Solarized has no separate cyan — reuse teal
43
- gray: '#586e75', // base01
44
- black: '#657b83',
45
- white: '#eee8d5',
46
- },
47
- },
48
- dark: {
49
- bg: '#002b36', // base03
50
- surface: '#073642', // base02
51
- overlay: '#073642', // base02 (muted/secondary backgrounds)
52
- border: '#586e75', // base01
53
- text: '#839496', // base0
54
- textMuted: '#586e75', // base01
55
- textOnFillLight: '#fdf6e3', // base3
56
- textOnFillDark: '#002b36', // base03
57
- primary: '#268bd2', // blue
58
- secondary: '#2aa198', // cyan
59
- accent: '#6c71c4', // violet
60
- destructive: '#dc322f', // red
61
- colors: {
62
- red: '#dc322f',
63
- orange: '#cb4b16',
64
- yellow: '#b58900',
65
- green: '#859900',
66
- blue: '#268bd2',
67
- purple: '#6c71c4',
68
- teal: '#2aa198',
69
- cyan: '#2aa198',
70
- gray: '#586e75', // base01
71
- black: '#073642',
72
- white: '#839496',
73
- },
74
- },
75
- };
76
-
77
- registerPalette(solarizedPalette);