@bugabinga/pi-ext-diff-review 0.1.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.
@@ -0,0 +1,179 @@
1
+ import { CODE_FONT, NUGU_DARK, NUGU_LIGHT } from "./theme.js";
2
+
3
+ export const DIFF_FONT_CSS = `
4
+ :host {
5
+ --diffs-font-family: ${CODE_FONT};
6
+ --diffs-header-font-family: Inter, ui-sans-serif, system-ui, sans-serif;
7
+ --diffs-light: ${NUGU_LIGHT.fg};
8
+ --diffs-dark: ${NUGU_DARK.fg};
9
+ --diffs-light-bg: ${NUGU_LIGHT.bg};
10
+ --diffs-dark-bg: ${NUGU_DARK.bg};
11
+ --diffs-light-addition-color: ${NUGU_LIGHT.info};
12
+ --diffs-dark-addition-color: ${NUGU_DARK.info};
13
+ --diffs-light-deletion-color: ${NUGU_LIGHT.error};
14
+ --diffs-dark-deletion-color: ${NUGU_DARK.error};
15
+ --diffs-light-modified-color: ${NUGU_LIGHT.accent};
16
+ --diffs-dark-modified-color: ${NUGU_DARK.accent};
17
+ --diffs-bg-context-override: light-dark(color-mix(in srgb, ${NUGU_LIGHT.bg} 88%, white), color-mix(in srgb, ${NUGU_DARK.bg} 82%, ${NUGU_DARK.panel}));
18
+ --diffs-bg-context-gutter-override: light-dark(color-mix(in srgb, ${NUGU_LIGHT.panel} 80%, white), color-mix(in srgb, ${NUGU_DARK.panel} 80%, ${NUGU_DARK.bg}));
19
+ --diffs-bg-separator-override: light-dark(${NUGU_LIGHT.panel}, ${NUGU_DARK.panel});
20
+ --diffs-fg-number-override: light-dark(${NUGU_LIGHT.muted}, ${NUGU_DARK.muted});
21
+ --diffs-foreground: light-dark(${NUGU_LIGHT.fg}, ${NUGU_DARK.fg});
22
+ --diffs-background: light-dark(${NUGU_LIGHT.bg}, ${NUGU_DARK.bg});
23
+ --diffs-token-string: light-dark(${NUGU_LIGHT.focus}, ${NUGU_DARK.focus});
24
+ --diffs-token-string-expression: light-dark(${NUGU_LIGHT.focus}, ${NUGU_DARK.focus});
25
+ --diffs-token-comment: light-dark(${NUGU_LIGHT.important}, ${NUGU_DARK.important});
26
+ --diffs-token-constant: light-dark(${NUGU_LIGHT.focus}, ${NUGU_DARK.focus});
27
+ --diffs-token-keyword: light-dark(${NUGU_LIGHT.muted}, ${NUGU_DARK.muted});
28
+ --diffs-token-parameter: light-dark(${NUGU_LIGHT.warning}, ${NUGU_DARK.warning});
29
+ --diffs-token-function: light-dark(${NUGU_LIGHT.fg}, ${NUGU_DARK.fg});
30
+ --diffs-token-punctuation: light-dark(${NUGU_LIGHT.muted}, ${NUGU_DARK.muted});
31
+ --diffs-token-link: light-dark(${NUGU_LIGHT.info}, ${NUGU_DARK.info});
32
+ --diffs-token-inserted: light-dark(${NUGU_LIGHT.info}, ${NUGU_DARK.info});
33
+ --diffs-token-deleted: light-dark(${NUGU_LIGHT.error}, ${NUGU_DARK.error});
34
+ --diffs-token-changed: light-dark(${NUGU_LIGHT.accent}, ${NUGU_DARK.accent});
35
+ }
36
+ pre, code, [data-line], [data-code], [data-content], [data-line-number] {
37
+ font-family: ${CODE_FONT} !important;
38
+ font-size: 12px;
39
+ line-height: 1.55;
40
+ }
41
+ @keyframes diff-review-search-highlight {
42
+ 0%, 72% {
43
+ background-color: #c026d3;
44
+ color: #fff;
45
+ box-shadow: inset 0 0 0 2px #f0abfc, 0 0 0 2px #c026d3;
46
+ outline-color: #f0abfc;
47
+ }
48
+ 100% {
49
+ background-color: transparent;
50
+ box-shadow: none;
51
+ outline-color: transparent;
52
+ }
53
+ }
54
+ [data-line].search-highlight,
55
+ [data-column-number].search-highlight {
56
+ animation: diff-review-search-highlight 2.4s ease-out;
57
+ outline: 2px solid transparent;
58
+ outline-offset: -2px;
59
+ }
60
+ [data-line].search-highlight *,
61
+ [data-column-number].search-highlight * {
62
+ color: inherit !important;
63
+ }
64
+ `;
65
+
66
+ export const TREE_CSS = `
67
+ :host {
68
+ --trees-fg-override: var(--fg);
69
+ --trees-fg-muted-override: var(--muted);
70
+ --trees-bg-override: transparent;
71
+ --trees-bg-muted-override: color-mix(in srgb, var(--focus) 14%, transparent);
72
+ --trees-input-bg-override: color-mix(in srgb, var(--bg) 74%, var(--panel-2));
73
+ --trees-search-bg-override: color-mix(in srgb, var(--bg) 74%, var(--panel-2));
74
+ --trees-search-fg-override: var(--fg);
75
+ --trees-search-font-weight-override: 500;
76
+ --trees-density-override: .82;
77
+ --trees-font-size-override: 12px;
78
+ --trees-level-gap-override: 5px;
79
+ --trees-item-padding-x-override: 4px;
80
+ --trees-item-margin-x-override: 1px;
81
+ --trees-item-row-gap-override: 3px;
82
+ --trees-icon-width-override: 13px;
83
+ --trees-git-lane-width-override: 8px;
84
+ --trees-action-lane-width-override: 8px;
85
+ --trees-padding-inline-override: 4px;
86
+ --trees-accent-override: var(--accent);
87
+ --trees-selected-bg-override: color-mix(in srgb, var(--accent) 18%, transparent);
88
+ --trees-selected-fg-override: var(--fg);
89
+ --trees-focus-ring-color-override: var(--focus);
90
+ --trees-border-color-override: var(--border);
91
+ --trees-status-added-override: var(--nugu-info);
92
+ --trees-status-modified-override: var(--nugu-warning);
93
+ --trees-status-renamed-override: var(--nugu-content-important-local);
94
+ --trees-status-deleted-override: var(--nugu-error);
95
+ --trees-git-added-color-override: var(--nugu-info);
96
+ --trees-git-modified-color-override: var(--nugu-warning);
97
+ --trees-git-renamed-color-override: var(--nugu-content-important-local);
98
+ --trees-git-deleted-color-override: var(--nugu-error);
99
+ --trees-font-family-override: ${CODE_FONT};
100
+ }
101
+ [data-file-tree-virtualized-scroll='true'] {
102
+ overflow-x: auto;
103
+ }
104
+ [data-item-git-status='renamed'] [data-item-section='decoration'] {
105
+ color: var(--trees-git-renamed-color);
106
+ font-size: 10px;
107
+ letter-spacing: .04em;
108
+ text-transform: uppercase;
109
+ }
110
+ [data-item-git-status='ignored'] {
111
+ opacity: .58;
112
+ cursor: not-allowed;
113
+ }
114
+ [data-item-git-status='ignored'] [data-item-section='content'] {
115
+ color: var(--trees-fg-muted);
116
+ text-decoration: line-through;
117
+ text-decoration-thickness: 1px;
118
+ }
119
+ [data-item-git-status='ignored'] [data-item-section='decoration'] {
120
+ color: var(--trees-fg-muted);
121
+ font-size: 10px;
122
+ letter-spacing: .04em;
123
+ text-transform: uppercase;
124
+ }
125
+ [data-file-tree-search-container] {
126
+ position: relative;
127
+ display: block !important;
128
+ padding-inline: var(--trees-padding-inline) !important;
129
+ }
130
+ [data-file-tree-search-input] {
131
+ box-sizing: border-box !important;
132
+ width: 100% !important;
133
+ height: 30px !important;
134
+ min-height: 30px !important;
135
+ max-height: 30px !important;
136
+ margin: 0 !important;
137
+ appearance: none !important;
138
+ background: color-mix(in srgb, var(--bg) 60%, var(--panel-2)) !important;
139
+ color: var(--trees-search-fg) !important;
140
+ caret-color: var(--trees-accent) !important;
141
+ border-color: color-mix(in srgb, var(--trees-border-color) 70%, transparent) !important;
142
+ border-radius: 999px !important;
143
+ box-shadow: inset 0 1px 0 color-mix(in srgb, var(--fg) 7%, transparent) !important;
144
+ padding: 6px 30px 6px 11px !important;
145
+ font-size: 12px !important;
146
+ line-height: 18px !important;
147
+ font-family: ${CODE_FONT} !important;
148
+ }
149
+ [data-file-tree-search-input]:focus,
150
+ [data-file-tree-search-input-fake-focus='true'] {
151
+ border-color: var(--trees-focus-ring-color) !important;
152
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--trees-focus-ring-color) 22%, transparent) !important;
153
+ outline: none !important;
154
+ }
155
+ .tree-search-clear {
156
+ position: absolute;
157
+ right: calc(var(--trees-padding-inline) + 9px);
158
+ top: 15px;
159
+ transform: translateY(-50%);
160
+ display: grid;
161
+ place-items: center;
162
+ width: 18px;
163
+ height: 18px;
164
+ padding: 0;
165
+ border: 0;
166
+ border-radius: 999px;
167
+ background: color-mix(in srgb, var(--trees-fg-muted) 20%, transparent);
168
+ color: var(--trees-fg-muted);
169
+ font: 800 14px/1 system-ui, sans-serif;
170
+ cursor: pointer;
171
+ }
172
+ [data-file-tree-search-input]:placeholder-shown + .tree-search-clear {
173
+ display: none;
174
+ }
175
+ .tree-search-clear:hover {
176
+ background: color-mix(in srgb, var(--trees-accent) 24%, transparent);
177
+ color: var(--trees-fg);
178
+ }
179
+ `;