@kgdiff/viewer 0.4.0 → 0.6.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 (257) hide show
  1. package/README.md +43 -16
  2. package/custom-elements.json +2347 -0
  3. package/dist/bind.d.ts +41 -0
  4. package/dist/bind.d.ts.map +1 -0
  5. package/dist/bind.js +47 -0
  6. package/dist/bind.js.map +1 -0
  7. package/dist/context.d.ts +42 -0
  8. package/dist/context.d.ts.map +1 -0
  9. package/dist/context.js +87 -0
  10. package/dist/context.js.map +1 -0
  11. package/dist/controller.d.ts +26 -237
  12. package/dist/controller.d.ts.map +1 -1
  13. package/dist/controller.js +33 -1484
  14. package/dist/controller.js.map +1 -1
  15. package/dist/dom.d.ts +10 -0
  16. package/dist/dom.d.ts.map +1 -1
  17. package/dist/dom.js +29 -0
  18. package/dist/dom.js.map +1 -1
  19. package/dist/element.d.ts +51 -42
  20. package/dist/element.d.ts.map +1 -1
  21. package/dist/element.js +381 -602
  22. package/dist/element.js.map +1 -1
  23. package/dist/elements/actions.d.ts +27 -0
  24. package/dist/elements/actions.d.ts.map +1 -0
  25. package/dist/elements/actions.js +81 -0
  26. package/dist/elements/actions.js.map +1 -0
  27. package/dist/elements/bound.d.ts +63 -0
  28. package/dist/elements/bound.d.ts.map +1 -0
  29. package/dist/elements/bound.js +213 -0
  30. package/dist/elements/bound.js.map +1 -0
  31. package/dist/elements/change-detail.d.ts +25 -0
  32. package/dist/elements/change-detail.d.ts.map +1 -0
  33. package/dist/elements/change-detail.js +19 -0
  34. package/dist/elements/change-detail.js.map +1 -0
  35. package/dist/elements/change-list.d.ts +27 -0
  36. package/dist/elements/change-list.d.ts.map +1 -0
  37. package/dist/elements/change-list.js +29 -0
  38. package/dist/elements/change-list.js.map +1 -0
  39. package/dist/elements/filters.d.ts +25 -0
  40. package/dist/elements/filters.d.ts.map +1 -0
  41. package/dist/elements/filters.js +19 -0
  42. package/dist/elements/filters.js.map +1 -0
  43. package/dist/elements/legend.d.ts +40 -0
  44. package/dist/elements/legend.d.ts.map +1 -0
  45. package/dist/elements/legend.js +87 -0
  46. package/dist/elements/legend.js.map +1 -0
  47. package/dist/elements/minimap.d.ts +38 -0
  48. package/dist/elements/minimap.d.ts.map +1 -0
  49. package/dist/elements/minimap.js +59 -0
  50. package/dist/elements/minimap.js.map +1 -0
  51. package/dist/elements/root.d.ts +40 -0
  52. package/dist/elements/root.d.ts.map +1 -0
  53. package/dist/elements/root.js +67 -0
  54. package/dist/elements/root.js.map +1 -0
  55. package/dist/elements/search.d.ts +29 -0
  56. package/dist/elements/search.d.ts.map +1 -0
  57. package/dist/elements/search.js +23 -0
  58. package/dist/elements/search.js.map +1 -0
  59. package/dist/elements/stage-context.d.ts +31 -0
  60. package/dist/elements/stage-context.d.ts.map +1 -0
  61. package/dist/elements/stage-context.js +4 -0
  62. package/dist/elements/stage-context.js.map +1 -0
  63. package/dist/elements/stage.d.ts +65 -0
  64. package/dist/elements/stage.d.ts.map +1 -0
  65. package/dist/elements/stage.js +259 -0
  66. package/dist/elements/stage.js.map +1 -0
  67. package/dist/elements/title.d.ts +25 -0
  68. package/dist/elements/title.d.ts.map +1 -0
  69. package/dist/elements/title.js +19 -0
  70. package/dist/elements/title.js.map +1 -0
  71. package/dist/elements/transport.d.ts +29 -0
  72. package/dist/elements/transport.d.ts.map +1 -0
  73. package/dist/elements/transport.js +24 -0
  74. package/dist/elements/transport.js.map +1 -0
  75. package/dist/elements/view-bound.d.ts +39 -0
  76. package/dist/elements/view-bound.d.ts.map +1 -0
  77. package/dist/elements/view-bound.js +88 -0
  78. package/dist/elements/view-bound.js.map +1 -0
  79. package/dist/elements/view-dock.d.ts +28 -0
  80. package/dist/elements/view-dock.d.ts.map +1 -0
  81. package/dist/elements/view-dock.js +28 -0
  82. package/dist/elements/view-dock.js.map +1 -0
  83. package/dist/elements/zoom.d.ts +28 -0
  84. package/dist/elements/zoom.d.ts.map +1 -0
  85. package/dist/elements/zoom.js +22 -0
  86. package/dist/elements/zoom.js.map +1 -0
  87. package/dist/i18n.d.ts +10 -0
  88. package/dist/i18n.d.ts.map +1 -1
  89. package/dist/i18n.js +20 -0
  90. package/dist/i18n.js.map +1 -1
  91. package/dist/icons.d.ts +1 -0
  92. package/dist/icons.d.ts.map +1 -1
  93. package/dist/icons.js +1 -0
  94. package/dist/icons.js.map +1 -1
  95. package/dist/index.d.ts +331 -36
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +13 -0
  98. package/dist/index.js.map +1 -1
  99. package/dist/keyboard.d.ts +39 -2
  100. package/dist/keyboard.d.ts.map +1 -1
  101. package/dist/keyboard.js +145 -62
  102. package/dist/keyboard.js.map +1 -1
  103. package/dist/layout-store.d.ts +26 -0
  104. package/dist/layout-store.d.ts.map +1 -0
  105. package/dist/layout-store.js +46 -0
  106. package/dist/layout-store.js.map +1 -0
  107. package/dist/panel-levels.d.ts +18 -0
  108. package/dist/panel-levels.d.ts.map +1 -0
  109. package/dist/panel-levels.js +41 -0
  110. package/dist/panel-levels.js.map +1 -0
  111. package/dist/panels.d.ts +28 -0
  112. package/dist/panels.d.ts.map +1 -0
  113. package/dist/panels.js +73 -0
  114. package/dist/panels.js.map +1 -0
  115. package/dist/pipeline.d.ts.map +1 -1
  116. package/dist/pipeline.js +3 -2
  117. package/dist/pipeline.js.map +1 -1
  118. package/dist/prefs.d.ts +5 -2
  119. package/dist/prefs.d.ts.map +1 -1
  120. package/dist/prefs.js +12 -3
  121. package/dist/prefs.js.map +1 -1
  122. package/dist/react.d.ts +460 -0
  123. package/dist/react.d.ts.map +1 -0
  124. package/dist/react.js +2 -0
  125. package/dist/react.js.map +1 -0
  126. package/dist/root-element.d.ts +122 -0
  127. package/dist/root-element.d.ts.map +1 -0
  128. package/dist/root-element.js +541 -0
  129. package/dist/root-element.js.map +1 -0
  130. package/dist/root.d.ts +54 -0
  131. package/dist/root.d.ts.map +1 -0
  132. package/dist/root.js +288 -0
  133. package/dist/root.js.map +1 -0
  134. package/dist/schedule.d.ts +22 -0
  135. package/dist/schedule.d.ts.map +1 -0
  136. package/dist/schedule.js +41 -0
  137. package/dist/schedule.js.map +1 -0
  138. package/dist/session.d.ts +269 -0
  139. package/dist/session.d.ts.map +1 -0
  140. package/dist/session.js +1237 -0
  141. package/dist/session.js.map +1 -0
  142. package/dist/standalone/kgdiff-viewer-compute.js +1 -1
  143. package/dist/standalone/kgdiff-viewer.js +4 -4
  144. package/dist/styles.d.ts +17 -6
  145. package/dist/styles.d.ts.map +1 -1
  146. package/dist/styles.js +367 -258
  147. package/dist/styles.js.map +1 -1
  148. package/dist/theme.d.ts +32 -0
  149. package/dist/theme.d.ts.map +1 -0
  150. package/dist/theme.js +152 -0
  151. package/dist/theme.js.map +1 -0
  152. package/dist/topics.d.ts +8 -0
  153. package/dist/topics.d.ts.map +1 -0
  154. package/dist/topics.js +18 -0
  155. package/dist/topics.js.map +1 -0
  156. package/dist/ui/change-list.d.ts +18 -0
  157. package/dist/ui/change-list.d.ts.map +1 -0
  158. package/dist/ui/change-list.js +331 -0
  159. package/dist/ui/change-list.js.map +1 -0
  160. package/dist/ui/context.d.ts +34 -7
  161. package/dist/ui/context.d.ts.map +1 -1
  162. package/dist/ui/context.js.map +1 -1
  163. package/dist/ui/filters.d.ts +9 -0
  164. package/dist/ui/filters.d.ts.map +1 -0
  165. package/dist/ui/filters.js +68 -0
  166. package/dist/ui/filters.js.map +1 -0
  167. package/dist/ui/header.d.ts +41 -3
  168. package/dist/ui/header.d.ts.map +1 -1
  169. package/dist/ui/header.js +101 -36
  170. package/dist/ui/header.js.map +1 -1
  171. package/dist/ui/legend.d.ts +15 -0
  172. package/dist/ui/legend.d.ts.map +1 -0
  173. package/dist/ui/legend.js +68 -0
  174. package/dist/ui/legend.js.map +1 -0
  175. package/dist/ui/popovers.d.ts +3 -1
  176. package/dist/ui/popovers.d.ts.map +1 -1
  177. package/dist/ui/popovers.js +62 -23
  178. package/dist/ui/popovers.js.map +1 -1
  179. package/dist/ui/search.d.ts +13 -0
  180. package/dist/ui/search.d.ts.map +1 -0
  181. package/dist/ui/search.js +192 -0
  182. package/dist/ui/search.js.map +1 -0
  183. package/dist/ui/sidebar.d.ts +32 -17
  184. package/dist/ui/sidebar.d.ts.map +1 -1
  185. package/dist/ui/sidebar.js +327 -519
  186. package/dist/ui/sidebar.js.map +1 -1
  187. package/dist/ui/stage.d.ts +56 -1
  188. package/dist/ui/stage.d.ts.map +1 -1
  189. package/dist/ui/stage.js +244 -256
  190. package/dist/ui/stage.js.map +1 -1
  191. package/dist/ui/swatch.js +1 -1
  192. package/dist/ui/swatch.js.map +1 -1
  193. package/dist/ui/transport.d.ts +12 -0
  194. package/dist/ui/transport.d.ts.map +1 -0
  195. package/dist/ui/transport.js +198 -0
  196. package/dist/ui/transport.js.map +1 -0
  197. package/dist/ui/zoom.d.ts +15 -0
  198. package/dist/ui/zoom.d.ts.map +1 -0
  199. package/dist/ui/zoom.js +30 -0
  200. package/dist/ui/zoom.js.map +1 -0
  201. package/dist/view.d.ts +94 -0
  202. package/dist/view.d.ts.map +1 -0
  203. package/dist/view.js +441 -0
  204. package/dist/view.js.map +1 -0
  205. package/package.json +95 -12
  206. package/src/bind.ts +80 -0
  207. package/src/context.ts +106 -0
  208. package/src/controller.ts +52 -1630
  209. package/src/dom.ts +30 -0
  210. package/src/element.ts +386 -619
  211. package/src/elements/actions.ts +94 -0
  212. package/src/elements/bound.ts +247 -0
  213. package/src/elements/change-detail.ts +34 -0
  214. package/src/elements/change-list.ts +51 -0
  215. package/src/elements/filters.ts +34 -0
  216. package/src/elements/legend.ts +103 -0
  217. package/src/elements/minimap.ts +75 -0
  218. package/src/elements/root.ts +86 -0
  219. package/src/elements/search.ts +38 -0
  220. package/src/elements/stage-context.ts +34 -0
  221. package/src/elements/stage.ts +285 -0
  222. package/src/elements/title.ts +34 -0
  223. package/src/elements/transport.ts +39 -0
  224. package/src/elements/view-bound.ts +118 -0
  225. package/src/elements/view-dock.ts +43 -0
  226. package/src/elements/zoom.ts +38 -0
  227. package/src/i18n.ts +20 -0
  228. package/src/icons.ts +1 -0
  229. package/src/index.ts +350 -35
  230. package/src/keyboard.ts +188 -61
  231. package/src/layout-store.ts +71 -0
  232. package/src/panel-levels.ts +53 -0
  233. package/src/panels.ts +81 -0
  234. package/src/pipeline.ts +4 -1
  235. package/src/prefs.ts +12 -4
  236. package/src/react.ts +459 -0
  237. package/src/root-element.ts +624 -0
  238. package/src/root.ts +335 -0
  239. package/src/schedule.ts +43 -0
  240. package/src/session.ts +1375 -0
  241. package/src/styles.ts +396 -263
  242. package/src/theme.ts +170 -0
  243. package/src/topics.ts +37 -0
  244. package/src/ui/change-list.ts +405 -0
  245. package/src/ui/context.ts +36 -7
  246. package/src/ui/filters.ts +79 -0
  247. package/src/ui/header.ts +129 -58
  248. package/src/ui/legend.ts +112 -0
  249. package/src/ui/popovers.ts +68 -25
  250. package/src/ui/search.ts +225 -0
  251. package/src/ui/sidebar.ts +362 -639
  252. package/src/ui/stage.ts +267 -331
  253. package/src/ui/swatch.ts +1 -1
  254. package/src/ui/transport.ts +240 -0
  255. package/src/ui/zoom.ts +45 -0
  256. package/src/view.ts +516 -0
  257. package/vscode.html-custom-data.json +726 -0
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,QAAQ,GAA4B;IAC/C,OAAO;IACP,SAAS;IACT,SAAS;IACT,WAAW;IACX,UAAU;CACX,CAAC;AAEF,+DAA+D;AAC/D,MAAM,UAAU,cAAc,CAAC,KAAY;IACzC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC;IACnC,MAAM,IAAI,GAA2B;QACnC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;QACvC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;QAClC,WAAW,EAAE,KAAK,CAAC,MAA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KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,GAAW;IACjD,MAAM,KAAK,GAAI,GAAG,CAAC,WAAmD,EAAE,aAAa,CAAC;IACtF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,aAAa,CAAC,EAAE,CAAC;IAC7C,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,OAAO,EAA2B,CAAC;AAEtD,mEAAmE;AACnE,MAAM,UAAU,UAAU,CAAC,GAAa;IACtC,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The theme as CSS (RFC 0001 §6; decision 1: CSS is the theme's single source of truth).
3
+ *
4
+ * Colors and fonts are custom properties named `--kgdiff-*`. The built-in themes (dark / light
5
+ * × default / color-blind palette, `getTheme` in @kgdiff/scene, whose contrast is tested there)
6
+ * are token sets a root applies on `:host` (`tokenSheet`). The canvas is drawn with the tokens
7
+ * as computed on the root (`themeFromStyle`), so a token the host overrides with ordinary CSS
8
+ * changes the panels and the canvas alike. Motion and the interaction tints are written as
9
+ * tokens too, for the panels; the canvas keeps the theme's own (they stay in JavaScript).
10
+ */
11
+ import { type Theme } from '@kgdiff/scene';
12
+ /**
13
+ * The public tokens (after `--kgdiff-`), each with where its value lives in a `Theme`: the
14
+ * manifest's CSS custom properties are generated from this list.
15
+ */
16
+ export declare const TOKENS: readonly (readonly [token: string, path: string])[];
17
+ /** Tokens that are not colors (taken as they are). */
18
+ export declare const VERBATIM: ReadonlySet<string>;
19
+ /** CSS custom properties for `theme` (a `:host` rule body). */
20
+ export declare function themeVariables(theme: Theme): string;
21
+ /** The built-in `theme` as a token set on `:host`, parsed once per document. */
22
+ export declare function tokenSheet(theme: Theme, doc: Document): CSSStyleSheet;
23
+ /**
24
+ * The theme the canvas draws with: `base` (the built-in theme of the root's token set) with
25
+ * every token the root's computed `style` sets to another value. Unchanged tokens keep the
26
+ * base's identity, so caches keyed by the theme survive; a value the canvas cannot draw is
27
+ * ignored with a warning.
28
+ */
29
+ export declare function themeFromStyle(base: Theme, style: {
30
+ getPropertyValue(name: string): string;
31
+ }): Theme;
32
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG1D;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EA6BrE,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,MAAM,CAA4C,CAAC;AAgBtF,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAqBnD;AAID,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,GAAG,aAAa,CAYrE;AAgCD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,KAAK,EACX,KAAK,EAAE;IAAE,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAChD,KAAK,CAwBP"}
package/dist/theme.js ADDED
@@ -0,0 +1,152 @@
1
+ /**
2
+ * The theme as CSS (RFC 0001 §6; decision 1: CSS is the theme's single source of truth).
3
+ *
4
+ * Colors and fonts are custom properties named `--kgdiff-*`. The built-in themes (dark / light
5
+ * × default / color-blind palette, `getTheme` in @kgdiff/scene, whose contrast is tested there)
6
+ * are token sets a root applies on `:host` (`tokenSheet`). The canvas is drawn with the tokens
7
+ * as computed on the root (`themeFromStyle`), so a token the host overrides with ordinary CSS
8
+ * changes the panels and the canvas alike. Motion and the interaction tints are written as
9
+ * tokens too, for the panels; the canvas keeps the theme's own (they stay in JavaScript).
10
+ */
11
+ import { contrastRatio } from '@kgdiff/scene';
12
+ import { FAMILIES, sheetFor } from './styles.js';
13
+ /**
14
+ * The public tokens (after `--kgdiff-`), each with where its value lives in a `Theme`: the
15
+ * manifest's CSS custom properties are generated from this list.
16
+ */
17
+ export const TOKENS = [
18
+ ['background', 'canvas.background'],
19
+ ['grid', 'canvas.grid'],
20
+ ['panel', 'surface.panel'],
21
+ ['raised', 'surface.raised'],
22
+ ['overlay', 'surface.overlay'],
23
+ ['border', 'surface.border'],
24
+ ['border-strong', 'surface.borderStrong'],
25
+ ['control-border', 'surface.controlBorder'],
26
+ ['shadow', 'surface.shadow'],
27
+ ['text', 'text.primary'],
28
+ ['text-secondary', 'text.secondary'],
29
+ ['text-muted', 'text.muted'],
30
+ ['accent', 'accent.base'],
31
+ ['accent-strong', 'accent.strong'],
32
+ ['accent-soft', 'accent.soft'],
33
+ ['accent-text', 'accent.text'],
34
+ ['neutral', 'neutral.node'],
35
+ ['neutral-stroke', 'neutral.nodeStroke'],
36
+ ['neutral-edge', 'neutral.edge'],
37
+ ['neutral-label', 'neutral.label'],
38
+ ['font', 'font.family'],
39
+ ['font-mono', 'font.mono'],
40
+ ...FAMILIES.flatMap((f) => [
41
+ [f, `family.${f}.base`],
42
+ [`${f}-strong`, `family.${f}.strong`],
43
+ [`${f}-soft`, `family.${f}.soft`],
44
+ [`${f}-text`, `family.${f}.text`],
45
+ ]),
46
+ ];
47
+ /** Tokens that are not colors (taken as they are). */
48
+ export const VERBATIM = new Set(['shadow', 'font', 'font-mono']);
49
+ function get(theme, path) {
50
+ let at = theme;
51
+ for (const key of path.split('.'))
52
+ at = at[key];
53
+ return at;
54
+ }
55
+ /** A copy of `tree` with `value` at `keys` (copy on write: untouched branches are shared). */
56
+ function put(tree, keys, value) {
57
+ const [key = '', ...rest] = keys;
58
+ return { ...tree, [key]: rest.length > 0 ? put(tree[key], rest, value) : value };
59
+ }
60
+ /** CSS custom properties for `theme` (a `:host` rule body). */
61
+ export function themeVariables(theme) {
62
+ const dark = theme.name === 'dark';
63
+ const vars = [['color-scheme', dark ? 'dark' : 'light']];
64
+ for (const [token, path] of TOKENS)
65
+ vars.push([token, get(theme, path)]);
66
+ vars.push(['fast', `${theme.motion.fast}ms`], ['base', `${theme.motion.base}ms`], ['slow', `${theme.motion.slow}ms`], ['ease', `cubic-bezier(${theme.motion.easing.join(', ')})`],
67
+ // Derived interaction tints (not color-coded: hover / press / inputs / scrims).
68
+ ['hover', dark ? 'rgba(255,255,255,0.045)' : 'rgba(15,23,42,0.04)'], ['press', dark ? 'rgba(255,255,255,0.08)' : 'rgba(15,23,42,0.07)'], ['input', dark ? theme.surface.raised : '#F3F5F8'], ['selected', dark ? theme.surface.raised : '#F5F7FB'], ['scrim', dark ? 'rgba(5,7,11,0.56)' : 'rgba(15,23,42,0.18)'], ['skeleton', dark ? 'rgba(255,255,255,0.05)' : 'rgba(15,23,42,0.05)'], ['skeleton-hi', dark ? 'rgba(255,255,255,0.09)' : 'rgba(15,23,42,0.09)'], ['track', dark ? 'rgba(255,255,255,0.08)' : 'rgba(15,23,42,0.08)'], ['kbd', dark ? 'rgba(255,255,255,0.06)' : 'rgba(15,23,42,0.05)']);
69
+ return vars.map(([k, v]) => `${k === 'color-scheme' ? k : `--kgdiff-${k}`}: ${v};`).join(' ');
70
+ }
71
+ const sheets = new WeakMap();
72
+ /** The built-in `theme` as a token set on `:host`, parsed once per document. */
73
+ export function tokenSheet(theme, doc) {
74
+ let byTheme = sheets.get(doc);
75
+ if (!byTheme) {
76
+ byTheme = new Map();
77
+ sheets.set(doc, byTheme);
78
+ }
79
+ let sheet = byTheme.get(theme);
80
+ if (!sheet) {
81
+ sheet = sheetFor(doc, `:host { ${themeVariables(theme)} }`);
82
+ byTheme.set(theme, sheet);
83
+ }
84
+ return sheet;
85
+ }
86
+ let probe;
87
+ const warned = new Set();
88
+ /**
89
+ * `value` as a color the scene can parse (`#rrggbb`, `rgba()`), or null. A canvas normalizes
90
+ * whatever sRGB color syntax the browser knows (names, `hsl()`, `color-mix()`, …).
91
+ */
92
+ function canvasColor(value) {
93
+ probe ??=
94
+ typeof document === 'undefined' ? null : document.createElement('canvas').getContext('2d');
95
+ let color = value;
96
+ if (probe) {
97
+ probe.fillStyle = '#000';
98
+ probe.fillStyle = value;
99
+ color = String(probe.fillStyle);
100
+ probe.fillStyle = '#fff';
101
+ probe.fillStyle = value;
102
+ if (String(probe.fillStyle) !== color)
103
+ return null;
104
+ }
105
+ try {
106
+ contrastRatio(color, color);
107
+ return color;
108
+ }
109
+ catch {
110
+ return null;
111
+ }
112
+ }
113
+ /** Themes built from computed tokens, by base theme and overrides (stable identities). */
114
+ const built = new Map();
115
+ /**
116
+ * The theme the canvas draws with: `base` (the built-in theme of the root's token set) with
117
+ * every token the root's computed `style` sets to another value. Unchanged tokens keep the
118
+ * base's identity, so caches keyed by the theme survive; a value the canvas cannot draw is
119
+ * ignored with a warning.
120
+ */
121
+ export function themeFromStyle(base, style) {
122
+ const overrides = [];
123
+ for (const [token, path] of TOKENS) {
124
+ const raw = style.getPropertyValue(`--kgdiff-${token}`).trim();
125
+ if (!raw || raw === get(base, path))
126
+ continue;
127
+ const value = VERBATIM.has(token) ? raw : canvasColor(raw);
128
+ if (value === null) {
129
+ if (!warned.has(raw)) {
130
+ warned.add(raw);
131
+ console.warn(`[kgdiff] --kgdiff-${token}: ${raw} is not a color the canvas draws.`);
132
+ }
133
+ }
134
+ else if (value !== get(base, path))
135
+ overrides.push([path, value]);
136
+ }
137
+ if (overrides.length === 0)
138
+ return base;
139
+ const key = `${base.name}/${base.palette}|${overrides.join('|')}`;
140
+ let theme = built.get(key);
141
+ if (!theme) {
142
+ let tree = base;
143
+ for (const [path, value] of overrides)
144
+ tree = put(tree, path.split('.'), value);
145
+ theme = tree;
146
+ if (built.size >= 16)
147
+ built.clear();
148
+ built.set(key, theme);
149
+ }
150
+ return theme;
151
+ }
152
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAc,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAwD;IACzE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IACnC,CAAC,MAAM,EAAE,aAAa,CAAC;IACvB,CAAC,OAAO,EAAE,eAAe,CAAC;IAC1B,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAC5B,CAAC,SAAS,EAAE,iBAAiB,CAAC;IAC9B,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAC5B,CAAC,eAAe,EAAE,sBAAsB,CAAC;IACzC,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;IAC3C,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAC5B,CAAC,MAAM,EAAE,cAAc,CAAC;IACxB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,QAAQ,EAAE,aAAa,CAAC;IACzB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F,KAAK,GAAG,IAAwB,CAAC;QACjC,IAAI,KAAK,CAAC,IAAI,IAAI,EAAE;YAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QACpC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * What the session notifies its listeners about (`DiffSession.subscribe`): one topic per part
3
+ * of its state. A module of its own, so elements can name them without importing the session.
4
+ */
5
+ export type Topic = 'status' | 'data' | 'mode' | 'selection' | 'filters' | 'search' | 'review' | 'replay' | 'hover' | 'theme' | 'locale' | 'focus' | 'swipe' | 'overview';
6
+ /** Every topic: a full render. */
7
+ export declare const ALL_TOPICS: ReadonlySet<Topic>;
8
+ //# sourceMappingURL=topics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["../src/topics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,KAAK,GACb,QAAQ,GACR,MAAM,GACN,MAAM,GACN,WAAW,GACX,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,OAAO,GACP,UAAU,CAAC;AAEf,kCAAkC;AAClC,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,KAAK,CAexC,CAAC"}
package/dist/topics.js ADDED
@@ -0,0 +1,18 @@
1
+ /** Every topic: a full render. */
2
+ export const ALL_TOPICS = new Set([
3
+ 'status',
4
+ 'data',
5
+ 'mode',
6
+ 'selection',
7
+ 'filters',
8
+ 'search',
9
+ 'review',
10
+ 'replay',
11
+ 'hover',
12
+ 'theme',
13
+ 'locale',
14
+ 'focus',
15
+ 'swipe',
16
+ 'overview',
17
+ ]);
18
+ //# sourceMappingURL=topics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.js","sourceRoot":"","sources":["../src/topics.ts"],"names":[],"mappings":"AAoBA,kCAAkC;AAClC,MAAM,CAAC,MAAM,UAAU,GAAuB,IAAI,GAAG,CAAQ;IAC3D,QAAQ;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,UAAU;CACX,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Topic } from '../session.js';
2
+ import { type UiContext } from './context.js';
3
+ /** Row slot and group-header heights (px); rows are 52 px tall inside a 56 px slot. */
4
+ export declare const ROW_SLOT = 56;
5
+ export declare const HEADER_SLOT = 32;
6
+ export declare class ChangeList {
7
+ #private;
8
+ /** Title, count and review progress. */
9
+ readonly head: HTMLElement;
10
+ readonly list: HTMLElement;
11
+ readonly sticky: HTMLElement;
12
+ /** Visually hidden group names the options are described by. */
13
+ readonly phases: HTMLElement;
14
+ constructor(ctx: UiContext);
15
+ update(topics: ReadonlySet<Topic>): void;
16
+ renderWindow(): void;
17
+ }
18
+ //# sourceMappingURL=change-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-list.d.ts","sourceRoot":"","sources":["../../src/ui/change-list.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D,uFAAuF;AACvF,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,WAAW,KAAK,CAAC;AAO9B,qBAAa,UAAU;;IACrB,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAkC;IAa9D,YAAY,GAAG,EAAE,SAAS,EAsCzB;IAED,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,CAmBvC;IA2HD,YAAY,IAAI,IAAI,CAqBnB;CA+JF"}
@@ -0,0 +1,331 @@
1
+ import { attr, h, icon, isOpen, replace, setText } from '../dom.js';
2
+ import { frameOrTimeout } from '../schedule.js';
3
+ import { sceneHunkGlyph } from './context.js';
4
+ /** Row slot and group-header heights (px); rows are 52 px tall inside a 56 px slot. */
5
+ export const ROW_SLOT = 56;
6
+ export const HEADER_SLOT = 32;
7
+ const OVERSCAN = 320;
8
+ function itemHeight(item) {
9
+ return item.kind === 'header' ? HEADER_SLOT : ROW_SLOT;
10
+ }
11
+ export class ChangeList {
12
+ /** Title, count and review progress. */
13
+ head;
14
+ list;
15
+ sticky;
16
+ /** Visually hidden group names the options are described by. */
17
+ phases = h('div', { class: 'sr-only' });
18
+ #title;
19
+ #count;
20
+ #progress;
21
+ #progressText;
22
+ #progressBar;
23
+ #listInner;
24
+ #offsets = [];
25
+ #rendered = new Map();
26
+ #scrollQueued = false;
27
+ #ctx;
28
+ constructor(ctx) {
29
+ this.#ctx = ctx;
30
+ const c = ctx.controller;
31
+ this.#title = h('h2', { id: 'kg-changes-title' });
32
+ this.#count = h('span', { class: 'count-badge' });
33
+ this.#progressText = h('span');
34
+ this.#progressBar = h('div');
35
+ this.#progress = h('div', { class: 'progress' }, this.#progressText, h('span', { class: 'bar', 'aria-hidden': 'true' }, this.#progressBar));
36
+ this.head = h('div', { class: 'sb-title' }, this.#title, this.#count, this.#progress);
37
+ this.#listInner = h('div', { class: 'list-inner', role: 'presentation' });
38
+ this.list = h('div', {
39
+ class: 'list scroll',
40
+ role: 'listbox',
41
+ tabindex: '0',
42
+ 'aria-labelledby': 'kg-changes-title',
43
+ 'aria-keyshortcuts': 'J K X Enter Home End',
44
+ }, this.#listInner);
45
+ this.list.addEventListener('scroll', () => this.#queueWindow(), { passive: true });
46
+ this.list.addEventListener('click', (e) => this.#onListClick(e));
47
+ this.list.addEventListener('dblclick', (e) => {
48
+ const row = e.target.closest('.row');
49
+ if (row)
50
+ c.flyToSelection();
51
+ });
52
+ this.sticky = h('div', { class: 'sticky', 'aria-hidden': 'true', hidden: true });
53
+ ctx.target('list', () => this.list.focus({ preventScroll: true }), () => isOpen(this.list));
54
+ }
55
+ update(topics) {
56
+ const tr = this.#ctx.tr();
57
+ const all = topics.has('status') || topics.has('data') || topics.has('locale');
58
+ if (all) {
59
+ setText(this.#title, tr.t('sidebar.changes'));
60
+ const scene = this.#ctx.controller.scene;
61
+ setText(this.#count, tr.num(scene?.hunks.length ?? 0));
62
+ this.#count.hidden = !scene;
63
+ }
64
+ if (all || topics.has('filters'))
65
+ this.#layoutList();
66
+ if (all || topics.has('review')) {
67
+ this.#renderProgress();
68
+ this.#refreshRows();
69
+ }
70
+ if (topics.has('selection')) {
71
+ this.#refreshRows();
72
+ this.#revealSelected();
73
+ }
74
+ if (all || topics.has('search'))
75
+ this.#stepAside();
76
+ }
77
+ /**
78
+ * The search's results take the list's place while the query is not blank. Coming back, the
79
+ * list measures itself on the next frame, once every region has updated (the results it
80
+ * shared its space with are hidden by then, whatever order the regions update in).
81
+ */
82
+ #stepAside() {
83
+ const searching = this.#ctx.controller.query.trim() !== '';
84
+ if (this.list.hidden === searching)
85
+ return;
86
+ this.list.hidden = searching;
87
+ if (searching)
88
+ this.sticky.hidden = true;
89
+ else
90
+ this.#queueWindow();
91
+ }
92
+ #renderProgress() {
93
+ const tr = this.#ctx.tr();
94
+ const state = this.#ctx.controller.reviewState();
95
+ const done = state.reviewed.length;
96
+ const total = state.total;
97
+ this.#progress.hidden = total === 0;
98
+ const complete = total > 0 && done === total;
99
+ attr(this.#progress, 'data-complete', String(complete));
100
+ setText(this.#progressText, complete ? tr.t('review.complete') : tr.t('review.progress', { done, total }));
101
+ this.#progressBar.style.transform = `scaleX(${total > 0 ? done / total : 0})`;
102
+ }
103
+ // ─── Virtual list ────────────────────────────────────────────────────────
104
+ #layoutList() {
105
+ const c = this.#ctx.controller;
106
+ const tr = this.#ctx.tr();
107
+ replace(this.phases, c.list.items.map((it) => it.kind === 'header'
108
+ ? h('span', {
109
+ id: `kg-phase-${it.phase}`,
110
+ text: `${tr.t(`phase.${it.phase}`)} (${tr.num(it.count)})`,
111
+ })
112
+ : null));
113
+ for (const el of this.#rendered.values())
114
+ el.remove();
115
+ this.#rendered.clear();
116
+ const items = c.list.items;
117
+ this.#offsets = new Array(items.length);
118
+ let y = 0;
119
+ for (let i = 0; i < items.length; i++) {
120
+ this.#offsets[i] = y;
121
+ y += itemHeight(items[i]);
122
+ }
123
+ this.#listInner.style.height = `${y + 8}px`;
124
+ this.#renderEmpty();
125
+ this.renderWindow();
126
+ }
127
+ #renderEmpty() {
128
+ const c = this.#ctx.controller;
129
+ const tr = this.#ctx.tr();
130
+ const existing = this.#listInner.querySelector('.list-empty, .skeleton');
131
+ existing?.remove();
132
+ if (c.status === 'loading' || c.status === 'idle') {
133
+ const sk = h('div', { class: 'skeleton', 'aria-hidden': 'true' });
134
+ if (c.status === 'loading') {
135
+ for (let i = 0; i < 6; i++) {
136
+ sk.appendChild(h('div', { class: 'skeleton-row shimmer' }, h('span', { class: 'g' }), h('span', { class: 'b' })));
137
+ }
138
+ }
139
+ this.#listInner.appendChild(sk);
140
+ return;
141
+ }
142
+ if (c.status !== 'ready' || c.list.items.length > 0)
143
+ return;
144
+ const filtered = c.families.size > 0 && c.hunkCount > 0;
145
+ this.#listInner.appendChild(h('div', { class: 'list-empty' }, icon(filtered ? 'search' : 'check-circle'), h('span', { text: tr.t(filtered ? 'sidebar.filteredEmpty' : 'sidebar.noChanges') }), filtered
146
+ ? h('button', {
147
+ type: 'button',
148
+ class: 'btn',
149
+ text: tr.t('sidebar.clearFilters'),
150
+ onclick: () => c.setFamilies([]),
151
+ })
152
+ : null));
153
+ }
154
+ #queueWindow() {
155
+ if (this.#scrollQueued)
156
+ return;
157
+ this.#scrollQueued = true;
158
+ frameOrTimeout(() => {
159
+ this.#scrollQueued = false;
160
+ this.renderWindow();
161
+ });
162
+ }
163
+ /** First item index whose bottom is below `y` (binary search over offsets). */
164
+ #indexAt(y) {
165
+ let lo = 0;
166
+ let hi = this.#offsets.length;
167
+ while (lo < hi) {
168
+ const mid = (lo + hi) >> 1;
169
+ if (this.#offsets[mid] + ROW_SLOT <= y)
170
+ lo = mid + 1;
171
+ else
172
+ hi = mid;
173
+ }
174
+ return lo;
175
+ }
176
+ renderWindow() {
177
+ const items = this.#ctx.controller.list.items;
178
+ const top = this.list.scrollTop;
179
+ const height = this.list.clientHeight || 640;
180
+ const from = this.#indexAt(Math.max(0, top - OVERSCAN));
181
+ const limit = top + height + OVERSCAN;
182
+ const needed = new Set();
183
+ for (let i = from; i < items.length && this.#offsets[i] < limit; i++)
184
+ needed.add(i);
185
+ for (const [i, el] of this.#rendered) {
186
+ if (!needed.has(i)) {
187
+ el.remove();
188
+ this.#rendered.delete(i);
189
+ }
190
+ }
191
+ for (const i of needed) {
192
+ if (this.#rendered.has(i))
193
+ continue;
194
+ const el = this.#renderItem(items[i], this.#offsets[i]);
195
+ this.#rendered.set(i, el);
196
+ this.#listInner.appendChild(el);
197
+ }
198
+ this.#renderSticky(top);
199
+ }
200
+ #renderItem(item, y) {
201
+ const tr = this.#ctx.tr();
202
+ const c = this.#ctx.controller;
203
+ if (item.kind === 'header') {
204
+ return h('div', { class: 'group', role: 'presentation', style: `top: ${y}px` }, h('span', { text: tr.t(`phase.${item.phase}`) }), h('span', { class: 'n', text: tr.num(item.count) }));
205
+ }
206
+ const hunk = c.scene?.hunks[item.hunk];
207
+ const reviewed = c.isReviewed(hunk.id);
208
+ // Pointer shortcut only: options hold no interactive children. Keyboard users press `x` or
209
+ // use the detail panel's "Reviewed" button.
210
+ const rv = h('span', {
211
+ class: 'rv',
212
+ 'aria-hidden': 'true',
213
+ 'data-pressed': String(reviewed),
214
+ title: tr.t(reviewed ? 'review.unmark' : 'review.mark'),
215
+ 'data-hunk': hunk.id,
216
+ }, h('span', { class: 'ring' }, icon('check')));
217
+ const rank = c.list.rank.get(item.hunk) ?? 0;
218
+ const row = h('div', {
219
+ class: 'row',
220
+ role: 'option',
221
+ id: `kg-opt-${item.hunk}`,
222
+ 'data-index': String(item.hunk),
223
+ 'data-family': hunk.family,
224
+ 'data-reviewed': String(reviewed),
225
+ 'aria-selected': String(c.selectedHunk === item.hunk),
226
+ 'aria-setsize': String(c.list.order.length),
227
+ 'aria-posinset': String(rank + 1),
228
+ 'aria-describedby': `kg-phase-${hunk.phase}`,
229
+ style: `top: ${y + 2}px`,
230
+ }, h('span', { class: 'glyph-box', 'aria-hidden': 'true', text: sceneHunkGlyph(hunk) }), h('span', { class: 'txt' }, h('span', { class: 'title', title: hunk.title, text: hunk.title }), h('span', { class: 'sub', text: hunk.subtitle })), rv);
231
+ this.#labelRow(row, hunk, reviewed);
232
+ return row;
233
+ }
234
+ #labelRow(row, hunk, reviewed) {
235
+ const tr = this.#ctx.tr();
236
+ const parts = [hunk.title];
237
+ if (hunk.subtitle)
238
+ parts.push(hunk.subtitle);
239
+ if (reviewed)
240
+ parts.push(tr.t('review.toggle'));
241
+ attr(row, 'aria-label', parts.join('. '));
242
+ }
243
+ /** Update selection / reviewed state of the rendered rows in place. */
244
+ #refreshRows() {
245
+ const c = this.#ctx.controller;
246
+ const tr = this.#ctx.tr();
247
+ for (const el of this.#rendered.values()) {
248
+ if (!el.classList.contains('row'))
249
+ continue;
250
+ const index = Number(el.dataset.index);
251
+ const hunk = c.scene?.hunks[index];
252
+ if (!hunk)
253
+ continue;
254
+ const reviewed = c.isReviewed(hunk.id);
255
+ attr(el, 'aria-selected', String(index === c.selectedHunk));
256
+ attr(el, 'data-reviewed', String(reviewed));
257
+ const rv = el.querySelector('.rv');
258
+ attr(rv, 'data-pressed', String(reviewed));
259
+ attr(rv, 'title', tr.t(reviewed ? 'review.unmark' : 'review.mark'));
260
+ this.#labelRow(el, hunk, reviewed);
261
+ }
262
+ const sel = c.selectedHunk;
263
+ attr(this.list, 'aria-activedescendant', sel >= 0 && c.list.rank.has(sel) ? `kg-opt-${sel}` : null);
264
+ }
265
+ #revealSelected() {
266
+ const c = this.#ctx.controller;
267
+ const item = c.list.itemOf.get(c.selectedHunk);
268
+ if (item === undefined)
269
+ return;
270
+ const y = this.#offsets[item];
271
+ const top = this.list.scrollTop;
272
+ // Not laid out yet (hidden sheet): position it for when it shows.
273
+ const height = this.list.clientHeight || 640;
274
+ // The first row of a group scrolls its group header into view too.
275
+ const above = c.list.items[item - 1]?.kind === 'header'
276
+ ? this.#offsets[item - 1]
277
+ : y - HEADER_SLOT;
278
+ if (y < top + HEADER_SLOT)
279
+ this.list.scrollTop = Math.max(0, above);
280
+ else if (y + ROW_SLOT > top + height)
281
+ this.list.scrollTop = y + ROW_SLOT - height + 8;
282
+ this.renderWindow();
283
+ this.#refreshRows();
284
+ }
285
+ #renderSticky(top) {
286
+ const items = this.#ctx.controller.list.items;
287
+ let current = -1;
288
+ let next = -1;
289
+ for (let i = 0; i < items.length; i++) {
290
+ if (items[i]?.kind !== 'header')
291
+ continue;
292
+ if (this.#offsets[i] <= top)
293
+ current = i;
294
+ else {
295
+ next = i;
296
+ break;
297
+ }
298
+ }
299
+ if (current < 0 || top <= 0) {
300
+ this.sticky.hidden = true;
301
+ return;
302
+ }
303
+ const item = items[current];
304
+ const tr = this.#ctx.tr();
305
+ this.sticky.hidden = false;
306
+ const label = `${tr.t(`phase.${item.phase}`)}|${item.count}`;
307
+ if (this.sticky.dataset.key !== label) {
308
+ this.sticky.dataset.key = label;
309
+ replace(this.sticky, h('div', { class: 'group' }, h('span', { text: tr.t(`phase.${item.phase}`) }), h('span', { class: 'n', text: tr.num(item.count) })));
310
+ }
311
+ const push = next >= 0 ? Math.min(0, this.#offsets[next] - top - HEADER_SLOT) : 0;
312
+ this.sticky.style.transform = `translateY(${push}px)`;
313
+ }
314
+ #onListClick(e) {
315
+ const c = this.#ctx.controller;
316
+ const target = e.target;
317
+ const rv = target.closest('.rv');
318
+ if (rv?.dataset.hunk) {
319
+ e.stopPropagation();
320
+ c.toggleReviewed(rv.dataset.hunk);
321
+ return;
322
+ }
323
+ const row = target.closest('.row');
324
+ if (!row)
325
+ return;
326
+ const index = Number(row.dataset.index);
327
+ if (Number.isInteger(index))
328
+ c.selectHunk(index);
329
+ }
330
+ }
331
+ //# sourceMappingURL=change-list.js.map