@noldova/git.window 0.0.0-stage → 0.0.2

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 (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -2
  3. package/THIRD-PARTY-NOTICES.md +27 -0
  4. package/package.json +67 -4
  5. package/src/api/index.d.ts +175 -0
  6. package/src/api/index.js +13 -0
  7. package/src/api/index.js.map +1 -0
  8. package/src/app/components/git-branch-card/git-branch-card.component.js +129 -0
  9. package/src/app/components/git-branch-card/git-branch-card.component.js.map +1 -0
  10. package/src/app/components/git-commit-card/git-commit-card.component.js +43 -0
  11. package/src/app/components/git-commit-card/git-commit-card.component.js.map +1 -0
  12. package/src/app/components/git-file-group/git-file-group.component.js +107 -0
  13. package/src/app/components/git-file-group/git-file-group.component.js.map +1 -0
  14. package/src/app/components/git-host-row/git-host-row.component.js +62 -0
  15. package/src/app/components/git-host-row/git-host-row.component.js.map +1 -0
  16. package/src/app/components/git-view/git-view.component.js +72 -0
  17. package/src/app/components/git-view/git-view.component.js.map +1 -0
  18. package/src/app/enums/git-branch-menu-kind.js +14 -0
  19. package/src/app/enums/git-branch-menu-kind.js.map +1 -0
  20. package/src/app/enums/git-diff-row-kind.js +15 -0
  21. package/src/app/enums/git-diff-row-kind.js.map +1 -0
  22. package/src/app/enums/git-file-group-kind.js +14 -0
  23. package/src/app/enums/git-file-group-kind.js.map +1 -0
  24. package/src/app/enums/git-file-tone.js +16 -0
  25. package/src/app/enums/git-file-tone.js.map +1 -0
  26. package/src/app/enums/git-view-phase.js +20 -0
  27. package/src/app/enums/git-view-phase.js.map +1 -0
  28. package/src/app/exceptions/git-folder-provided.exception.js +16 -0
  29. package/src/app/exceptions/git-folder-provided.exception.js.map +1 -0
  30. package/src/app/exceptions/git-window.exception.js +15 -0
  31. package/src/app/exceptions/git-window.exception.js.map +1 -0
  32. package/src/app/exceptions/status-missing.exception.js +16 -0
  33. package/src/app/exceptions/status-missing.exception.js.map +1 -0
  34. package/src/app/interfaces/i-git-folder-provider.js +8 -0
  35. package/src/app/interfaces/i-git-folder-provider.js.map +1 -0
  36. package/src/app/interfaces/i-git-host-row.js +8 -0
  37. package/src/app/interfaces/i-git-host-row.js.map +1 -0
  38. package/src/app/interfaces/i-provided-git-host-row.js +8 -0
  39. package/src/app/interfaces/i-provided-git-host-row.js.map +1 -0
  40. package/src/app/models/git-branch-menu-item.js +42 -0
  41. package/src/app/models/git-branch-menu-item.js.map +1 -0
  42. package/src/app/models/git-diff-row.js +45 -0
  43. package/src/app/models/git-diff-row.js.map +1 -0
  44. package/src/app/models/git-empty-state.js +18 -0
  45. package/src/app/models/git-empty-state.js.map +1 -0
  46. package/src/app/models/git-file-group.js +35 -0
  47. package/src/app/models/git-file-group.js.map +1 -0
  48. package/src/app/models/git-file-row.js +67 -0
  49. package/src/app/models/git-file-row.js.map +1 -0
  50. package/src/app/models/git-folder-read.js +16 -0
  51. package/src/app/models/git-folder-read.js.map +1 -0
  52. package/src/app/services/git-folder.js +60 -0
  53. package/src/app/services/git-folder.js.map +1 -0
  54. package/src/app/services/git-host-rows.js +30 -0
  55. package/src/app/services/git-host-rows.js.map +1 -0
  56. package/src/app/services/git-runtime-client.js +90 -0
  57. package/src/app/services/git-runtime-client.js.map +1 -0
  58. package/src/app/services/git-view-state.service.js +285 -0
  59. package/src/app/services/git-view-state.service.js.map +1 -0
  60. package/src/app/services/git-window-part.js +30 -0
  61. package/src/app/services/git-window-part.js.map +1 -0
  62. package/src/resources.js +208 -0
  63. package/src/resources.js.map +1 -0
@@ -0,0 +1,107 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { NgTemplateOutlet } from "@angular/common";
9
+ import { Component, computed, effect, ErrorHandler, inject, input, signal, untracked } from "@angular/core";
10
+ import { FileBadgeComponent, IconButtonComponent, TooltipDirective } from "@noldova/ui.components.angular";
11
+ import { GitDiffRowKind } from "../../enums/git-diff-row-kind.js";
12
+ import { GitFileGroupKind } from "../../enums/git-file-group-kind.js";
13
+ import { GitFileTone } from "../../enums/git-file-tone.js";
14
+ import { GitDiffRow } from "../../models/git-diff-row.js";
15
+ import { Resources } from "../../../resources.js";
16
+ import { GitRuntimeClient } from "../../services/git-runtime-client.js";
17
+ import { GitViewStateService } from "../../services/git-view-state.service.js";
18
+ import * as i0 from "@angular/core";
19
+ export class GitFileGroupComponent {
20
+ requests = new Map();
21
+ errors = inject(ErrorHandler);
22
+ resources = Resources;
23
+ kinds = GitFileGroupKind;
24
+ lineKinds = GitDiffRowKind;
25
+ tones = GitFileTone;
26
+ state = inject(GitViewStateService);
27
+ open = signal(new Set(), /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
29
+ wrapped = signal(new Set(), /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "wrapped" }] : /* istanbul ignore next */ []));
31
+ diffs = signal(new Map(), /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "diffs" }] : /* istanbul ignore next */ []));
33
+ showsAll = signal(false, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "showsAll" }] : /* istanbul ignore next */ []));
35
+ shownRows = computed(() => {
36
+ const rows = this.group().rows;
37
+ return this.showsAll() || rows.length <= Resources.shownFilesMaximum ? rows : rows.slice(0, Resources.shownFilesMaximum - 1);
38
+ }, /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "shownRows" }] : /* istanbul ignore next */ []));
40
+ hiddenCount = computed(() => this.group().rows.length - this.shownRows().length, /* @ts-ignore */
41
+ ...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
42
+ group = input.required(/* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
44
+ constructor() {
45
+ effect(() => {
46
+ this.state.status();
47
+ const rows = this.group().rows;
48
+ untracked(() => {
49
+ for (const row of rows)
50
+ if (this.open().has(row.key))
51
+ this.load(row);
52
+ });
53
+ });
54
+ }
55
+ toggle(row) {
56
+ this.open.update(t => GitFileGroupComponent.toggled(t, row.key));
57
+ if (this.open().has(row.key))
58
+ this.load(row);
59
+ }
60
+ toggleWrap(row) {
61
+ this.wrapped.update(t => GitFileGroupComponent.toggled(t, row.key));
62
+ }
63
+ rowsOf(row) {
64
+ return this.diffs().get(row.key) ?? [new GitDiffRow(GitDiffRowKind.Meta, Resources.loadingDiff)];
65
+ }
66
+ moveAll() {
67
+ const paths = this.group().rows.map(t => t.path);
68
+ void (this.group().kind === GitFileGroupKind.Staged ? this.state.unstageAsync(paths) : this.state.stageAsync(paths));
69
+ }
70
+ move(row) {
71
+ void (row.group === GitFileGroupKind.Staged ? this.state.unstageAsync([row.path]) : this.state.stageAsync([row.path]));
72
+ }
73
+ load(row) {
74
+ this.loadAsync(row).catch((error) => this.errors.handleError(error));
75
+ }
76
+ async loadAsync(row) {
77
+ const request = (this.requests.get(row.key) ?? 0) + 1;
78
+ this.requests.set(row.key, request);
79
+ let rows;
80
+ try {
81
+ const diff = await this.state.diffAsync(row.scope);
82
+ const file = diff.files.find(t => t.path === row.path);
83
+ rows = GitDiffRow.rowsOf(file ?? null);
84
+ }
85
+ catch (error) {
86
+ if (!GitRuntimeClient.isFailure(error))
87
+ throw error;
88
+ rows = [new GitDiffRow(GitDiffRowKind.Meta, GitViewStateService.messageOf(error))];
89
+ }
90
+ if (this.requests.get(row.key) !== request)
91
+ return;
92
+ this.diffs.update(t => new Map([...t, [row.key, rows]]));
93
+ }
94
+ static toggled(current, key) {
95
+ const next = new Set(current);
96
+ if (!next.delete(key))
97
+ next.add(key);
98
+ return next;
99
+ }
100
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitFileGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
101
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.6", type: GitFileGroupComponent, isStandalone: true, selector: "nol-git-file-group", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!--\n@license\nCopyright (c) Noldova.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n-->\n\n<h3 class=\"header\">\n <span class=\"title\">{{ resources.groupTitles[group().kind] }}</span>\n <span class=\"count\">{{ group().rows.length }}</span>\n <span class=\"spacer\"></span>\n @if (group().kind !== kinds.Conflicts) {\n @let label = group().kind === kinds.Staged ? resources.unstageAllLabel : resources.stageAllLabel;\n <button nol-icon-button type=\"button\" class=\"move-all\" [icon]=\"group().kind === kinds.Staged ? resources.unstageIcon : resources.stageIcon\" [label]=\"label\"\n [nolTooltip]=\"label\" [disabled]=\"state.busy()\" (click)=\"moveAll()\"></button>\n }\n</h3>\n<ul class=\"files\">\n @for (row of shownRows(); track row.key) {\n @let isOpen = open().has(row.key);\n @let moveLabel = row.group === kinds.Staged ? resources.formatUnstage(row.path) : resources.formatStage(row.path);\n <li>\n <div class=\"file\" [class.open]=\"isOpen\">\n @if (row.group === kinds.Conflicts) {\n <div class=\"name\" [nolTooltip]=\"row.path\">\n <ng-container [ngTemplateOutlet]=\"nameOf\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </div>\n } @else {\n <button type=\"button\" class=\"name\" [nolTooltip]=\"row.path\" [attr.aria-expanded]=\"isOpen\" (click)=\"toggle(row)\">\n <ng-container [ngTemplateOutlet]=\"nameOf\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </button>\n }\n @if (isOpen) {\n @let wrapLabel = wrapped().has(row.key) ? resources.unwrapLinesLabel : resources.wrapLinesLabel;\n <button nol-icon-button type=\"button\" class=\"wrap\" [icon]=\"resources.wrapIcon\" [pressed]=\"wrapped().has(row.key)\" [label]=\"wrapLabel\" [nolTooltip]=\"wrapLabel\"\n (click)=\"toggleWrap(row)\"></button>\n }\n @if (row.group !== kinds.Conflicts) {\n @let diffLabel = isOpen ? resources.hideDiffLabel : resources.showDiffLabel;\n <button nol-icon-button type=\"button\" class=\"expand\" [icon]=\"isOpen ? resources.collapseIcon : resources.expandIcon\" [label]=\"diffLabel\" [nolTooltip]=\"diffLabel\"\n [attr.aria-expanded]=\"isOpen\" (click)=\"toggle(row)\"></button>\n }\n <button nol-icon-button type=\"button\" class=\"move\" [icon]=\"row.group === kinds.Staged ? resources.unstageIcon : resources.stageIcon\" [label]=\"moveLabel\"\n [nolTooltip]=\"moveLabel\" [disabled]=\"state.busy()\" (click)=\"move(row)\"></button>\n </div>\n @if (isOpen) {\n <div class=\"diff\" [class.wrapped]=\"wrapped().has(row.key)\">\n @for (line of rowsOf(row); track $index) {\n <div [class.added-line]=\"line.kind === lineKinds.Added\" [class.removed-line]=\"line.kind === lineKinds.Removed\" [class.meta-line]=\"line.kind === lineKinds.Meta\">{{ line.text }}</div>\n }\n </div>\n }\n </li>\n }\n @if (hiddenCount() > 0) {\n <li>\n <button type=\"button\" class=\"more\" (click)=\"showsAll.set(true)\">{{ resources.formatMoreFiles(hiddenCount()) }}</button>\n </li>\n }\n</ul>\n\n<ng-template #nameOf let-row>\n <span class=\"state\" [attr.data-tone]=\"row.tone\">{{ row.letter }}</span>\n <nol-file-badge [fileName]=\"row.fileName\" />\n <span class=\"path\"><span class=\"directory\">{{ row.directory }}</span>{{ row.fileName }}</span>\n @if (row.kind; as kind) {\n <span class=\"kind\">{{ kind }}</span>\n } @else if (row.counts; as counts) {\n <span class=\"counts\"><span class=\"added\">{{ resources.addedPrefix }}{{ counts.added }}</span>@if (row.tone !== tones.Untracked) {<span class=\"removed\">{{ resources.removedPrefix }}{{ counts.removed }}</span>}</span>\n }\n</ng-template>\n", styles: ["/**\n * @license\n * Copyright (c) Noldova.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n --nol-git-more-indent: 2.25rem;\n --nol-git-count-gap: 0.25em;\n --nol-git-diff-height: 24rem;\n --nol-git-diff-padding: 0.375rem;\n\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-width: 0;\n overflow: hidden;\n border: var(--nol-border-width) solid var(--nol-card-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-raised);\n}\n\n.header {\n display: flex;\n gap: var(--nol-tab-part-gap);\n align-items: center;\n height: var(--nol-section-header-height);\n margin: 0;\n padding: 0 var(--nol-space-1) 0 var(--nol-space-2);\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n font-weight: var(--nol-weight-emphasis);\n letter-spacing: var(--nol-letter-spacing-caps);\n line-height: inherit;\n text-transform: uppercase;\n}\n\n.count {\n font-weight: normal;\n letter-spacing: 0;\n}\n\n.spacer {\n flex: 1;\n}\n\n.files {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.files > li + li {\n border-top: var(--nol-border-width) solid var(--nol-card-border);\n}\n\n.file {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n min-height: var(--nol-section-header-height);\n padding: 0 var(--nol-space-1) 0 0;\n}\n\n.file.open,\n.file:hover {\n background-color: var(--nol-hover);\n\n @media (forced-colors: active) {\n outline: var(--nol-border-width) dashed Highlight;\n outline-offset: calc(var(--nol-border-width) * -1);\n }\n}\n\n.name {\n display: flex;\n flex: 1;\n gap: var(--nol-space-2);\n align-items: center;\n align-self: stretch;\n min-width: 0;\n padding: 0 0 0 var(--nol-git-card-padding);\n border: 0;\n background: none;\n color: var(--nol-text);\n font: inherit;\n text-align: start;\n}\n\n.more {\n display: block;\n width: 100%;\n min-height: var(--nol-section-header-height);\n padding: 0 0 0 var(--nol-git-more-indent);\n border: 0;\n background: none;\n color: var(--nol-text-muted);\n font: inherit;\n text-align: start;\n}\n\n.more:hover {\n background-color: var(--nol-hover);\n\n @media (forced-colors: active) {\n &:not(:focus-visible) {\n outline: var(--nol-border-width) dashed Highlight;\n outline-offset: calc(var(--nol-border-width) * -1);\n }\n }\n}\n\n.state {\n flex: none;\n width: var(--nol-icon);\n font-size: var(--nol-text-label);\n font-weight: var(--nol-weight-strong);\n text-align: center;\n}\n\n.state[data-tone=\"Modified\"] {\n color: var(--nol-warning);\n}\n\n.state[data-tone=\"Added\"],\n.state[data-tone=\"Untracked\"],\n.added {\n color: var(--nol-added);\n}\n\n.state[data-tone=\"Removed\"],\n.removed {\n color: var(--nol-removed);\n}\n\n.state[data-tone=\"Conflict\"] {\n color: var(--nol-status-failed);\n}\n\n.path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.directory,\n.kind {\n color: var(--nol-text-muted);\n}\n\n.counts,\n.kind {\n flex: none;\n font-size: var(--nol-text-label);\n font-variant-numeric: tabular-nums;\n}\n\n.removed {\n margin-inline-start: var(--nol-git-count-gap);\n}\n\n.diff {\n display: grid;\n grid-template-columns: minmax(max-content, 1fr);\n max-height: var(--nol-git-diff-height);\n overflow: auto;\n padding: var(--nol-git-diff-padding) 0;\n border-top: var(--nol-border-width) solid var(--nol-card-border);\n background-color: var(--nol-code);\n font-family: var(--nol-font-mono);\n font-size: var(--nol-text-code);\n line-height: var(--nol-line-code);\n white-space: pre;\n}\n\n.diff.wrapped {\n grid-template-columns: minmax(0, 1fr);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.diff > div {\n padding-inline: var(--nol-space-3);\n}\n\n.added-line {\n background-color: var(--nol-added-background);\n}\n\n.removed-line {\n background-color: var(--nol-removed-background);\n}\n\n.meta-line {\n color: var(--nol-text-muted);\n}\n"], dependencies: [{ kind: "component", type: FileBadgeComponent, selector: "nol-file-badge", inputs: ["fileName", "isFolder"] }, { kind: "component", type: IconButtonComponent, selector: "button[nol-icon-button]", inputs: ["icon", "label", "pressed", "filled", "overlay", "backdrop", "buttonHeight", "danger", "tabAction", "busy", "busyPressable"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TooltipDirective, selector: "[nolTooltip]", inputs: ["nolTooltip", "nolTooltipDescription", "nolTooltipSide", "nolTooltipDisabled", "nolTooltipTruncated", "nolTooltipBeside"] }] });
102
+ }
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitFileGroupComponent, decorators: [{
104
+ type: Component,
105
+ args: [{ selector: "nol-git-file-group", imports: [FileBadgeComponent, IconButtonComponent, NgTemplateOutlet, TooltipDirective], template: "<!--\n@license\nCopyright (c) Noldova.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n-->\n\n<h3 class=\"header\">\n <span class=\"title\">{{ resources.groupTitles[group().kind] }}</span>\n <span class=\"count\">{{ group().rows.length }}</span>\n <span class=\"spacer\"></span>\n @if (group().kind !== kinds.Conflicts) {\n @let label = group().kind === kinds.Staged ? resources.unstageAllLabel : resources.stageAllLabel;\n <button nol-icon-button type=\"button\" class=\"move-all\" [icon]=\"group().kind === kinds.Staged ? resources.unstageIcon : resources.stageIcon\" [label]=\"label\"\n [nolTooltip]=\"label\" [disabled]=\"state.busy()\" (click)=\"moveAll()\"></button>\n }\n</h3>\n<ul class=\"files\">\n @for (row of shownRows(); track row.key) {\n @let isOpen = open().has(row.key);\n @let moveLabel = row.group === kinds.Staged ? resources.formatUnstage(row.path) : resources.formatStage(row.path);\n <li>\n <div class=\"file\" [class.open]=\"isOpen\">\n @if (row.group === kinds.Conflicts) {\n <div class=\"name\" [nolTooltip]=\"row.path\">\n <ng-container [ngTemplateOutlet]=\"nameOf\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </div>\n } @else {\n <button type=\"button\" class=\"name\" [nolTooltip]=\"row.path\" [attr.aria-expanded]=\"isOpen\" (click)=\"toggle(row)\">\n <ng-container [ngTemplateOutlet]=\"nameOf\" [ngTemplateOutletContext]=\"{ $implicit: row }\" />\n </button>\n }\n @if (isOpen) {\n @let wrapLabel = wrapped().has(row.key) ? resources.unwrapLinesLabel : resources.wrapLinesLabel;\n <button nol-icon-button type=\"button\" class=\"wrap\" [icon]=\"resources.wrapIcon\" [pressed]=\"wrapped().has(row.key)\" [label]=\"wrapLabel\" [nolTooltip]=\"wrapLabel\"\n (click)=\"toggleWrap(row)\"></button>\n }\n @if (row.group !== kinds.Conflicts) {\n @let diffLabel = isOpen ? resources.hideDiffLabel : resources.showDiffLabel;\n <button nol-icon-button type=\"button\" class=\"expand\" [icon]=\"isOpen ? resources.collapseIcon : resources.expandIcon\" [label]=\"diffLabel\" [nolTooltip]=\"diffLabel\"\n [attr.aria-expanded]=\"isOpen\" (click)=\"toggle(row)\"></button>\n }\n <button nol-icon-button type=\"button\" class=\"move\" [icon]=\"row.group === kinds.Staged ? resources.unstageIcon : resources.stageIcon\" [label]=\"moveLabel\"\n [nolTooltip]=\"moveLabel\" [disabled]=\"state.busy()\" (click)=\"move(row)\"></button>\n </div>\n @if (isOpen) {\n <div class=\"diff\" [class.wrapped]=\"wrapped().has(row.key)\">\n @for (line of rowsOf(row); track $index) {\n <div [class.added-line]=\"line.kind === lineKinds.Added\" [class.removed-line]=\"line.kind === lineKinds.Removed\" [class.meta-line]=\"line.kind === lineKinds.Meta\">{{ line.text }}</div>\n }\n </div>\n }\n </li>\n }\n @if (hiddenCount() > 0) {\n <li>\n <button type=\"button\" class=\"more\" (click)=\"showsAll.set(true)\">{{ resources.formatMoreFiles(hiddenCount()) }}</button>\n </li>\n }\n</ul>\n\n<ng-template #nameOf let-row>\n <span class=\"state\" [attr.data-tone]=\"row.tone\">{{ row.letter }}</span>\n <nol-file-badge [fileName]=\"row.fileName\" />\n <span class=\"path\"><span class=\"directory\">{{ row.directory }}</span>{{ row.fileName }}</span>\n @if (row.kind; as kind) {\n <span class=\"kind\">{{ kind }}</span>\n } @else if (row.counts; as counts) {\n <span class=\"counts\"><span class=\"added\">{{ resources.addedPrefix }}{{ counts.added }}</span>@if (row.tone !== tones.Untracked) {<span class=\"removed\">{{ resources.removedPrefix }}{{ counts.removed }}</span>}</span>\n }\n</ng-template>\n", styles: ["/**\n * @license\n * Copyright (c) Noldova.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n --nol-git-more-indent: 2.25rem;\n --nol-git-count-gap: 0.25em;\n --nol-git-diff-height: 24rem;\n --nol-git-diff-padding: 0.375rem;\n\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-width: 0;\n overflow: hidden;\n border: var(--nol-border-width) solid var(--nol-card-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-raised);\n}\n\n.header {\n display: flex;\n gap: var(--nol-tab-part-gap);\n align-items: center;\n height: var(--nol-section-header-height);\n margin: 0;\n padding: 0 var(--nol-space-1) 0 var(--nol-space-2);\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n font-weight: var(--nol-weight-emphasis);\n letter-spacing: var(--nol-letter-spacing-caps);\n line-height: inherit;\n text-transform: uppercase;\n}\n\n.count {\n font-weight: normal;\n letter-spacing: 0;\n}\n\n.spacer {\n flex: 1;\n}\n\n.files {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.files > li + li {\n border-top: var(--nol-border-width) solid var(--nol-card-border);\n}\n\n.file {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n min-height: var(--nol-section-header-height);\n padding: 0 var(--nol-space-1) 0 0;\n}\n\n.file.open,\n.file:hover {\n background-color: var(--nol-hover);\n\n @media (forced-colors: active) {\n outline: var(--nol-border-width) dashed Highlight;\n outline-offset: calc(var(--nol-border-width) * -1);\n }\n}\n\n.name {\n display: flex;\n flex: 1;\n gap: var(--nol-space-2);\n align-items: center;\n align-self: stretch;\n min-width: 0;\n padding: 0 0 0 var(--nol-git-card-padding);\n border: 0;\n background: none;\n color: var(--nol-text);\n font: inherit;\n text-align: start;\n}\n\n.more {\n display: block;\n width: 100%;\n min-height: var(--nol-section-header-height);\n padding: 0 0 0 var(--nol-git-more-indent);\n border: 0;\n background: none;\n color: var(--nol-text-muted);\n font: inherit;\n text-align: start;\n}\n\n.more:hover {\n background-color: var(--nol-hover);\n\n @media (forced-colors: active) {\n &:not(:focus-visible) {\n outline: var(--nol-border-width) dashed Highlight;\n outline-offset: calc(var(--nol-border-width) * -1);\n }\n }\n}\n\n.state {\n flex: none;\n width: var(--nol-icon);\n font-size: var(--nol-text-label);\n font-weight: var(--nol-weight-strong);\n text-align: center;\n}\n\n.state[data-tone=\"Modified\"] {\n color: var(--nol-warning);\n}\n\n.state[data-tone=\"Added\"],\n.state[data-tone=\"Untracked\"],\n.added {\n color: var(--nol-added);\n}\n\n.state[data-tone=\"Removed\"],\n.removed {\n color: var(--nol-removed);\n}\n\n.state[data-tone=\"Conflict\"] {\n color: var(--nol-status-failed);\n}\n\n.path {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.directory,\n.kind {\n color: var(--nol-text-muted);\n}\n\n.counts,\n.kind {\n flex: none;\n font-size: var(--nol-text-label);\n font-variant-numeric: tabular-nums;\n}\n\n.removed {\n margin-inline-start: var(--nol-git-count-gap);\n}\n\n.diff {\n display: grid;\n grid-template-columns: minmax(max-content, 1fr);\n max-height: var(--nol-git-diff-height);\n overflow: auto;\n padding: var(--nol-git-diff-padding) 0;\n border-top: var(--nol-border-width) solid var(--nol-card-border);\n background-color: var(--nol-code);\n font-family: var(--nol-font-mono);\n font-size: var(--nol-text-code);\n line-height: var(--nol-line-code);\n white-space: pre;\n}\n\n.diff.wrapped {\n grid-template-columns: minmax(0, 1fr);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.diff > div {\n padding-inline: var(--nol-space-3);\n}\n\n.added-line {\n background-color: var(--nol-added-background);\n}\n\n.removed-line {\n background-color: var(--nol-removed-background);\n}\n\n.meta-line {\n color: var(--nol-text-muted);\n}\n"] }]
106
+ }], ctorParameters: () => [], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: true }] }] } });
107
+ //# sourceMappingURL=git-file-group.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-file-group.component.js","sourceRoot":"","sources":["../../../../../../../../src/noldova.git.window/src/app/components/git-file-group/git-file-group.component.ts","../../../../../../../../src/noldova.git.window/src/app/components/git-file-group/git-file-group.component.html"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAiC,MAAM,EAAE,SAAS,EAAuB,MAAM,eAAe,CAAC;AAEhK,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAE3G,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;;AAQ/E,MAAM,OAAO,qBAAqB;IACf,QAAQ,GAAwB,IAAI,GAAG,EAAE,CAAC;IAC1C,MAAM,GAAiB,MAAM,CAAC,YAAY,CAAC,CAAC;IAE1C,SAAS,GAAqB,SAAS,CAAC;IACxC,KAAK,GAA4B,gBAAgB,CAAC;IAClD,SAAS,GAA0B,cAAc,CAAC;IAClD,KAAK,GAAuB,WAAW,CAAC;IACxC,KAAK,GAAwB,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACzD,IAAI,GAAwC,MAAM,CAAC,IAA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AM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAEO,MAAM,CAAC,OAAO,CAAC,OAA4B,EAAE,GAAW;QAC9D,MAAM,IAAI,GAAgB,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;uGApFU,qBAAqB;2FAArB,qBAAqB,iNC7BlC,yyHAwEA,sjID/CY,kBAAkB,6FAAE,mBAAmB,2MAAE,gBAAgB,oJAAE,gBAAgB;;2FAI1E,qBAAqB;kBANjC,SAAS;+BACE,oBAAoB,WACrB,CAAC,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { NgComponentOutlet } from "@angular/common";
9
+ import { Component, computed, inject, Injector, input } from "@angular/core";
10
+ import { WindowPartTokens } from "@noldova/desktop.window";
11
+ import { RemoteTransport } from "@noldova/git.protocol";
12
+ import { Resources } from "../../../resources.js";
13
+ import { GitHostRows } from "../../services/git-host-rows.js";
14
+ import * as i0 from "@angular/core";
15
+ export class GitHostRowComponent {
16
+ injector = inject(Injector);
17
+ provided = computed(() => GitHostRows.rowFor(this.remote()), /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "provided" }] : /* istanbul ignore next */ []));
19
+ resources = Resources;
20
+ row = computed(() => {
21
+ const provided = this.provided();
22
+ return provided === null ? null : {
23
+ component: provided.row.component,
24
+ injector: Injector.create({ providers: [{ provide: WindowPartTokens.context, useValue: provided.context }], parent: this.injector })
25
+ };
26
+ }, /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
28
+ inputs = computed(() => ({
29
+ folder: this.folder(), branch: this.status().branch, head: this.status().head, remote: this.remote()
30
+ }), /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "inputs" }] : /* istanbul ignore next */ []));
32
+ plainLine = computed(() => {
33
+ const remote = this.remote();
34
+ return Resources.formatPlainRemote(remote.name, remote.host ?? remote.path ?? remote.name, GitHostRowComponent.transportOf(remote.transport));
35
+ }, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "plainLine" }] : /* istanbul ignore next */ []));
37
+ remote = input.required(/* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "remote" }] : /* istanbul ignore next */ []));
39
+ status = input.required(/* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
41
+ folder = input.required(/* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "folder" }] : /* istanbul ignore next */ []));
43
+ static transportOf(transport) {
44
+ switch (transport) {
45
+ case RemoteTransport.Ssh:
46
+ return Resources.ssh;
47
+ case RemoteTransport.Https:
48
+ return Resources.https;
49
+ case RemoteTransport.File:
50
+ return Resources.filePath;
51
+ default:
52
+ return Resources.otherTransport;
53
+ }
54
+ }
55
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitHostRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
56
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.6", type: GitHostRowComponent, isStandalone: true, selector: "nol-git-host-row", inputs: { remote: { classPropertyName: "remote", publicName: "remote", isSignal: true, isRequired: true, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null }, folder: { classPropertyName: "folder", publicName: "folder", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<!--\n@license\nCopyright (c) Noldova.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n-->\n\n@if (row(); as row) {\n <ng-container *ngComponentOutlet=\"row.component; inputs: inputs(); injector: row.injector\" />\n} @else {\n <div class=\"plain\">\n <span class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.plainRemoteIcon }}</span>\n <span class=\"plain-text\">{{ plainLine() }}</span>\n </div>\n}\n", styles: ["/**\n * @license\n * Copyright (c) Noldova.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n display: block;\n min-width: 0;\n}\n\n.plain {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n padding: var(--nol-space-2) var(--nol-git-card-padding);\n border: var(--nol-border-width) solid var(--nol-card-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-raised);\n color: var(--nol-text-muted);\n}\n\n.plain-text {\n flex: 1;\n min-width: 0;\n font-size: var(--nol-text-label);\n overflow-wrap: anywhere;\n}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
57
+ }
58
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitHostRowComponent, decorators: [{
59
+ type: Component,
60
+ args: [{ selector: "nol-git-host-row", imports: [NgComponentOutlet], template: "<!--\n@license\nCopyright (c) Noldova.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n-->\n\n@if (row(); as row) {\n <ng-container *ngComponentOutlet=\"row.component; inputs: inputs(); injector: row.injector\" />\n} @else {\n <div class=\"plain\">\n <span class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.plainRemoteIcon }}</span>\n <span class=\"plain-text\">{{ plainLine() }}</span>\n </div>\n}\n", styles: ["/**\n * @license\n * Copyright (c) Noldova.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n display: block;\n min-width: 0;\n}\n\n.plain {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n padding: var(--nol-space-2) var(--nol-git-card-padding);\n border: var(--nol-border-width) solid var(--nol-card-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-raised);\n color: var(--nol-text-muted);\n}\n\n.plain-text {\n flex: 1;\n min-width: 0;\n font-size: var(--nol-text-label);\n overflow-wrap: anywhere;\n}\n"] }]
61
+ }], propDecorators: { remote: [{ type: i0.Input, args: [{ isSignal: true, alias: "remote", required: true }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: true }] }], folder: [{ type: i0.Input, args: [{ isSignal: true, alias: "folder", required: true }] }] } });
62
+ //# sourceMappingURL=git-host-row.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-host-row.component.js","sourceRoot":"","sources":["../../../../../../../../src/noldova.git.window/src/app/components/git-host-row/git-host-row.component.ts","../../../../../../../../src/noldova.git.window/src/app/components/git-host-row/git-host-row.component.html"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAA4C,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAkC,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;;AAQ9D,MAAM,OAAO,mBAAmB;IACb,QAAQ,GAAa,MAAM,CAAC,QAAQ,CA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Ea,MAAM,GAA2B,KAAK,CAAC,QAAQ;+EAAa,CAAC;IAC7D,MAAM,GAA2B,KAAK,CAAC,QAAQ;+EAAa,CAAC;IAC7D,MAAM,GAAwB,KAAK,CAAC,QAAQ;+EAAU,CAAC;IAE/D,MAAM,CAAC,WAAW,CAAC,SAA0B;QACnD,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,eAAe,CAAC,GAAG;gBACtB,OAAO,SAAS,CAAC,GAAG,CAAC;YACvB,KAAK,eAAe,CAAC,KAAK;gBACxB,OAAO,SAAS,CAAC,KAAK,CAAC;YACzB,KAAK,eAAe,CAAC,IAAI;gBACvB,OAAO,SAAS,CAAC,QAAQ,CAAC;YAC5B;gBACE,OAAO,SAAS,CAAC,cAAc,CAAC;QACpC,CAAC;IACH,CAAC;uGAnCU,mBAAmB;2FAAnB,mBAAmB,scCvBhC,ufAgBA,utBDGY,iBAAiB;;2FAIhB,mBAAmB;kBAN/B,SAAS;+BACE,kBAAkB,WACnB,CAAC,iBAAiB,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Component, computed, inject } from "@angular/core";
9
+ import { WindowPartTokens } from "@noldova/desktop.window";
10
+ import { ButtonComponent, ButtonVariant } from "@noldova/ui.components.angular";
11
+ import { GitViewPhase } from "../../enums/git-view-phase.js";
12
+ import { GitEmptyState } from "../../models/git-empty-state.js";
13
+ import { Resources } from "../../../resources.js";
14
+ import { GitViewStateService } from "../../services/git-view-state.service.js";
15
+ import { GitBranchCardComponent } from "../git-branch-card/git-branch-card.component.js";
16
+ import { GitCommitCardComponent } from "../git-commit-card/git-commit-card.component.js";
17
+ import { GitFileGroupComponent } from "../git-file-group/git-file-group.component.js";
18
+ import { GitHostRowComponent } from "../git-host-row/git-host-row.component.js";
19
+ import * as i0 from "@angular/core";
20
+ export class GitViewComponent {
21
+ context = inject(WindowPartTokens.context);
22
+ resources = Resources;
23
+ phases = GitViewPhase;
24
+ secondary = ButtonVariant.Secondary;
25
+ state = inject(GitViewStateService);
26
+ empty = computed(() => this.emptyOf(this.state.phase()), /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
28
+ offersGit = computed(() => this.state.phase() === GitViewPhase.GitMissing || this.state.phase() === GitViewPhase.GitTooOld, /* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "offersGit" }] : /* istanbul ignore next */ []));
30
+ getGit() {
31
+ void this.context.openLinkAsync(Resources.getGitAddress);
32
+ }
33
+ checkAgain() {
34
+ void this.state.refreshAsync();
35
+ }
36
+ followAgain() {
37
+ void this.state.followAgainAsync();
38
+ }
39
+ dismissFailure() {
40
+ this.state.failure.set(null);
41
+ }
42
+ operationOf(operation) {
43
+ return operation === null ? null : Resources.formatOperation(Resources.operations[operation.kind], operation.from);
44
+ }
45
+ emptyOf(phase) {
46
+ switch (phase) {
47
+ case GitViewPhase.NoFolder:
48
+ return new GitEmptyState(Resources.noFolderIcon, Resources.noFolderHeading, Resources.noFolderText);
49
+ case GitViewPhase.NotRepository:
50
+ return new GitEmptyState(Resources.noFolderIcon, Resources.notRepositoryHeading, Resources.formatNotRepositoryText(this.state.readFolder()));
51
+ case GitViewPhase.FolderUnreadable:
52
+ return new GitEmptyState(Resources.folderUnreadableIcon, Resources.folderUnreadableHeading, Resources.formatFolderUnreadableText(this.state.readFolder()));
53
+ case GitViewPhase.GitMissing:
54
+ return new GitEmptyState(Resources.gitMissingIcon, Resources.gitMissingHeading, Resources.gitMissingText);
55
+ case GitViewPhase.GitTooOld:
56
+ return new GitEmptyState(Resources.gitTooOldIcon, Resources.formatGitTooOldHeading(this.state.gitVersion()), Resources.gitTooOldText);
57
+ case GitViewPhase.Failed:
58
+ return new GitEmptyState(Resources.failureIcon, Resources.failedHeading, this.state.readFailure());
59
+ case GitViewPhase.FolderFailed:
60
+ return new GitEmptyState(Resources.failureIcon, Resources.folderFailedHeading, this.state.readFailure());
61
+ default:
62
+ return null;
63
+ }
64
+ }
65
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
66
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.6", type: GitViewComponent, isStandalone: true, selector: "nol-git-view", providers: [GitViewStateService], ngImport: i0, template: "<!--\n@license\nCopyright (c) Noldova.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n-->\n\n@if (empty(); as empty) {\n <div class=\"empty\">\n <span class=\"empty-icon material-symbols-rounded\" aria-hidden=\"true\">{{ empty.icon }}</span>\n <h2 class=\"heading\">{{ empty.heading }}</h2>\n <p class=\"text\">{{ empty.text }}</p>\n @if (offersGit()) {\n <span class=\"actions\">\n <button nol-button type=\"button\" (click)=\"getGit()\"><span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.openLinkIcon }}</span>{{ resources.getGitLabel }}</button>\n <button nol-button type=\"button\" [variant]=\"secondary\" (click)=\"checkAgain()\">{{ resources.checkAgainLabel }}</button>\n </span>\n }\n </div>\n} @else if (state.status(); as status) {\n <div class=\"body\">\n <nol-git-branch-card [status]=\"status\" />\n @if (status.remote; as remote) {\n <nol-git-host-row [remote]=\"remote\" [status]=\"status\" [folder]=\"state.folder() ?? ''\" />\n }\n @if (operationOf(status.operation); as operation) {\n <div class=\"banner\" role=\"status\">\n <span class=\"banner-icon warning material-symbols-rounded\" aria-hidden=\"true\">{{ resources.mergeIcon }}</span>\n <span class=\"banner-text\"><span class=\"strong\">{{ operation }}</span><span class=\"muted\">{{ resources.formatConflictText(state.conflicts()) }}</span></span>\n </div>\n }\n @if (state.watchFailure(); as watchFailure) {\n <div class=\"banner\" role=\"status\">\n <span class=\"banner-icon warning material-symbols-rounded\" aria-hidden=\"true\">{{ resources.watchFailedIcon }}</span>\n <span class=\"banner-text\">{{ watchFailure }}</span>\n <button nol-button type=\"button\" class=\"banner-action\" [variant]=\"secondary\" (click)=\"followAgain()\">{{ resources.checkAgainLabel }}</button>\n </div>\n }\n @if (state.failure(); as failure) {\n <div class=\"banner\" role=\"alert\">\n <span class=\"banner-icon failed material-symbols-rounded\" aria-hidden=\"true\">{{ resources.failureIcon }}</span>\n <span class=\"banner-text\">{{ failure }}</span>\n <button nol-button type=\"button\" class=\"banner-action\" [variant]=\"secondary\" (click)=\"dismissFailure()\">{{ resources.dismissLabel }}</button>\n </div>\n }\n @for (group of state.groups(); track group.kind) {\n <nol-git-file-group [group]=\"group\" />\n } @empty {\n <p class=\"quiet\">{{ resources.noChanges }}</p>\n }\n @if (status.truncated) {\n <p class=\"quiet\">{{ resources.listCut }}</p>\n }\n <nol-git-commit-card [status]=\"status\" />\n </div>\n}\n", styles: ["/**\n * @license\n * Copyright (c) Noldova.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n --nol-git-card-padding: 0.625rem;\n --nol-git-empty-icon: 1.25rem;\n\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n overflow: auto;\n color: var(--nol-text);\n font-family: var(--nol-font-sans);\n font-size: var(--nol-text-panel);\n line-height: var(--nol-line-panel);\n}\n\n.body {\n display: grid;\n gap: var(--nol-space-2);\n align-content: start;\n padding: var(--nol-space-1) var(--nol-space-2) var(--nol-space-3);\n}\n\n.banner {\n display: flex;\n gap: var(--nol-space-2);\n align-items: flex-start;\n padding: var(--nol-space-2) var(--nol-git-card-padding);\n border: var(--nol-border-width) solid var(--nol-card-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-raised);\n}\n\n.banner-icon {\n flex: none;\n margin-top: var(--nol-tab-inset);\n font-size: var(--nol-icon);\n}\n\n.banner-text {\n display: grid;\n flex: 1;\n gap: var(--nol-tab-inset);\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.banner-action {\n flex: none;\n}\n\n.warning {\n color: var(--nol-warning);\n}\n\n.failed {\n color: var(--nol-status-failed);\n}\n\n.strong {\n color: var(--nol-text-strong);\n font-weight: var(--nol-weight-emphasis);\n}\n\n.muted,\n.quiet {\n color: var(--nol-text-muted);\n}\n\n.quiet {\n margin: 0;\n padding: 0 var(--nol-git-card-padding);\n}\n\n.empty {\n display: grid;\n gap: var(--nol-space-2);\n justify-items: start;\n padding: var(--nol-space-3) var(--nol-space-4);\n}\n\n.empty-icon {\n width: var(--nol-git-empty-icon);\n height: var(--nol-git-empty-icon);\n color: var(--nol-text-muted);\n font-size: var(--nol-git-empty-icon);\n}\n\n.heading {\n margin: 0;\n color: var(--nol-text-strong);\n font-size: inherit;\n font-weight: var(--nol-weight-emphasis);\n line-height: inherit;\n}\n\n.text {\n margin: 0;\n color: var(--nol-text-muted);\n}\n\n.actions {\n display: flex;\n gap: var(--nol-space-2);\n}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[nol-button], a[nol-button]", inputs: ["variant", "overlay", "backdrop", "danger", "size", "busy"] }, { kind: "component", type: GitBranchCardComponent, selector: "nol-git-branch-card", inputs: ["status"] }, { kind: "component", type: GitCommitCardComponent, selector: "nol-git-commit-card", inputs: ["status"] }, { kind: "component", type: GitFileGroupComponent, selector: "nol-git-file-group", inputs: ["group"] }, { kind: "component", type: GitHostRowComponent, selector: "nol-git-host-row", inputs: ["remote", "status", "folder"] }] });
67
+ }
68
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitViewComponent, decorators: [{
69
+ type: Component,
70
+ args: [{ selector: "nol-git-view", imports: [ButtonComponent, GitBranchCardComponent, GitCommitCardComponent, GitFileGroupComponent, GitHostRowComponent], providers: [GitViewStateService], template: "<!--\n@license\nCopyright (c) Noldova.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n-->\n\n@if (empty(); as empty) {\n <div class=\"empty\">\n <span class=\"empty-icon material-symbols-rounded\" aria-hidden=\"true\">{{ empty.icon }}</span>\n <h2 class=\"heading\">{{ empty.heading }}</h2>\n <p class=\"text\">{{ empty.text }}</p>\n @if (offersGit()) {\n <span class=\"actions\">\n <button nol-button type=\"button\" (click)=\"getGit()\"><span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.openLinkIcon }}</span>{{ resources.getGitLabel }}</button>\n <button nol-button type=\"button\" [variant]=\"secondary\" (click)=\"checkAgain()\">{{ resources.checkAgainLabel }}</button>\n </span>\n }\n </div>\n} @else if (state.status(); as status) {\n <div class=\"body\">\n <nol-git-branch-card [status]=\"status\" />\n @if (status.remote; as remote) {\n <nol-git-host-row [remote]=\"remote\" [status]=\"status\" [folder]=\"state.folder() ?? ''\" />\n }\n @if (operationOf(status.operation); as operation) {\n <div class=\"banner\" role=\"status\">\n <span class=\"banner-icon warning material-symbols-rounded\" aria-hidden=\"true\">{{ resources.mergeIcon }}</span>\n <span class=\"banner-text\"><span class=\"strong\">{{ operation }}</span><span class=\"muted\">{{ resources.formatConflictText(state.conflicts()) }}</span></span>\n </div>\n }\n @if (state.watchFailure(); as watchFailure) {\n <div class=\"banner\" role=\"status\">\n <span class=\"banner-icon warning material-symbols-rounded\" aria-hidden=\"true\">{{ resources.watchFailedIcon }}</span>\n <span class=\"banner-text\">{{ watchFailure }}</span>\n <button nol-button type=\"button\" class=\"banner-action\" [variant]=\"secondary\" (click)=\"followAgain()\">{{ resources.checkAgainLabel }}</button>\n </div>\n }\n @if (state.failure(); as failure) {\n <div class=\"banner\" role=\"alert\">\n <span class=\"banner-icon failed material-symbols-rounded\" aria-hidden=\"true\">{{ resources.failureIcon }}</span>\n <span class=\"banner-text\">{{ failure }}</span>\n <button nol-button type=\"button\" class=\"banner-action\" [variant]=\"secondary\" (click)=\"dismissFailure()\">{{ resources.dismissLabel }}</button>\n </div>\n }\n @for (group of state.groups(); track group.kind) {\n <nol-git-file-group [group]=\"group\" />\n } @empty {\n <p class=\"quiet\">{{ resources.noChanges }}</p>\n }\n @if (status.truncated) {\n <p class=\"quiet\">{{ resources.listCut }}</p>\n }\n <nol-git-commit-card [status]=\"status\" />\n </div>\n}\n", styles: ["/**\n * @license\n * Copyright (c) Noldova.\n *\n * This source code is licensed under the license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n:host {\n --nol-git-card-padding: 0.625rem;\n --nol-git-empty-icon: 1.25rem;\n\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n height: 100%;\n min-height: 0;\n overflow: auto;\n color: var(--nol-text);\n font-family: var(--nol-font-sans);\n font-size: var(--nol-text-panel);\n line-height: var(--nol-line-panel);\n}\n\n.body {\n display: grid;\n gap: var(--nol-space-2);\n align-content: start;\n padding: var(--nol-space-1) var(--nol-space-2) var(--nol-space-3);\n}\n\n.banner {\n display: flex;\n gap: var(--nol-space-2);\n align-items: flex-start;\n padding: var(--nol-space-2) var(--nol-git-card-padding);\n border: var(--nol-border-width) solid var(--nol-card-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-raised);\n}\n\n.banner-icon {\n flex: none;\n margin-top: var(--nol-tab-inset);\n font-size: var(--nol-icon);\n}\n\n.banner-text {\n display: grid;\n flex: 1;\n gap: var(--nol-tab-inset);\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.banner-action {\n flex: none;\n}\n\n.warning {\n color: var(--nol-warning);\n}\n\n.failed {\n color: var(--nol-status-failed);\n}\n\n.strong {\n color: var(--nol-text-strong);\n font-weight: var(--nol-weight-emphasis);\n}\n\n.muted,\n.quiet {\n color: var(--nol-text-muted);\n}\n\n.quiet {\n margin: 0;\n padding: 0 var(--nol-git-card-padding);\n}\n\n.empty {\n display: grid;\n gap: var(--nol-space-2);\n justify-items: start;\n padding: var(--nol-space-3) var(--nol-space-4);\n}\n\n.empty-icon {\n width: var(--nol-git-empty-icon);\n height: var(--nol-git-empty-icon);\n color: var(--nol-text-muted);\n font-size: var(--nol-git-empty-icon);\n}\n\n.heading {\n margin: 0;\n color: var(--nol-text-strong);\n font-size: inherit;\n font-weight: var(--nol-weight-emphasis);\n line-height: inherit;\n}\n\n.text {\n margin: 0;\n color: var(--nol-text-muted);\n}\n\n.actions {\n display: flex;\n gap: var(--nol-space-2);\n}\n"] }]
71
+ }] });
72
+ //# sourceMappingURL=git-view.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-view.component.js","sourceRoot":"","sources":["../../../../../../../../src/noldova.git.window/src/app/components/git-view/git-view.component.ts","../../../../../../../../src/noldova.git.window/src/app/components/git-view/git-view.component.html"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AACzE,OAAO,EAA2B,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;;AAShF,MAAM,OAAO,gBAAgB;IACV,OAAO,GAAuB,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE7D,SAAS,GAAqB,SAAS,CAAC;IACxC,MAAM,GAAwB,YAAY,CAAC;IAC3C,SAAS,GAAkB,aAAa,CAAC,SAAS,CAAC;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AAE,sBAAsB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,CAAC,aAC3G,CAAC,mBAAmB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export var GitBranchMenuKind;
9
+ (function (GitBranchMenuKind) {
10
+ GitBranchMenuKind["Create"] = "Create";
11
+ GitBranchMenuKind["Local"] = "Local";
12
+ GitBranchMenuKind["Remote"] = "Remote";
13
+ })(GitBranchMenuKind || (GitBranchMenuKind = {}));
14
+ //# sourceMappingURL=git-branch-menu-kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-branch-menu-kind.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/enums/git-branch-menu-kind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,oCAAe,CAAA;IACf,sCAAiB,CAAA;AACnB,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export var GitDiffRowKind;
9
+ (function (GitDiffRowKind) {
10
+ GitDiffRowKind["Context"] = "Context";
11
+ GitDiffRowKind["Added"] = "Added";
12
+ GitDiffRowKind["Removed"] = "Removed";
13
+ GitDiffRowKind["Meta"] = "Meta";
14
+ })(GitDiffRowKind || (GitDiffRowKind = {}));
15
+ //# sourceMappingURL=git-diff-row-kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-diff-row-kind.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/enums/git-diff-row-kind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,+BAAa,CAAA;AACf,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export var GitFileGroupKind;
9
+ (function (GitFileGroupKind) {
10
+ GitFileGroupKind["Conflicts"] = "Conflicts";
11
+ GitFileGroupKind["Staged"] = "Staged";
12
+ GitFileGroupKind["Changes"] = "Changes";
13
+ })(GitFileGroupKind || (GitFileGroupKind = {}));
14
+ //# sourceMappingURL=git-file-group-kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-file-group-kind.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/enums/git-file-group-kind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;AACrB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export var GitFileTone;
9
+ (function (GitFileTone) {
10
+ GitFileTone["Modified"] = "Modified";
11
+ GitFileTone["Added"] = "Added";
12
+ GitFileTone["Removed"] = "Removed";
13
+ GitFileTone["Untracked"] = "Untracked";
14
+ GitFileTone["Conflict"] = "Conflict";
15
+ })(GitFileTone || (GitFileTone = {}));
16
+ //# sourceMappingURL=git-file-tone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-file-tone.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/enums/git-file-tone.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;AACvB,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ export var GitViewPhase;
9
+ (function (GitViewPhase) {
10
+ GitViewPhase["NoFolder"] = "NoFolder";
11
+ GitViewPhase["Loading"] = "Loading";
12
+ GitViewPhase["Ready"] = "Ready";
13
+ GitViewPhase["NotRepository"] = "NotRepository";
14
+ GitViewPhase["FolderUnreadable"] = "FolderUnreadable";
15
+ GitViewPhase["GitMissing"] = "GitMissing";
16
+ GitViewPhase["GitTooOld"] = "GitTooOld";
17
+ GitViewPhase["Failed"] = "Failed";
18
+ GitViewPhase["FolderFailed"] = "FolderFailed";
19
+ })(GitViewPhase || (GitViewPhase = {}));
20
+ //# sourceMappingURL=git-view-phase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-view-phase.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/enums/git-view-phase.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,+CAA+B,CAAA;IAC/B,qDAAqC,CAAA;IACrC,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,iCAAiB,CAAA;IACjB,6CAA6B,CAAA;AAC/B,CAAC,EAVW,YAAY,KAAZ,YAAY,QAUvB"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Resources } from "../../resources.js";
9
+ import { GitWindowException } from "./git-window.exception.js";
10
+ export class GitFolderProvidedException extends GitWindowException {
11
+ name = "GitFolderProvidedException";
12
+ constructor() {
13
+ super(Resources.folderProvided);
14
+ }
15
+ }
16
+ //# sourceMappingURL=git-folder-provided.exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-folder-provided.exception.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/exceptions/git-folder-provided.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IACvC,IAAI,GAAW,4BAA4B,CAAC;IAErE;QACE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Exception } from "@noldova/context.exceptions";
9
+ export class GitWindowException extends Exception {
10
+ name = "GitWindowException";
11
+ constructor(message, options) {
12
+ super(message, options);
13
+ }
14
+ }
15
+ //# sourceMappingURL=git-window.exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-window.exception.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/exceptions/git-window.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,6BAA6B,CAAC;AAE/E,MAAM,OAAgB,kBAAmB,SAAQ,SAAS;IAC/B,IAAI,GAAW,oBAAoB,CAAC;IAE7D,YAAsB,OAAe,EAAE,OAA0B;QAC/D,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Resources } from "../../resources.js";
9
+ import { GitWindowException } from "./git-window.exception.js";
10
+ export class StatusMissingException extends GitWindowException {
11
+ name = "StatusMissingException";
12
+ constructor() {
13
+ super(Resources.noStatus);
14
+ }
15
+ }
16
+ //# sourceMappingURL=status-missing.exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-missing.exception.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/exceptions/status-missing.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IACnC,IAAI,GAAW,wBAAwB,CAAC;IAEjE;QACE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ //# sourceMappingURL=i-git-folder-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-git-folder-provider.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/interfaces/i-git-folder-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ //# sourceMappingURL=i-git-host-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-git-host-row.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/interfaces/i-git-host-row.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ //# sourceMappingURL=i-provided-git-host-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-provided-git-host-row.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/interfaces/i-provided-git-host-row.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { GitBranchMenuKind } from "../enums/git-branch-menu-kind.js";
9
+ import { Resources } from "../../resources.js";
10
+ export class GitBranchMenuItem {
11
+ kind;
12
+ name;
13
+ title;
14
+ isCurrent;
15
+ constructor(kind, name, title, isCurrent) {
16
+ this.kind = kind;
17
+ this.name = name;
18
+ this.title = title;
19
+ this.isCurrent = isCurrent;
20
+ }
21
+ static itemsOf(branches, query) {
22
+ if (branches === null)
23
+ return [];
24
+ const lower = query.toLowerCase();
25
+ const matches = (name) => name.toLowerCase().includes(lower);
26
+ const items = [];
27
+ if (query.length === 0)
28
+ items.push(new GitBranchMenuItem(GitBranchMenuKind.Create, "", Resources.createBranchPrompt, false));
29
+ else if (!branches.branches.includes(query))
30
+ items.push(new GitBranchMenuItem(GitBranchMenuKind.Create, query, Resources.formatCreateBranch(query), false));
31
+ for (const branch of branches.branches.filter(matches))
32
+ items.push(new GitBranchMenuItem(GitBranchMenuKind.Local, branch, branch, branch === branches.current));
33
+ for (const branch of branches.remoteBranches.filter(matches))
34
+ items.push(new GitBranchMenuItem(GitBranchMenuKind.Remote, GitBranchMenuItem.localNameOf(branch, branches.remotes), branch, false));
35
+ return items;
36
+ }
37
+ static localNameOf(branch, remotes) {
38
+ const remote = remotes.find(t => branch.startsWith(`${t}${Resources.slash}`));
39
+ return remote === undefined ? branch : branch.slice(remote.length + 1);
40
+ }
41
+ }
42
+ //# sourceMappingURL=git-branch-menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-branch-menu-item.js","sourceRoot":"","sources":["../../../../../../../src/noldova.git.window/src/app/models/git-branch-menu-item.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,iBAAiB;IACZ,IAAI,CAAoB;IACxB,IAAI,CAAS;IACb,KAAK,CAAS;IACd,SAAS,CAAU;IAEnC,YAAmB,IAAuB,EAAE,IAAY,EAAE,KAAa,EAAE,SAAkB;QACzF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,QAA4B,EAAE,KAAa;QAC/D,IAAI,QAAQ,KAAK,IAAI;YACnB,OAAO,EAAE,CAAC;QACZ,MAAM,KAAK,GAAW,KAAK,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9E,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,IAAI,iB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