@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
@@ -0,0 +1,29 @@
1
+ import { h } from '../dom.js';
2
+ import { ChangeList } from '../ui/change-list.js';
3
+ import { BoundElement, define } from './bound.js';
4
+ /**
5
+ * The "Changes" title with the count and review progress, and the changes grouped by phase (a
6
+ * virtualized listbox; `j` / `k` / `x`, Enter, Home / End). A labelled region. While a search is
7
+ * active (the session's query is not blank) its rows step aside. Registers itself as the root's
8
+ * `list` focus target (choosing a search result moves focus here).
9
+ *
10
+ * @tagname kgdiff-change-list
11
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
12
+ */
13
+ export class KgdiffChangeList extends BoundElement {
14
+ name = 'change-list';
15
+ build(ui, _ctx, release) {
16
+ const list = new ChangeList(ui);
17
+ const rows = h('div', { class: 'list-wrap' }, list.sticky, list.list, list.phases);
18
+ this.shadow.append(h('section', { class: 'change-list', 'aria-labelledby': 'kg-changes-title' }, h('div', { class: 'sb-head' }, list.head), rows));
19
+ if (typeof ResizeObserver === 'function') {
20
+ // The list draws the rows in view: it needs its height.
21
+ const ro = new ResizeObserver(() => list.renderWindow());
22
+ ro.observe(rows);
23
+ release(() => ro.disconnect());
24
+ }
25
+ return list;
26
+ }
27
+ }
28
+ define('kgdiff-change-list', KgdiffChangeList);
29
+ //# sourceMappingURL=change-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"change-list.js","sourceRoot":"","sources":["../../src/elements/change-list.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAC7B,IAAI,GAAG,aAAa,CAAC;IAE9B,KAAK,CAAC,EAAa,EAAE,IAAa,EAAE,OAAiC;QAC7E,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM,CAAC,MAAM,CAChB,CAAC,CACC,SAAS,EACT,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,EAC/D,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EACzC,IAAI,CACL,CACF,CAAC;QACF,IAAI,OAAO,cAAc,KAAK,UAAU,EAAE,CAAC;YACzC,wDAAwD;YACxD,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACzD,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACjB,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `<kgdiff-filters>` (RFC 0001 §3), documented on its class. Importing this module defines it.
3
+ */
4
+ import type { Region } from '../bind.js';
5
+ import type { KgdiffBoundElement } from '../index.js';
6
+ import type { UiContext } from '../ui/context.js';
7
+ import { BoundElement } from './bound.js';
8
+ /**
9
+ * One chip per kind of change the diff has, with its count and the legend's swatch, toggling the
10
+ * session's family filter, and "Show all" while a filter is on.
11
+ *
12
+ * @tagname kgdiff-filters
13
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
14
+ */
15
+ export declare class KgdiffFilters extends BoundElement implements KgdiffBoundElement {
16
+ protected readonly name = "filters";
17
+ protected build(ui: UiContext): Region;
18
+ }
19
+ declare global {
20
+ interface HTMLElementTagNameMap {
21
+ /** @experimental In 0.6. */
22
+ 'kgdiff-filters': KgdiffBoundElement;
23
+ }
24
+ }
25
+ //# sourceMappingURL=filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/elements/filters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAU,MAAM,YAAY,CAAC;AAElD;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,YAAa,YAAW,kBAAkB;IAC3E,SAAS,CAAC,QAAQ,CAAC,IAAI,aAAa;IAEpC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAIrC;CACF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B;QAC5B,gBAAgB,EAAE,kBAAkB,CAAC;KACtC;CACF"}
@@ -0,0 +1,19 @@
1
+ import { Filters } from '../ui/filters.js';
2
+ import { BoundElement, define } from './bound.js';
3
+ /**
4
+ * One chip per kind of change the diff has, with its count and the legend's swatch, toggling the
5
+ * session's family filter, and "Show all" while a filter is on.
6
+ *
7
+ * @tagname kgdiff-filters
8
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
9
+ */
10
+ export class KgdiffFilters extends BoundElement {
11
+ name = 'filters';
12
+ build(ui) {
13
+ const filters = new Filters(ui);
14
+ this.shadow.append(filters.el);
15
+ return filters;
16
+ }
17
+ }
18
+ define('kgdiff-filters', KgdiffFilters);
19
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../src/elements/filters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC1B,IAAI,GAAG,SAAS,CAAC;IAE1B,KAAK,CAAC,EAAa;QAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC/B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAED,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * `<kgdiff-legend>` (RFC 0001 §3), documented on its class. Importing this module defines it.
3
+ */
4
+ import type { Region } from '../bind.js';
5
+ import type { KgdiffLegendElement, LegendVariant } from '../index.js';
6
+ import type { UiContext } from '../ui/context.js';
7
+ import { BoundElement } from './bound.js';
8
+ /**
9
+ * What the colors mean. `variant="full"` (the default): a card of every family's swatch and name,
10
+ * folded to its head until opened; `open` reflects whether it is (the user's toggle included, as on
11
+ * `<details>`). `variant="mini"`: one line of dots for the families the root's diff has, then the
12
+ * unchanged context. Binds to a root (`for`, `htmlFor`, `rootElement`). Slotted into a
13
+ * `<kgdiff-stage>` it replaces the stage's built-in legend; placed anywhere else it is not kept
14
+ * clear of fits and flights unless registered.
15
+ *
16
+ * @tagname kgdiff-legend
17
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
18
+ */
19
+ export declare class KgdiffLegend extends BoundElement implements KgdiffLegendElement {
20
+ #private;
21
+ static get observedAttributes(): readonly string[];
22
+ protected readonly name = "legend";
23
+ /** `full` (the card) or `mini` (one line), reflected to `variant`; another value reads `full`. */
24
+ get variant(): LegendVariant;
25
+ set variant(value: LegendVariant);
26
+ /** Whether the card is open, reflected to the boolean `open` attribute (the user's toggle too). */
27
+ get open(): boolean;
28
+ set open(value: boolean);
29
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
30
+ protected upgradedProperties(): readonly string[];
31
+ protected build(ui: UiContext): Region;
32
+ disconnectedCallback(): void;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ /** @experimental In 0.6. */
37
+ 'kgdiff-legend': KgdiffLegendElement;
38
+ }
39
+ }
40
+ //# sourceMappingURL=legend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/elements/legend.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAU,MAAM,YAAY,CAAC;AAIlD;;;;;;;;;;GAUG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,mBAAmB;;IAC3E,WAAoB,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAE1D;IAED,SAAS,CAAC,QAAQ,CAAC,IAAI,YAAY;IAInC,kGAAkG;IAClG,IAAI,OAAO,IAAI,aAAa,CAG3B;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,EAG/B;IAED,mGAAmG;IACnG,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,OAAO,EAEtB;IAEQ,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAI9F;IAED,UAAmB,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEzD;IAED,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAkBrC;IAUQ,oBAAoB,IAAI,IAAI,CAGpC;CACF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B;QAC5B,eAAe,EAAE,mBAAmB,CAAC;KACtC;CACF"}
@@ -0,0 +1,87 @@
1
+ import { Legend } from '../ui/legend.js';
2
+ import { BoundElement, define } from './bound.js';
3
+ const VARIANTS = ['full', 'mini'];
4
+ /**
5
+ * What the colors mean. `variant="full"` (the default): a card of every family's swatch and name,
6
+ * folded to its head until opened; `open` reflects whether it is (the user's toggle included, as on
7
+ * `<details>`). `variant="mini"`: one line of dots for the families the root's diff has, then the
8
+ * unchanged context. Binds to a root (`for`, `htmlFor`, `rootElement`). Slotted into a
9
+ * `<kgdiff-stage>` it replaces the stage's built-in legend; placed anywhere else it is not kept
10
+ * clear of fits and flights unless registered.
11
+ *
12
+ * @tagname kgdiff-legend
13
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
14
+ */
15
+ export class KgdiffLegend extends BoundElement {
16
+ static get observedAttributes() {
17
+ return ['for', 'variant', 'open'];
18
+ }
19
+ name = 'legend';
20
+ #legend = null;
21
+ #reflecting = false;
22
+ /** `full` (the card) or `mini` (one line), reflected to `variant`; another value reads `full`. */
23
+ get variant() {
24
+ const v = this.getAttribute('variant');
25
+ return v !== null && VARIANTS.includes(v) ? v : 'full';
26
+ }
27
+ set variant(value) {
28
+ if (VARIANTS.includes(value) && value !== 'full')
29
+ this.setAttribute('variant', value);
30
+ else
31
+ this.removeAttribute('variant');
32
+ }
33
+ /** Whether the card is open, reflected to the boolean `open` attribute (the user's toggle too). */
34
+ get open() {
35
+ return this.hasAttribute('open');
36
+ }
37
+ set open(value) {
38
+ this.toggleAttribute('open', Boolean(value));
39
+ }
40
+ attributeChangedCallback(name, old, value) {
41
+ if (name === 'for')
42
+ super.attributeChangedCallback(name, old, value);
43
+ else if (name === 'open' && !this.#reflecting)
44
+ this.#legend?.setOpen(this.open);
45
+ else if (name === 'variant')
46
+ this.#place();
47
+ }
48
+ upgradedProperties() {
49
+ return [...super.upgradedProperties(), 'variant', 'open'];
50
+ }
51
+ build(ui) {
52
+ const legend = new Legend(ui, (open) => {
53
+ // The user's toggle, reflected as <details> does.
54
+ this.#reflecting = true;
55
+ try {
56
+ this.toggleAttribute('open', open);
57
+ }
58
+ finally {
59
+ this.#reflecting = false;
60
+ }
61
+ });
62
+ this.#legend = legend;
63
+ legend.setOpen(this.open);
64
+ this.#place();
65
+ return {
66
+ update: (topics) => {
67
+ if (this.#legend === legend)
68
+ legend.update(topics);
69
+ },
70
+ };
71
+ }
72
+ /** Show the variant asked for. */
73
+ #place() {
74
+ const legend = this.#legend;
75
+ if (!legend || !this.isConnected)
76
+ return;
77
+ const shown = this.variant === 'mini' ? legend.mini : legend.card;
78
+ if (this.shadow.firstElementChild !== shown)
79
+ this.shadow.replaceChildren(shown);
80
+ }
81
+ disconnectedCallback() {
82
+ super.disconnectedCallback();
83
+ this.#legend = null;
84
+ }
85
+ }
86
+ define('kgdiff-legend', KgdiffLegend);
87
+ //# sourceMappingURL=legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legend.js","sourceRoot":"","sources":["../../src/elements/legend.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `<kgdiff-minimap>` (RFC 0001 §3), documented on its class. Importing this module defines it.
3
+ */
4
+ import type { Region } from '../bind.js';
5
+ import type { KgdiffMinimapElement } from '../index.js';
6
+ import type { UiContext } from '../ui/context.js';
7
+ import type { StageView } from '../view.js';
8
+ import { ViewBoundElement } from './view-bound.js';
9
+ /**
10
+ * An overview of one stage's view, with the part in view outlined. While the whole graph is in view
11
+ * it has nothing to add: it is in the custom state `overview` then (`:state(overview)`, and the
12
+ * read-only `overview` property). A minimap the page places stays shown
13
+ * (`kgdiff-minimap:state(overview) { visibility: hidden }` hides it without moving the layout); one
14
+ * slotted into a stage replaces the stage's own and hides as it did. Binds to the nearest
15
+ * `<kgdiff-stage>` around it, or to the one `stage="<id>"` names (`stage`, `stageElement`,
16
+ * `rootElement`). Slotted into a stage it replaces the stage's built-in minimap; placed anywhere
17
+ * else it is not kept clear of fits and flights unless registered.
18
+ *
19
+ * @tagname kgdiff-minimap
20
+ * @cssstate overview - While the whole graph is in view. A minimap the page places stays
21
+ * shown; `kgdiff-minimap:state(overview) { visibility: hidden }` hides it in place.
22
+ * Slotted into a stage it hides then, as the stage's own does.
23
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
24
+ */
25
+ export declare class KgdiffMinimap extends ViewBoundElement implements KgdiffMinimapElement {
26
+ #private;
27
+ protected readonly name = "minimap";
28
+ /** Whether the whole graph is in view: the custom state `overview` (`:state(overview)`). */
29
+ get overview(): boolean;
30
+ protected build(ui: UiContext, view: StageView, release: (fn: () => void) => void): Region;
31
+ }
32
+ declare global {
33
+ interface HTMLElementTagNameMap {
34
+ /** @experimental In 0.6. */
35
+ 'kgdiff-minimap': KgdiffMinimapElement;
36
+ }
37
+ }
38
+ //# sourceMappingURL=minimap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minimap.d.ts","sourceRoot":"","sources":["../../src/elements/minimap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,gBAAiB,YAAW,oBAAoB;;IACjF,SAAS,CAAC,QAAQ,CAAC,IAAI,aAAa;IAOpC,4FAA4F;IAC5F,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAWD,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,GAAG,MAAM,CAezF;CACF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B;QAC5B,gBAAgB,EAAE,oBAAoB,CAAC;KACxC;CACF"}
@@ -0,0 +1,59 @@
1
+ import { attr, h } from '../dom.js';
2
+ import { define } from './bound.js';
3
+ import { ViewBoundElement } from './view-bound.js';
4
+ /**
5
+ * An overview of one stage's view, with the part in view outlined. While the whole graph is in view
6
+ * it has nothing to add: it is in the custom state `overview` then (`:state(overview)`, and the
7
+ * read-only `overview` property). A minimap the page places stays shown
8
+ * (`kgdiff-minimap:state(overview) { visibility: hidden }` hides it without moving the layout); one
9
+ * slotted into a stage replaces the stage's own and hides as it did. Binds to the nearest
10
+ * `<kgdiff-stage>` around it, or to the one `stage="<id>"` names (`stage`, `stageElement`,
11
+ * `rootElement`). Slotted into a stage it replaces the stage's built-in minimap; placed anywhere
12
+ * else it is not kept clear of fits and flights unless registered.
13
+ *
14
+ * @tagname kgdiff-minimap
15
+ * @cssstate overview - While the whole graph is in view. A minimap the page places stays
16
+ * shown; `kgdiff-minimap:state(overview) { visibility: hidden }` hides it in place.
17
+ * Slotted into a stage it hides then, as the stage's own does.
18
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
19
+ */
20
+ export class KgdiffMinimap extends ViewBoundElement {
21
+ name = 'minimap';
22
+ /** The custom states (`:state(overview)`); null where `ElementInternals` is missing. */
23
+ #internals = typeof this.attachInternals === 'function' ? this.attachInternals() : null;
24
+ #overview = false;
25
+ /** Whether the whole graph is in view: the custom state `overview` (`:state(overview)`). */
26
+ get overview() {
27
+ return this.#overview;
28
+ }
29
+ #setOverview(overview) {
30
+ if (overview === this.#overview)
31
+ return;
32
+ this.#overview = overview;
33
+ const states = this.#internals?.states;
34
+ if (!states)
35
+ return;
36
+ if (overview)
37
+ states.add('overview');
38
+ else
39
+ states.delete('overview');
40
+ }
41
+ build(ui, view, release) {
42
+ const host = h('div', { class: 'minimap-host' });
43
+ this.shadow.append(host);
44
+ release(view.addMinimap(host));
45
+ release(() => this.#setOverview(false));
46
+ return {
47
+ update: (topics) => {
48
+ if (topics.has('status') || topics.has('data') || topics.has('locale')) {
49
+ const label = ui.tr().t('minimap.label');
50
+ attr(host, 'aria-label', label);
51
+ attr(host, 'title', label);
52
+ }
53
+ this.#setOverview(view.overview);
54
+ },
55
+ };
56
+ }
57
+ }
58
+ define('kgdiff-minimap', KgdiffMinimap);
59
+ //# sourceMappingURL=minimap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minimap.js","sourceRoot":"","sources":["../../src/elements/minimap.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,aAAc,SAAQ,gBAAgB;IAC9B,IAAI,GAAG,SAAS,CAAC;IAEpC,wFAAwF;IAC/E,UAAU,GACjB,OAAO,IAAI,CAAC,eAAe,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,SAAS,GAAG,KAAK,CAAC;IAElB,4FAA4F;IAC5F,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,QAAiB;QAC5B,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS;YAAE,OAAO;QACxC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC;QACvC,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,IAAI,QAAQ;YAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;;YAChC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAES,KAAK,CAAC,EAAa,EAAE,IAAe,EAAE,OAAiC;QAC/E,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QACxC,OAAO;YACL,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;gBACjB,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACvE,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;oBACzC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;oBAChC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC7B,CAAC;gBACD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACnC,CAAC;SACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * `<kgdiff-root>` (RFC 0001 §3), documented on its class. Importing this module defines it.
3
+ */
4
+ import type { KgdiffRootElement } from '../index.js';
5
+ import { RootElement } from '../root-element.js';
6
+ import { DiffSession, type SessionDeps, type SessionHost } from '../session.js';
7
+ import type { UiActions } from '../ui/context.js';
8
+ /**
9
+ * A root without visuals. It owns the session and provides it to the elements inside it
10
+ * (`<kgdiff-stage>`, `<kgdiff-change-list>`, …) or naming it with `for`, and owns what they share:
11
+ * the keyboard map, the live region announcing navigation, the events and the theme tokens. It has
12
+ * the attributes, properties, methods and events of `<kgdiff-viewer>` except the layout's
13
+ * (`panels`, `sidebar`, `header`, `chrome`, `legend`, `persist`): the page lays the elements out,
14
+ * and nothing is remembered.
15
+ *
16
+ * It renders as `display: contents`, so its children are laid out by the page as if it were not
17
+ * there.
18
+ *
19
+ * @tagname kgdiff-root
20
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
21
+ */
22
+ export declare class KgdiffRoot extends RootElement implements KgdiffRootElement {
23
+ #private;
24
+ static get observedAttributes(): readonly string[];
25
+ constructor();
26
+ protected sheets(doc: Document): readonly CSSStyleSheet[];
27
+ /** A session without a canvas of its own: each `<kgdiff-stage>` brings its view. */
28
+ protected createSession(host: SessionHost, deps: SessionDeps): DiffSession;
29
+ /** No layout of its own: `\` does nothing, `?` and `/` go to the elements registered last. */
30
+ protected actions(): UiActions;
31
+ protected connected(): void;
32
+ protected disconnected(): void;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ /** @experimental In 0.6. */
37
+ 'kgdiff-root': KgdiffRootElement;
38
+ }
39
+ }
40
+ //# sourceMappingURL=root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/elements/root.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAmB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;;;;;;;;GAaG;AACH,qBAAa,UAAW,SAAQ,WAAY,YAAW,iBAAiB;;IACtE,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAID,cAUC;IAED,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,SAAS,aAAa,EAAE,CAExD;IAED,oFAAoF;IACpF,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,WAAW,CAEzE;IAED,8FAA8F;IAC9F,SAAS,CAAC,OAAO,IAAI,SAAS,CAc7B;IAED,SAAS,CAAC,SAAS,IAAI,IAAI,CAI1B;IAED,SAAS,CAAC,YAAY,IAAI,IAAI,CAAG;CAClC;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B;QAC5B,aAAa,EAAE,iBAAiB,CAAC;KAClC;CACF"}
@@ -0,0 +1,67 @@
1
+ import { ROOT_ATTRIBUTES, RootElement } from '../root-element.js';
2
+ import { DiffSession } from '../session.js';
3
+ import { elementSheet } from '../styles.js';
4
+ import { define } from './bound.js';
5
+ /**
6
+ * A root without visuals. It owns the session and provides it to the elements inside it
7
+ * (`<kgdiff-stage>`, `<kgdiff-change-list>`, …) or naming it with `for`, and owns what they share:
8
+ * the keyboard map, the live region announcing navigation, the events and the theme tokens. It has
9
+ * the attributes, properties, methods and events of `<kgdiff-viewer>` except the layout's
10
+ * (`panels`, `sidebar`, `header`, `chrome`, `legend`, `persist`): the page lays the elements out,
11
+ * and nothing is remembered.
12
+ *
13
+ * It renders as `display: contents`, so its children are laid out by the page as if it were not
14
+ * there.
15
+ *
16
+ * @tagname kgdiff-root
17
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
18
+ */
19
+ export class KgdiffRoot extends RootElement {
20
+ static get observedAttributes() {
21
+ return ROOT_ATTRIBUTES;
22
+ }
23
+ #built = false;
24
+ constructor() {
25
+ super();
26
+ this.root.attach({
27
+ update: (topics) => {
28
+ this.reflectSession(topics);
29
+ if (topics.has('locale') || topics.has('status')) {
30
+ this.root.live.setAttribute('lang', this.controller.locale);
31
+ }
32
+ },
33
+ });
34
+ }
35
+ sheets(doc) {
36
+ return [elementSheet(doc, 'root')];
37
+ }
38
+ /** A session without a canvas of its own: each `<kgdiff-stage>` brings its view. */
39
+ createSession(host, deps) {
40
+ return new DiffSession(host, deps);
41
+ }
42
+ /** No layout of its own: `\` does nothing, `?` and `/` go to the elements registered last. */
43
+ actions() {
44
+ return {
45
+ ...this.baseActions(),
46
+ toggleSidebar: () => undefined,
47
+ sidebarOpen: () => false,
48
+ toggleMenu: () => undefined,
49
+ // `?` opens the dialog of a `<kgdiff-actions>` bound to this root, if there is one.
50
+ openHelp: () => {
51
+ this.root.focus('help');
52
+ },
53
+ focusSearch: () => {
54
+ this.root.focus('search');
55
+ },
56
+ };
57
+ }
58
+ connected() {
59
+ if (this.#built)
60
+ return;
61
+ this.#built = true;
62
+ this.shadow.append(document.createElement('slot'), this.root.live);
63
+ }
64
+ disconnected() { }
65
+ }
66
+ define('kgdiff-root', KgdiffRoot);
67
+ //# sourceMappingURL=root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/elements/root.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAsC,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC,MAAM,KAAK,kBAAkB;QAC3B,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,GAAG,KAAK,CAAC;IAEf;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YACf,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;gBACjB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBAC5B,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACjD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAES,MAAM,CAAC,GAAa;QAC5B,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,oFAAoF;IAC1E,aAAa,CAAC,IAAiB,EAAE,IAAiB;QAC1D,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,8FAA8F;IACpF,OAAO;QACf,OAAO;YACL,GAAG,IAAI,CAAC,WAAW,EAAE;YACrB,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS;YAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;YACxB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;YAC3B,oFAAoF;YACpF,QAAQ,EAAE,GAAG,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;YACD,WAAW,EAAE,GAAG,EAAE;gBAChB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;IACJ,CAAC;IAES,SAAS;QACjB,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IAES,YAAY,KAAU,CAAC;CAClC;AAED,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `<kgdiff-search>` (RFC 0001 §3), documented on its class. Importing this module defines it.
3
+ */
4
+ import type { Region } from '../bind.js';
5
+ import type { KgdiffBoundElement } from '../index.js';
6
+ import type { UiContext } from '../ui/context.js';
7
+ import { BoundElement } from './bound.js';
8
+ /**
9
+ * Node search, a combobox and the results list it owns (its `aria-controls` and
10
+ * `aria-activedescendant` stay inside the element). The results open below the box while the query
11
+ * is not blank; ↑ / ↓ move through them, Enter chooses one (its node and change are selected, and
12
+ * focus moves to the change list), Esc clears. The query lives in the session, so a change list
13
+ * bound to the same root steps aside meanwhile. Registers itself as the root's `search` focus
14
+ * target: `/` focuses the one registered last that is shown.
15
+ *
16
+ * @tagname kgdiff-search
17
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
18
+ */
19
+ export declare class KgdiffSearch extends BoundElement implements KgdiffBoundElement {
20
+ protected readonly name = "search";
21
+ protected build(ui: UiContext): Region;
22
+ }
23
+ declare global {
24
+ interface HTMLElementTagNameMap {
25
+ /** @experimental In 0.6. */
26
+ 'kgdiff-search': KgdiffBoundElement;
27
+ }
28
+ }
29
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/elements/search.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAU,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;GAUG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,kBAAkB;IAC1E,SAAS,CAAC,QAAQ,CAAC,IAAI,YAAY;IAEnC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAIrC;CACF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B;QAC5B,eAAe,EAAE,kBAAkB,CAAC;KACrC;CACF"}
@@ -0,0 +1,23 @@
1
+ import { Search } from '../ui/search.js';
2
+ import { BoundElement, define } from './bound.js';
3
+ /**
4
+ * Node search, a combobox and the results list it owns (its `aria-controls` and
5
+ * `aria-activedescendant` stay inside the element). The results open below the box while the query
6
+ * is not blank; ↑ / ↓ move through them, Enter chooses one (its node and change are selected, and
7
+ * focus moves to the change list), Esc clears. The query lives in the session, so a change list
8
+ * bound to the same root steps aside meanwhile. Registers itself as the root's `search` focus
9
+ * target: `/` focuses the one registered last that is shown.
10
+ *
11
+ * @tagname kgdiff-search
12
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
13
+ */
14
+ export class KgdiffSearch extends BoundElement {
15
+ name = 'search';
16
+ build(ui) {
17
+ const search = new Search(ui);
18
+ this.shadow.append(search.box, search.results);
19
+ return search;
20
+ }
21
+ }
22
+ define('kgdiff-search', KgdiffSearch);
23
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/elements/search.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;IACzB,IAAI,GAAG,QAAQ,CAAC;IAEzB,KAAK,CAAC,EAAa;QAC3B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The view-level context a `<kgdiff-stage>` provides to its descendants (`kgdiff.stage/1`), in a
3
+ * module of its own: the chrome that acts on a view finds its stage through it without pulling
4
+ * the stage (and the renderer) into its subpath.
5
+ */
6
+ import type { ViewerContext } from '../bind.js';
7
+ import type { KgdiffStageElement, KgdiffViewerElement } from '../index.js';
8
+ import type { StageView } from '../view.js';
9
+ /**
10
+ * What a stage provides to its descendants (the view-level context).
11
+ *
12
+ * @experimental Like the stage, in 0.6.
13
+ */
14
+ export interface StageContext {
15
+ /** Keep `element` clear of fits and flights; returns the function that stops it. */
16
+ registerObstacle(element: Element): () => void;
17
+ }
18
+ /** @internal What the chrome that acts on a view (`<kgdiff-zoom>`, `<kgdiff-minimap>`) gets. */
19
+ export interface StageViewContext extends StageContext {
20
+ /** The stage element, or the viewer (its built-in stage). */
21
+ readonly stage: KgdiffStageElement | KgdiffViewerElement;
22
+ /** The root the stage is bound to now, or null while it waits for one. */
23
+ readonly root: ViewerContext | null;
24
+ /** The stage's view now, or null while the stage waits for its root. */
25
+ readonly view: StageView | null;
26
+ /** Call `listener` with the view now and whenever it changes; returns the stop. */
27
+ watchView(listener: (view: StageView | null) => void): () => void;
28
+ }
29
+ /** @experimental The stage context's key (`Symbol.for('kgdiff.stage/1')`). */
30
+ export declare const stageContext: import("../context.js").Context<StageContext>;
31
+ //# sourceMappingURL=stage-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-context.d.ts","sourceRoot":"","sources":["../../src/elements/stage-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,oFAAoF;IACpF,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,IAAI,CAAC;CAChD;AAED,gGAAgG;AAChG,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,CAAC;IACzD,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,mFAAmF;IACnF,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACnE;AAED,8EAA8E;AAC9E,eAAO,MAAM,YAAY,+CAAgD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { createContext } from '../context.js';
2
+ /** @experimental The stage context's key (`Symbol.for('kgdiff.stage/1')`). */
3
+ export const stageContext = createContext('kgdiff.stage/1');
4
+ //# sourceMappingURL=stage-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-context.js","sourceRoot":"","sources":["../../src/elements/stage-context.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA0B9C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAe,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * `<kgdiff-stage>` (RFC 0001 §3), documented on its class. Importing this module defines it.
3
+ */
4
+ import type { Region, ViewerContext } from '../bind.js';
5
+ import type { KgdiffStageElement, StagePanels, StageRegion, StageVersion } from '../index.js';
6
+ import type { UiContext } from '../ui/context.js';
7
+ import { StageView } from '../view.js';
8
+ import { BoundElement } from './bound.js';
9
+ export type { StageContext } from './stage-context.js';
10
+ export { stageContext } from './stage-context.js';
11
+ /**
12
+ * The regions of the built-in chrome a stage has.
13
+ *
14
+ * @experimental Like the stage, in 0.6.
15
+ */
16
+ export declare const STAGE_REGIONS: readonly StageRegion[];
17
+ /**
18
+ * The canvas of the root it is bound to: the graph, the hover tooltip, the swipe divider, the
19
+ * replay caption and the canvas chrome (view dock, replay transport, legend, zoom buttons and
20
+ * minimap). Each stage is a view of its own: a root draws every stage bound to it, each with its
21
+ * own camera, sharing the selection, the hover, the filters and the search; `version` pins one
22
+ * to a version.
23
+ *
24
+ * Five named slots take the page's content over the canvas. The stage positions it (12–16 px
25
+ * from the edges, stacked further from the corner than the chrome there), and every slotted
26
+ * element is an obstacle: fits and flights frame the graph in the free part of the canvas. A
27
+ * chrome element slotted in replaces the built-in region of its kind; `panels` keeps applying
28
+ * to the rest. Content positioned some other way registers itself with `registerObstacle`, on
29
+ * the element or on the stage context (`kgdiff.stage/1`) it provides to its descendants.
30
+ *
31
+ * @tagname kgdiff-stage
32
+ * @slot top-start - The page's content in the top left corner, below the version chip.
33
+ * @slot top-end - The page's content in the top right corner.
34
+ * @slot bottom-start - The page's content in the bottom left corner, above the legend.
35
+ * @slot bottom-center - The page's content above the view dock and the transport.
36
+ * @slot bottom-end - The page's content in the bottom right corner, above the zoom buttons and the minimap.
37
+ * @experimental In 0.6; stable from 0.7 (RFC 0001, decision 7).
38
+ */
39
+ export declare class KgdiffStage extends BoundElement implements KgdiffStageElement {
40
+ #private;
41
+ static get observedAttributes(): readonly string[];
42
+ protected readonly name = "stage";
43
+ get panels(): StagePanels;
44
+ set panels(value: StagePanels | string | null);
45
+ /**
46
+ * The version this stage draws whatever the mode, reflected to the `version` attribute:
47
+ * `before` or `after` (side by side with another stage of the same root), or null to follow
48
+ * the root's mode (overlay, swipe, replay).
49
+ */
50
+ get version(): StageVersion | null;
51
+ set version(value: StageVersion | null);
52
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
53
+ protected upgradedProperties(): readonly string[];
54
+ /** @internal This stage's view (its camera), for the dev harness and tests. */
55
+ get view(): StageView | null;
56
+ registerObstacle(element: Element): () => void;
57
+ protected build(ui: UiContext, ctx: ViewerContext, release: (fn: () => void) => void): Region;
58
+ }
59
+ declare global {
60
+ interface HTMLElementTagNameMap {
61
+ /** @experimental In 0.6. */
62
+ 'kgdiff-stage': KgdiffStageElement;
63
+ }
64
+ }
65
+ //# sourceMappingURL=stage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/elements/stage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EACV,kBAAkB,EAElB,WAAW,EACX,WAAW,EACX,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAU,MAAM,YAAY,CAAC;AAGlD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAM/C,CAAC;AA4BF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAY,SAAQ,YAAa,YAAW,kBAAkB;;IACzE,WAAoB,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAE1D;IAED,SAAS,CAAC,QAAQ,CAAC,IAAI,WAAW;IAYlC,IAAI,MAAM,IAAI,WAAW,CAExB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,EAW5C;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,YAAY,GAAG,IAAI,CAEjC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAUrC;IAEQ,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAK9F;IAED,UAAmB,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEzD;IAED,+EAA+E;IAC/E,IAAI,IAAI,IAAI,SAAS,GAAG,IAAI,CAE3B;IA0BD,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,IAAI,CAQ7C;IAED,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,GAAG,MAAM,CAsF5F;CACF;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B;QAC5B,cAAc,EAAE,kBAAkB,CAAC;KACpC;CACF"}