@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Noldova
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
- # Temporary Holding Version
1
+ # @noldova/git.window
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Git module's window part, in Angular: the Git view of a folder's branch, changes and commit.
4
+ It is compiled by Angular's compiler in partial compilation mode; Angular, Noldova Desktop's and context's packages and the interface kit are optional peers, which the app's window workspace provides.
5
+
6
+ An app reaches its API through [`@noldova/git`](https://github.com/noldova-com/git/tree/main/src/noldova.git)'s `./window` export, and the module pins it at its own version.
7
+ [documents/ARCHITECTURE.md](https://github.com/noldova-com/git/blob/main/documents/ARCHITECTURE.md) says how it is built, and the [README](https://github.com/noldova-com/git#readme) how to build and test it.
8
+ It is licensed under the [MIT License](https://github.com/noldova-com/git/blob/main/LICENSE).
@@ -0,0 +1,27 @@
1
+ # Third-party notices
2
+
3
+ The Git view's branch icon is Primer Octicons' `git-branch` icon, 16px variant, from the npm package `@primer/octicons` 19.42.0 (https://github.com/primer/octicons), drawn from its path data in `src/resources.ts` as `branchIconPath`.
4
+
5
+ ## Primer Octicons
6
+
7
+ MIT License
8
+
9
+ Copyright (c) 2026 GitHub Inc.
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "@noldova/git.window",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "The Git module's window part: the Git view of a folder's branch, changes and commit.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/noldova-com/git.git",
10
+ "directory": "src/noldova.git.window"
11
+ },
12
+ "homepage": "https://github.com/noldova-com/git#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/noldova-com/git/issues"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./src/api/index.d.ts",
19
+ "default": "./src/api/index.js"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "files": [
24
+ "THIRD-PARTY-NOTICES.md",
25
+ "src/**/*.js",
26
+ "src/**/*.js.map",
27
+ "src/**/*.d.ts"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "registry": "https://registry.npmjs.org/"
32
+ },
33
+ "peerDependencies": {
34
+ "@angular/common": ">=22.2.6 <23.0.0",
35
+ "@angular/core": ">=22.2.6 <23.0.0",
36
+ "@angular/forms": ">=22.2.6 <23.0.0",
37
+ "@noldova/context.exceptions": ">=0.0.7 <0.1.0",
38
+ "@noldova/context.json": ">=0.0.7 <0.1.0",
39
+ "@noldova/desktop.window": ">=0.0.1 <0.1.0",
40
+ "@noldova/ui.components.angular": ">=0.0.5 <0.1.0"
41
+ },
42
+ "dependencies": {
43
+ "@noldova/git.protocol": "0.0.2"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "@angular/common": {
47
+ "optional": true
48
+ },
49
+ "@angular/core": {
50
+ "optional": true
51
+ },
52
+ "@angular/forms": {
53
+ "optional": true
54
+ },
55
+ "@noldova/context.exceptions": {
56
+ "optional": true
57
+ },
58
+ "@noldova/context.json": {
59
+ "optional": true
60
+ },
61
+ "@noldova/desktop.window": {
62
+ "optional": true
63
+ },
64
+ "@noldova/ui.components.angular": {
65
+ "optional": true
66
+ }
67
+ },
68
+ "gitHead": "bde3a787663248342ab59b5ce75a4a0203965f0e"
69
+ }
@@ -0,0 +1,175 @@
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
+
9
+ import type { Signal, Type } from "@angular/core";
10
+ import { Exception, type ExceptionOptions } from "@noldova/context.exceptions";
11
+ import type { IWindowPart, IWindowPartContext } from "@noldova/desktop.window";
12
+ import type { GitRemote } from "@noldova/git.protocol";
13
+
14
+ /**
15
+ * The base of the Git window part's own exceptions; catch it to catch them all.
16
+ * It is abstract: providing a second folder provider throws {@link GitFolderProvidedException}.
17
+ * @example
18
+ * ```ts
19
+ * import { GitWindowException } from "@noldova/git.window";
20
+ *
21
+ * export function isGitWindowFailure(error: unknown): boolean {
22
+ * return error instanceof GitWindowException;
23
+ * }
24
+ * ```
25
+ */
26
+ export declare abstract class GitWindowException extends Exception {
27
+ /**
28
+ * The exception's name, `GitWindowException` unless a subclass names itself.
29
+ */
30
+ public override readonly name: string;
31
+
32
+ /**
33
+ * Creates the exception; only the window part's own exceptions call it.
34
+ * @param message The message, from the window part's resources.
35
+ * @param options The cause, when there is one.
36
+ */
37
+ protected constructor(message: string, options?: ExceptionOptions);
38
+ }
39
+
40
+ /**
41
+ * Thrown when an app provides the Git view's folder while another provider is still registered.
42
+ */
43
+ export declare class GitFolderProvidedException extends GitWindowException {
44
+ /**
45
+ * The exception's name, `GitFolderProvidedException`.
46
+ */
47
+ public override readonly name: string;
48
+
49
+ /**
50
+ * Creates the exception, with a message that says to unregister the first provider.
51
+ */
52
+ public constructor();
53
+ }
54
+
55
+ /**
56
+ * A host module's row in the Git view, shown under the branch for a remote the module claims, such as GitHub's pull request and its checks.
57
+ *
58
+ * @remarks
59
+ * The view renders the component with the inputs `folder` (the repository's absolute folder), `branch` (the current branch, or `null` on a detached
60
+ * HEAD), `head` (the commit HEAD names, or `null` before the first commit) and `remote` (the {@link GitRemote} it claimed). Its injector gives
61
+ * `WindowPartTokens.context` as the providing module's context, not the Git view's, so the row reads and asks under its own module.
62
+ */
63
+ export interface IGitHostRow {
64
+ /**
65
+ * Whether the row shows for this remote; the first registered row that claims a remote wins.
66
+ * @param remote The repository's remote; its host and path are untrusted.
67
+ * @returns `true` when the row shows for the remote.
68
+ */
69
+ claims(remote: GitRemote): boolean;
70
+
71
+ /**
72
+ * The standalone component the view renders in the row's place.
73
+ */
74
+ readonly component: Type<unknown>;
75
+ }
76
+
77
+ /**
78
+ * A host row as {@link GitHostRows.provide} added it, with the context of the window part that provided it.
79
+ */
80
+ export interface IProvidedGitHostRow {
81
+ /**
82
+ * The providing window part's context, which the view gives the row's component as `WindowPartTokens.context`.
83
+ */
84
+ readonly context: IWindowPartContext;
85
+
86
+ /**
87
+ * The row.
88
+ */
89
+ readonly row: IGitHostRow;
90
+ }
91
+
92
+ /**
93
+ * The folder the Git view shows, which the app provides.
94
+ */
95
+ export declare class GitFolder {
96
+ /**
97
+ * The provided folder, or `null` when there is no provider, it gives none, its value is refused, or reading it throws; a refused value or a throw
98
+ * is logged through the provider's context, and the view shows a throw's message as its failure.
99
+ */
100
+ public static readonly folder: Signal<string | null>;
101
+
102
+ /**
103
+ * The message of the error the provided folder threw when read, which the view shows as its failure, or `null` when reading it didn't throw or
104
+ * there is no provider.
105
+ * @example
106
+ * ```ts
107
+ * import { computed, type Signal } from "@angular/core";
108
+ * import { GitFolder } from "@noldova/git.window";
109
+ *
110
+ * export const folderUnreadable: Signal<boolean> = computed(() => GitFolder.failure() !== null);
111
+ * ```
112
+ */
113
+ public static readonly failure: Signal<string | null>;
114
+
115
+ /**
116
+ * Provides the folder the Git view shows.
117
+ * @param context The window part's context, which logs a folder the view refuses.
118
+ * @param folder The folder, an absolute path of at most 4096 characters, or `null` for none.
119
+ * @returns A function that unregisters the provider.
120
+ * @throws {GitFolderProvidedException} When another provider is still registered.
121
+ * @example
122
+ * ```ts
123
+ * import { signal } from "@angular/core";
124
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
125
+ * import { GitFolder } from "@noldova/git.window";
126
+ *
127
+ * export function showFolder(context: IWindowPartContext): () => void {
128
+ * return GitFolder.provide(context, signal("/home/a/repo"));
129
+ * }
130
+ * ```
131
+ */
132
+ public static provide(context: IWindowPartContext, folder: Signal<string | null>): () => void;
133
+ }
134
+
135
+ /**
136
+ * The host rows other modules add to the Git view.
137
+ */
138
+ export declare class GitHostRows {
139
+ /**
140
+ * Adds a host row; rows are asked in the order they were added.
141
+ * @param context The providing window part's context, which logs a claim that throws.
142
+ * @param row The row.
143
+ * @returns A function that removes the row.
144
+ * @example
145
+ * ```ts
146
+ * import type { IWindowPartContext } from "@noldova/desktop.window";
147
+ * import { GitHostRows } from "@noldova/git.window";
148
+ *
149
+ * export function addRow(context: IWindowPartContext, component: import("@angular/core").Type<unknown>): () => void {
150
+ * return GitHostRows.provide(context, { claims: t => t.host === "github.com", component });
151
+ * }
152
+ * ```
153
+ */
154
+ public static provide(context: IWindowPartContext, row: IGitHostRow): () => void;
155
+
156
+ /**
157
+ * Finds the row for a remote.
158
+ * @param remote The repository's remote.
159
+ * @returns The first added row that claims the remote, with its providing context, the same object for as long as the row stays added, or `null`
160
+ * when none does and the view shows the plain remote line; a row whose claim throws is logged and skipped.
161
+ */
162
+ public static rowFor(remote: GitRemote): IProvidedGitHostRow | null;
163
+ }
164
+
165
+ /**
166
+ * The Git module's window part, which Noldova Desktop activates in each window; it registers the Git view, `git.view`, in the right dock.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * import { windowPart } from "@noldova/git.window";
171
+ *
172
+ * console.log(windowPart.moduleId);
173
+ * ```
174
+ */
175
+ export declare const windowPart: IWindowPart;
@@ -0,0 +1,13 @@
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 { GitFolderProvidedException } from "../app/exceptions/git-folder-provided.exception.js";
9
+ export { GitWindowException } from "../app/exceptions/git-window.exception.js";
10
+ export { GitFolder } from "../app/services/git-folder.js";
11
+ export { GitHostRows } from "../app/services/git-host-rows.js";
12
+ export { windowPart } from "../app/services/git-window-part.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/noldova.git.window/src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,129 @@
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, effect, ElementRef, inject, input, signal, viewChild } from "@angular/core";
9
+ import { FormsModule } from "@angular/forms";
10
+ import { ButtonComponent, ButtonVariant, TooltipDirective } from "@noldova/ui.components.angular";
11
+ import { GitBranchMenuKind } from "../../enums/git-branch-menu-kind.js";
12
+ import { GitBranchMenuItem } from "../../models/git-branch-menu-item.js";
13
+ import { Resources } from "../../../resources.js";
14
+ import { GitViewStateService } from "../../services/git-view-state.service.js";
15
+ import * as i0 from "@angular/core";
16
+ import * as i1 from "@angular/forms";
17
+ export class GitBranchCardComponent {
18
+ element = inject(ElementRef);
19
+ trigger = viewChild.required("trigger", /* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
21
+ filter = viewChild("filter", /* @ts-ignore */
22
+ ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
23
+ resources = Resources;
24
+ kinds = GitBranchMenuKind;
25
+ secondary = ButtonVariant.Secondary;
26
+ state = inject(GitViewStateService);
27
+ isOpen = signal(false, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
29
+ query = signal("", /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
31
+ chosen = signal(null, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "chosen" }] : /* istanbul ignore next */ []));
33
+ name = computed(() => this.status().branch ?? (this.status().head ?? "").slice(0, Resources.shortHeadLength), /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
35
+ upstream = computed(() => this.status().upstream, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "upstream" }] : /* istanbul ignore next */ []));
37
+ items = computed(() => GitBranchMenuItem.itemsOf(this.state.branches(), this.query().trim()), /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
39
+ active = computed(() => this.chosen() ?? Math.max(0, this.items().findIndex(t => t.isCurrent)), /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
41
+ status = input.required(/* @ts-ignore */
42
+ ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
43
+ constructor() {
44
+ effect(() => this.filter()?.nativeElement.focus());
45
+ }
46
+ toggle() {
47
+ if (this.state.busy())
48
+ return;
49
+ if (this.isOpen()) {
50
+ this.close();
51
+ return;
52
+ }
53
+ this.find("");
54
+ this.isOpen.set(true);
55
+ void this.state.loadBranchesAsync();
56
+ }
57
+ find(query) {
58
+ this.query.set(query);
59
+ this.chosen.set(null);
60
+ }
61
+ onKey(event) {
62
+ const count = this.items().length;
63
+ switch (event.key) {
64
+ case "ArrowDown":
65
+ case "ArrowUp":
66
+ event.preventDefault();
67
+ if (count > 0)
68
+ this.chosen.set((this.active() + (event.key === "ArrowDown" ? 1 : count - 1)) % count);
69
+ break;
70
+ case "Enter": {
71
+ event.preventDefault();
72
+ const item = this.items()[this.active()];
73
+ if (item !== undefined)
74
+ this.choose(item);
75
+ break;
76
+ }
77
+ }
78
+ }
79
+ escape(event) {
80
+ if (!this.isOpen())
81
+ return;
82
+ event.preventDefault();
83
+ this.dismiss();
84
+ }
85
+ closeOnLeave(event) {
86
+ if (this.isOpen() && !(event.relatedTarget instanceof Node && this.element.nativeElement.contains(event.relatedTarget)))
87
+ this.close();
88
+ }
89
+ closeOutside(event) {
90
+ if (this.isOpen() && !event.composedPath().includes(this.element.nativeElement))
91
+ this.close();
92
+ }
93
+ choose(item) {
94
+ if (item.kind === GitBranchMenuKind.Create && item.name.length === 0)
95
+ return;
96
+ this.dismiss();
97
+ if (item.kind === GitBranchMenuKind.Create)
98
+ void this.state.createBranchAsync(item.name);
99
+ else if (!item.isCurrent)
100
+ void this.state.switchBranchAsync(item.name);
101
+ }
102
+ push() {
103
+ void this.state.pushAsync();
104
+ }
105
+ loadPullHooks() {
106
+ void this.state.loadPullHooksAsync();
107
+ }
108
+ pull() {
109
+ void this.state.pullAsync();
110
+ }
111
+ dismiss() {
112
+ this.close();
113
+ this.trigger().nativeElement.focus();
114
+ }
115
+ close() {
116
+ this.isOpen.set(false);
117
+ }
118
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitBranchCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
119
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.6", type: GitBranchCardComponent, isStandalone: true, selector: "nol-git-branch-card", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "document:pointerdown": "closeOutside($event)", "focusout": "closeOnLeave($event)", "keydown.escape": "escape($event)" } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "filter", first: true, predicate: ["filter"], descendants: true, isSignal: true }], 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<div class=\"line\">\n <button #trigger type=\"button\" class=\"name\" [class.open]=\"isOpen()\" [attr.aria-expanded]=\"isOpen()\" aria-haspopup=\"listbox\" [attr.aria-label]=\"resources.formatSwitchBranch(name())\"\n [nolTooltip]=\"resources.switchBranchLabel\" [attr.aria-disabled]=\"state.busy()\" (click)=\"toggle()\">\n <svg class=\"octicon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path [attr.d]=\"resources.branchIconPath\" /></svg>\n <span class=\"branch\" data-truncates [nolTooltip]=\"name()\" [nolTooltipTruncated]=\"true\">{{ name() }}</span>\n <span class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ isOpen() ? resources.menuOpenIcon : resources.menuClosedIcon }}</span>\n </button>\n <span class=\"spacer\"></span>\n @if (status().branch !== null) {\n @if (upstream(); as upstream) {\n <button nol-button type=\"button\" class=\"pull\" [variant]=\"secondary\" [disabled]=\"upstream.gone || state.busy()\"\n [nolTooltip]=\"resources.formatPullHooks(state.pullHooks())\" (pointerenter)=\"loadPullHooks()\" (focus)=\"loadPullHooks()\" (click)=\"pull()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.pullIcon }}</span>{{ resources.formatPull(upstream.behind) }}\n </button>\n <button nol-button type=\"button\" class=\"push\" [variant]=\"secondary\" [disabled]=\"upstream.ahead === 0 || state.busy()\" (click)=\"push()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.pushIcon }}</span>{{ resources.formatPush(upstream.ahead) }}\n </button>\n } @else {\n <button nol-button type=\"button\" class=\"push\" [variant]=\"secondary\" [disabled]=\"state.busy()\" (click)=\"push()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.publishIcon }}</span>{{ resources.publishLabel }}\n </button>\n }\n }\n</div>\n<div class=\"upstream\">\n @if (upstream(); as upstream) {\n @if (upstream.gone) {\n <span>{{ resources.formatUpstreamGone(upstream.name) }}</span>\n } @else {\n <span>{{ upstream.name }}</span>\n <span>{{ resources.formatAheadBehind(upstream.ahead, upstream.behind) }}</span>\n }\n } @else {\n <span>{{ resources.noUpstream }}</span>\n }\n</div>\n@if (isOpen()) {\n <div class=\"menu\">\n <input #filter class=\"filter\" type=\"text\" role=\"combobox\" aria-autocomplete=\"list\" aria-expanded=\"true\" aria-controls=\"git-branch-list\"\n [attr.aria-label]=\"resources.branchPickerLabel\" [attr.aria-activedescendant]=\"items().length > 0 ? resources.formatBranchOptionId(active()) : null\"\n [placeholder]=\"resources.branchPickerLabel\" [ngModel]=\"query()\" (ngModelChange)=\"find($event)\" (keydown)=\"onKey($event)\" />\n <div id=\"git-branch-list\" class=\"list\" role=\"listbox\" [attr.aria-label]=\"resources.branchPickerLabel\">\n @for (item of items(); track resources.formatBranchItemKey(item.kind, item.title); let index = $index) {\n @let previous = items()[index - 1];\n @if (item.kind !== kinds.Create && previous?.kind !== item.kind) {\n @if (previous?.kind === kinds.Create) {\n <div class=\"separator\" role=\"presentation\"></div>\n }\n <div class=\"label\" role=\"presentation\">{{ item.kind === kinds.Local ? resources.localBranchesLabel : resources.remoteBranchesLabel }}</div>\n }\n <div [id]=\"resources.formatBranchOptionId(index)\" class=\"item\" role=\"option\" [class.active]=\"index === active()\" [class.current]=\"item.isCurrent\"\n [attr.aria-selected]=\"index === active()\" (pointerdown)=\"$event.preventDefault()\" (pointerenter)=\"chosen.set(index)\" (click)=\"choose(item)\">\n <span class=\"material-symbols-rounded\" [class.hidden]=\"item.kind !== kinds.Create && !item.isCurrent\" aria-hidden=\"true\">{{ item.kind === kinds.Create ? resources.createBranchIcon : resources.currentBranchIcon }}</span>\n <span class=\"title\" data-truncates [nolTooltip]=\"item.title\" [nolTooltipTruncated]=\"true\">{{ item.title }}</span>\n </div>\n }\n </div>\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-branch-list-height: 18rem;\n\n position: relative;\n display: grid;\n gap: var(--nol-tab-part-gap);\n min-width: 0;\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.line {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n min-width: 0;\n}\n\n.name {\n display: inline-flex;\n gap: var(--nol-space-1);\n align-items: center;\n min-width: 0;\n min-height: var(--nol-pointer-target);\n margin-left: calc(var(--nol-space-1) * -1);\n padding: 0 var(--nol-space-1);\n border: 0;\n border-radius: var(--nol-radius-small);\n background: none;\n color: var(--nol-text);\n font: inherit;\n}\n\n.name:hover:not([aria-disabled=\"true\"]),\n.name.open {\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.branch {\n overflow: hidden;\n color: var(--nol-text-strong);\n font-weight: var(--nol-weight-emphasis);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.spacer {\n flex: 1;\n}\n\n.pull,\n.push {\n flex: none;\n}\n\n.upstream {\n display: flex;\n flex-wrap: wrap;\n gap: var(--nol-space-2);\n align-items: center;\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n}\n\n.octicon {\n flex: none;\n width: var(--nol-icon);\n height: var(--nol-icon);\n fill: currentcolor;\n}\n\n.menu {\n position: absolute;\n z-index: 2;\n top: calc(var(--nol-space-2) + var(--nol-button-height) + var(--nol-tab-part-gap));\n right: var(--nol-space-1);\n left: var(--nol-space-1);\n padding: var(--nol-menu-padding);\n border: var(--nol-border-width) solid var(--nol-menu-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-menu);\n box-shadow: var(--nol-shadow-large);\n color: var(--nol-menu-text);\n}\n\n.filter {\n box-sizing: border-box;\n width: calc(100% - var(--nol-space-1));\n height: var(--nol-field-height);\n margin: var(--nol-tab-inset) var(--nol-tab-inset) var(--nol-space-1);\n padding: 0 var(--nol-field-padding);\n border: var(--nol-border-width) solid var(--nol-accent);\n border-radius: var(--nol-radius-small);\n outline: none;\n background-color: var(--nol-input);\n color: var(--nol-text);\n font: inherit;\n}\n\n.filter::placeholder {\n color: var(--nol-placeholder);\n}\n\n.list {\n max-height: var(--nol-git-branch-list-height);\n overflow-y: auto;\n}\n\n.item {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n height: var(--nol-menu-item-height);\n padding: 0 var(--nol-menu-item-padding);\n border-radius: var(--nol-radius-small);\n white-space: nowrap;\n cursor: pointer;\n}\n\n.item:hover:not(.active) {\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.item.current,\n.item.active {\n --nol-text-muted: var(--nol-list-active-text);\n\n background-color: var(--nol-list-active);\n color: var(--nol-list-active-text);\n}\n\n.item.active {\n @media (forced-colors: active) {\n --nol-text: HighlightText;\n --nol-text-muted: HighlightText;\n --nol-menu-text: HighlightText;\n --nol-icon-color: HighlightText;\n --nol-list-active-text: HighlightText;\n\n background-color: Highlight;\n color: HighlightText;\n forced-color-adjust: none;\n }\n}\n\n.item .hidden {\n visibility: hidden;\n}\n\n.item .title {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.label {\n padding: var(--nol-menu-label-padding);\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n}\n\n.separator {\n height: var(--nol-border-width);\n margin: var(--nol-menu-separator-spacing) 0;\n background-color: var(--nol-menu-separator);\n}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[nol-button], a[nol-button]", inputs: ["variant", "overlay", "backdrop", "danger", "size", "busy"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TooltipDirective, selector: "[nolTooltip]", inputs: ["nolTooltip", "nolTooltipDescription", "nolTooltipSide", "nolTooltipDisabled", "nolTooltipTruncated", "nolTooltipBeside"] }] });
120
+ }
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitBranchCardComponent, decorators: [{
122
+ type: Component,
123
+ args: [{ selector: "nol-git-branch-card", imports: [ButtonComponent, FormsModule, TooltipDirective], host: {
124
+ "(document:pointerdown)": "closeOutside($event)",
125
+ "(focusout)": "closeOnLeave($event)",
126
+ "(keydown.escape)": "escape($event)"
127
+ }, 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<div class=\"line\">\n <button #trigger type=\"button\" class=\"name\" [class.open]=\"isOpen()\" [attr.aria-expanded]=\"isOpen()\" aria-haspopup=\"listbox\" [attr.aria-label]=\"resources.formatSwitchBranch(name())\"\n [nolTooltip]=\"resources.switchBranchLabel\" [attr.aria-disabled]=\"state.busy()\" (click)=\"toggle()\">\n <svg class=\"octicon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path [attr.d]=\"resources.branchIconPath\" /></svg>\n <span class=\"branch\" data-truncates [nolTooltip]=\"name()\" [nolTooltipTruncated]=\"true\">{{ name() }}</span>\n <span class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ isOpen() ? resources.menuOpenIcon : resources.menuClosedIcon }}</span>\n </button>\n <span class=\"spacer\"></span>\n @if (status().branch !== null) {\n @if (upstream(); as upstream) {\n <button nol-button type=\"button\" class=\"pull\" [variant]=\"secondary\" [disabled]=\"upstream.gone || state.busy()\"\n [nolTooltip]=\"resources.formatPullHooks(state.pullHooks())\" (pointerenter)=\"loadPullHooks()\" (focus)=\"loadPullHooks()\" (click)=\"pull()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.pullIcon }}</span>{{ resources.formatPull(upstream.behind) }}\n </button>\n <button nol-button type=\"button\" class=\"push\" [variant]=\"secondary\" [disabled]=\"upstream.ahead === 0 || state.busy()\" (click)=\"push()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.pushIcon }}</span>{{ resources.formatPush(upstream.ahead) }}\n </button>\n } @else {\n <button nol-button type=\"button\" class=\"push\" [variant]=\"secondary\" [disabled]=\"state.busy()\" (click)=\"push()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.publishIcon }}</span>{{ resources.publishLabel }}\n </button>\n }\n }\n</div>\n<div class=\"upstream\">\n @if (upstream(); as upstream) {\n @if (upstream.gone) {\n <span>{{ resources.formatUpstreamGone(upstream.name) }}</span>\n } @else {\n <span>{{ upstream.name }}</span>\n <span>{{ resources.formatAheadBehind(upstream.ahead, upstream.behind) }}</span>\n }\n } @else {\n <span>{{ resources.noUpstream }}</span>\n }\n</div>\n@if (isOpen()) {\n <div class=\"menu\">\n <input #filter class=\"filter\" type=\"text\" role=\"combobox\" aria-autocomplete=\"list\" aria-expanded=\"true\" aria-controls=\"git-branch-list\"\n [attr.aria-label]=\"resources.branchPickerLabel\" [attr.aria-activedescendant]=\"items().length > 0 ? resources.formatBranchOptionId(active()) : null\"\n [placeholder]=\"resources.branchPickerLabel\" [ngModel]=\"query()\" (ngModelChange)=\"find($event)\" (keydown)=\"onKey($event)\" />\n <div id=\"git-branch-list\" class=\"list\" role=\"listbox\" [attr.aria-label]=\"resources.branchPickerLabel\">\n @for (item of items(); track resources.formatBranchItemKey(item.kind, item.title); let index = $index) {\n @let previous = items()[index - 1];\n @if (item.kind !== kinds.Create && previous?.kind !== item.kind) {\n @if (previous?.kind === kinds.Create) {\n <div class=\"separator\" role=\"presentation\"></div>\n }\n <div class=\"label\" role=\"presentation\">{{ item.kind === kinds.Local ? resources.localBranchesLabel : resources.remoteBranchesLabel }}</div>\n }\n <div [id]=\"resources.formatBranchOptionId(index)\" class=\"item\" role=\"option\" [class.active]=\"index === active()\" [class.current]=\"item.isCurrent\"\n [attr.aria-selected]=\"index === active()\" (pointerdown)=\"$event.preventDefault()\" (pointerenter)=\"chosen.set(index)\" (click)=\"choose(item)\">\n <span class=\"material-symbols-rounded\" [class.hidden]=\"item.kind !== kinds.Create && !item.isCurrent\" aria-hidden=\"true\">{{ item.kind === kinds.Create ? resources.createBranchIcon : resources.currentBranchIcon }}</span>\n <span class=\"title\" data-truncates [nolTooltip]=\"item.title\" [nolTooltipTruncated]=\"true\">{{ item.title }}</span>\n </div>\n }\n </div>\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-branch-list-height: 18rem;\n\n position: relative;\n display: grid;\n gap: var(--nol-tab-part-gap);\n min-width: 0;\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.line {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n min-width: 0;\n}\n\n.name {\n display: inline-flex;\n gap: var(--nol-space-1);\n align-items: center;\n min-width: 0;\n min-height: var(--nol-pointer-target);\n margin-left: calc(var(--nol-space-1) * -1);\n padding: 0 var(--nol-space-1);\n border: 0;\n border-radius: var(--nol-radius-small);\n background: none;\n color: var(--nol-text);\n font: inherit;\n}\n\n.name:hover:not([aria-disabled=\"true\"]),\n.name.open {\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.branch {\n overflow: hidden;\n color: var(--nol-text-strong);\n font-weight: var(--nol-weight-emphasis);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.spacer {\n flex: 1;\n}\n\n.pull,\n.push {\n flex: none;\n}\n\n.upstream {\n display: flex;\n flex-wrap: wrap;\n gap: var(--nol-space-2);\n align-items: center;\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n}\n\n.octicon {\n flex: none;\n width: var(--nol-icon);\n height: var(--nol-icon);\n fill: currentcolor;\n}\n\n.menu {\n position: absolute;\n z-index: 2;\n top: calc(var(--nol-space-2) + var(--nol-button-height) + var(--nol-tab-part-gap));\n right: var(--nol-space-1);\n left: var(--nol-space-1);\n padding: var(--nol-menu-padding);\n border: var(--nol-border-width) solid var(--nol-menu-border);\n border-radius: var(--nol-radius-medium);\n background-color: var(--nol-menu);\n box-shadow: var(--nol-shadow-large);\n color: var(--nol-menu-text);\n}\n\n.filter {\n box-sizing: border-box;\n width: calc(100% - var(--nol-space-1));\n height: var(--nol-field-height);\n margin: var(--nol-tab-inset) var(--nol-tab-inset) var(--nol-space-1);\n padding: 0 var(--nol-field-padding);\n border: var(--nol-border-width) solid var(--nol-accent);\n border-radius: var(--nol-radius-small);\n outline: none;\n background-color: var(--nol-input);\n color: var(--nol-text);\n font: inherit;\n}\n\n.filter::placeholder {\n color: var(--nol-placeholder);\n}\n\n.list {\n max-height: var(--nol-git-branch-list-height);\n overflow-y: auto;\n}\n\n.item {\n display: flex;\n gap: var(--nol-space-2);\n align-items: center;\n height: var(--nol-menu-item-height);\n padding: 0 var(--nol-menu-item-padding);\n border-radius: var(--nol-radius-small);\n white-space: nowrap;\n cursor: pointer;\n}\n\n.item:hover:not(.active) {\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.item.current,\n.item.active {\n --nol-text-muted: var(--nol-list-active-text);\n\n background-color: var(--nol-list-active);\n color: var(--nol-list-active-text);\n}\n\n.item.active {\n @media (forced-colors: active) {\n --nol-text: HighlightText;\n --nol-text-muted: HighlightText;\n --nol-menu-text: HighlightText;\n --nol-icon-color: HighlightText;\n --nol-list-active-text: HighlightText;\n\n background-color: Highlight;\n color: HighlightText;\n forced-color-adjust: none;\n }\n}\n\n.item .hidden {\n visibility: hidden;\n}\n\n.item .title {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.label {\n padding: var(--nol-menu-label-padding);\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n}\n\n.separator {\n height: var(--nol-border-width);\n margin: var(--nol-menu-separator-spacing) 0;\n background-color: var(--nol-menu-separator);\n}\n"] }]
128
+ }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ["trigger", { isSignal: true }] }], filter: [{ type: i0.ViewChild, args: ["filter", { isSignal: true }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: true }] }] } });
129
+ //# sourceMappingURL=git-branch-card.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-branch-card.component.js","sourceRoot":"","sources":["../../../../../../../../src/noldova.git.window/src/app/components/git-branch-card/git-branch-card.component.ts","../../../../../../../../src/noldova.git.window/src/app/components/git-branch-card/git-branch-card.component.html"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAoB,MAAM,EAAe,SAAS,EACzG,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;;;AAa/E,MAAM,OAAO,sBAAsB;IAChB,OAAO,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;IACtD,OAAO,GAA0C,SAAS,CAAC,QAAQ,CAAgC,SAAS;gFAAC,CAAC;IAC9G,MAAM,GAAqD,SAAS,CAA+B,QAA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,CAAC;IAES,IAAI;QACZ,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IACvC,CAAC;IAEO,KAAK;QACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;uGAzGU,sBAAsB;2FAAtB,sBAAsB,6jBC/BnC,uxIAmEA,+sID7CY,eAAe,mJAAE,WAAW,ysBAAE,gBAAgB;;2FAS7C,sBAAsB;kBAXlC,SAAS;+BACE,qBAAqB,WACtB,CAAC,eAAe,EAAE,WAAW,EAAE,gBAAgB,CAAC,QAGnD;wBACJ,wBAAwB,EAAE,sBAAsB;wBAChD,YAAY,EAAE,sBAAsB;wBACpC,kBAAkB,EAAE,gBAAgB;qBACrC;+FAImH,SAAS,gEACT,QAAQ"}
@@ -0,0 +1,43 @@
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, input } from "@angular/core";
9
+ import { FormsModule } from "@angular/forms";
10
+ import { ButtonComponent, TextFieldComponent } from "@noldova/ui.components.angular";
11
+ import { Resources } from "../../../resources.js";
12
+ import { GitViewStateService } from "../../services/git-view-state.service.js";
13
+ import * as i0 from "@angular/core";
14
+ import * as i1 from "@angular/forms";
15
+ export class GitCommitCardComponent {
16
+ resources = Resources;
17
+ state = inject(GitViewStateService);
18
+ placeholder = computed(() => this.status().operation?.message ?? Resources.messagePlaceholder, /* @ts-ignore */
19
+ ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
20
+ label = computed(() => this.status().operation !== null ? Resources.commitMergeLabel : this.state.staged() > 0 ? Resources.formatCommit(this.state.staged()) : Resources.commitLabel, /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
22
+ hint = computed(() => this.status().operation !== null && this.state.conflicts() > 0 ? Resources.formatConflictHint(this.state.conflicts()) : null, /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
24
+ message = computed(() => {
25
+ const typed = this.state.message().trim();
26
+ return typed.length > 0 ? typed : this.status().operation?.message ?? "";
27
+ }, /* @ts-ignore */
28
+ ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
29
+ canCommit = computed(() => !this.state.busy() && this.state.conflicts() === 0 && this.message().length > 0 && (this.state.staged() > 0 || this.status().operation !== null), /* @ts-ignore */
30
+ ...(ngDevMode ? [{ debugName: "canCommit" }] : /* istanbul ignore next */ []));
31
+ status = input.required(/* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
33
+ commit() {
34
+ void this.state.commitAsync(this.message());
35
+ }
36
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitCommitCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
37
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.6", type: GitCommitCardComponent, isStandalone: true, selector: "nol-git-commit-card", inputs: { status: { classPropertyName: "status", publicName: "status", 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<textarea nol-text-field class=\"field\" rows=\"3\" [attr.aria-label]=\"resources.messageLabel\" [placeholder]=\"placeholder()\" [ngModel]=\"state.message()\"\n (ngModelChange)=\"state.message.set($event)\"></textarea>\n<button nol-button type=\"button\" class=\"commit\" [disabled]=\"!canCommit()\" (click)=\"commit()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.commitIcon }}</span>{{ label() }}\n</button>\n@if (hint(); as hint) {\n <span class=\"hint\">{{ hint }}</span>\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-message-height: 4.25rem;\n\n display: grid;\n gap: var(--nol-space-2);\n min-width: 0;\n padding: var(--nol-space-2);\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.field {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--nol-git-message-height);\n}\n\n.commit {\n width: 100%;\n}\n\n.hint {\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[nol-button], a[nol-button]", inputs: ["variant", "overlay", "backdrop", "danger", "size", "busy"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextFieldComponent, selector: "input[nol-text-field], textarea[nol-text-field]" }] });
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: GitCommitCardComponent, decorators: [{
40
+ type: Component,
41
+ args: [{ selector: "nol-git-commit-card", imports: [ButtonComponent, FormsModule, TextFieldComponent], 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<textarea nol-text-field class=\"field\" rows=\"3\" [attr.aria-label]=\"resources.messageLabel\" [placeholder]=\"placeholder()\" [ngModel]=\"state.message()\"\n (ngModelChange)=\"state.message.set($event)\"></textarea>\n<button nol-button type=\"button\" class=\"commit\" [disabled]=\"!canCommit()\" (click)=\"commit()\">\n <span nolButtonIcon class=\"material-symbols-rounded\" aria-hidden=\"true\">{{ resources.commitIcon }}</span>{{ label() }}\n</button>\n@if (hint(); as hint) {\n <span class=\"hint\">{{ hint }}</span>\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-message-height: 4.25rem;\n\n display: grid;\n gap: var(--nol-space-2);\n min-width: 0;\n padding: var(--nol-space-2);\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.field {\n box-sizing: border-box;\n width: 100%;\n min-height: var(--nol-git-message-height);\n}\n\n.commit {\n width: 100%;\n}\n\n.hint {\n color: var(--nol-text-muted);\n font-size: var(--nol-text-label);\n}\n"] }]
42
+ }], propDecorators: { status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: true }] }] } });
43
+ //# sourceMappingURL=git-commit-card.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-commit-card.component.js","sourceRoot":"","sources":["../../../../../../../../src/noldova.git.window/src/app/components/git-commit-card/git-commit-card.component.ts","../../../../../../../../src/noldova.git.window/src/app/components/git-commit-card/git-commit-card.component.html"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAiC,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MA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