angular-grab-monorepo 0.1.3
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.
- package/.claude/settings.local.json +10 -0
- package/.playwright-mcp/console-2026-03-07T02-49-38-061Z.log +37 -0
- package/.playwright-mcp/console-2026-03-07T02-51-03-493Z.log +26 -0
- package/.playwright-mcp/console-2026-03-07T02-51-25-431Z.log +15 -0
- package/.playwright-mcp/console-2026-03-07T02-52-02-980Z.log +91 -0
- package/.playwright-mcp/page-2026-03-07T02-52-09-791Z.png +0 -0
- package/LICENSE +21 -0
- package/README.md +215 -0
- package/examples/angular-19-app/.editorconfig +17 -0
- package/examples/angular-19-app/.vscode/extensions.json +4 -0
- package/examples/angular-19-app/.vscode/launch.json +20 -0
- package/examples/angular-19-app/.vscode/mcp.json +9 -0
- package/examples/angular-19-app/.vscode/tasks.json +42 -0
- package/examples/angular-19-app/README.md +59 -0
- package/examples/angular-19-app/angular.json +79 -0
- package/examples/angular-19-app/package.json +42 -0
- package/examples/angular-19-app/public/favicon.ico +0 -0
- package/examples/angular-19-app/src/app/app.config.ts +13 -0
- package/examples/angular-19-app/src/app/app.css +37 -0
- package/examples/angular-19-app/src/app/app.html +25 -0
- package/examples/angular-19-app/src/app/app.routes.ts +3 -0
- package/examples/angular-19-app/src/app/app.spec.ts +23 -0
- package/examples/angular-19-app/src/app/app.ts +12 -0
- package/examples/angular-19-app/src/app/button/button.component.ts +25 -0
- package/examples/angular-19-app/src/app/card/card.component.ts +33 -0
- package/examples/angular-19-app/src/app/header/header.component.ts +31 -0
- package/examples/angular-19-app/src/app/popover/popover.component.ts +133 -0
- package/examples/angular-19-app/src/index.html +13 -0
- package/examples/angular-19-app/src/main.ts +6 -0
- package/examples/angular-19-app/src/styles.css +1 -0
- package/examples/angular-19-app/tsconfig.app.json +15 -0
- package/examples/angular-19-app/tsconfig.json +33 -0
- package/examples/angular-19-app/tsconfig.spec.json +15 -0
- package/package.json +22 -0
- package/packages/angular-grab/builders.json +14 -0
- package/packages/angular-grab/package.json +96 -0
- package/packages/angular-grab/src/angular/__tests__/context-builder.test.ts +216 -0
- package/packages/angular-grab/src/angular/angular-grab.service.ts +62 -0
- package/packages/angular-grab/src/angular/index.ts +13 -0
- package/packages/angular-grab/src/angular/provide-angular-grab.ts +22 -0
- package/packages/angular-grab/src/angular/resolvers/component-resolver.ts +71 -0
- package/packages/angular-grab/src/angular/resolvers/context-builder.ts +86 -0
- package/packages/angular-grab/src/angular/resolvers/ng-utils.ts +14 -0
- package/packages/angular-grab/src/angular/resolvers/source-resolver.ts +61 -0
- package/packages/angular-grab/src/builder/__tests__/builder.test.ts +72 -0
- package/packages/angular-grab/src/builder/builders/application/index.ts +13 -0
- package/packages/angular-grab/src/builder/builders/application/schema.json +7 -0
- package/packages/angular-grab/src/builder/builders/dev-server/index.ts +9 -0
- package/packages/angular-grab/src/builder/builders/dev-server/schema.json +7 -0
- package/packages/angular-grab/src/builder/index.ts +3 -0
- package/packages/angular-grab/src/cli/__tests__/cli.test.ts +239 -0
- package/packages/angular-grab/src/cli/commands/init.ts +106 -0
- package/packages/angular-grab/src/cli/index.ts +15 -0
- package/packages/angular-grab/src/cli/utils/detect-project.ts +78 -0
- package/packages/angular-grab/src/cli/utils/modify-angular-json.ts +42 -0
- package/packages/angular-grab/src/cli/utils/modify-app-config.ts +42 -0
- package/packages/angular-grab/src/core/__tests__/generate-snippet.test.ts +149 -0
- package/packages/angular-grab/src/core/__tests__/plugin-registry.test.ts +286 -0
- package/packages/angular-grab/src/core/__tests__/store.test.ts +118 -0
- package/packages/angular-grab/src/core/__tests__/utils.test.ts +85 -0
- package/packages/angular-grab/src/core/clipboard/copy.ts +104 -0
- package/packages/angular-grab/src/core/clipboard/generate-snippet.ts +38 -0
- package/packages/angular-grab/src/core/constants.ts +10 -0
- package/packages/angular-grab/src/core/grab.ts +596 -0
- package/packages/angular-grab/src/core/index.global.ts +13 -0
- package/packages/angular-grab/src/core/index.ts +19 -0
- package/packages/angular-grab/src/core/keyboard/keyboard-handler.ts +163 -0
- package/packages/angular-grab/src/core/overlay/crosshair.ts +107 -0
- package/packages/angular-grab/src/core/overlay/freeze-overlay.ts +239 -0
- package/packages/angular-grab/src/core/overlay/overlay-renderer.ts +180 -0
- package/packages/angular-grab/src/core/overlay/select-feedback.ts +108 -0
- package/packages/angular-grab/src/core/overlay/toast.ts +175 -0
- package/packages/angular-grab/src/core/picker/element-picker.ts +114 -0
- package/packages/angular-grab/src/core/plugins/plugin-registry.ts +83 -0
- package/packages/angular-grab/src/core/store.ts +52 -0
- package/packages/angular-grab/src/core/toolbar/actions-menu.ts +178 -0
- package/packages/angular-grab/src/core/toolbar/comment-popover.ts +235 -0
- package/packages/angular-grab/src/core/toolbar/copy-actions.ts +98 -0
- package/packages/angular-grab/src/core/toolbar/history-popover.ts +245 -0
- package/packages/angular-grab/src/core/toolbar/theme-manager.ts +188 -0
- package/packages/angular-grab/src/core/toolbar/toolbar-icons.ts +29 -0
- package/packages/angular-grab/src/core/toolbar/toolbar-renderer.ts +239 -0
- package/packages/angular-grab/src/core/types.ts +139 -0
- package/packages/angular-grab/src/core/utils.ts +16 -0
- package/packages/angular-grab/src/esbuild-plugin/__tests__/transform.test.ts +174 -0
- package/packages/angular-grab/src/esbuild-plugin/index.ts +3 -0
- package/packages/angular-grab/src/esbuild-plugin/plugin.ts +29 -0
- package/packages/angular-grab/src/esbuild-plugin/scan.ts +105 -0
- package/packages/angular-grab/src/esbuild-plugin/transform.ts +152 -0
- package/packages/angular-grab/src/vite-plugin/__tests__/plugin.test.ts +84 -0
- package/packages/angular-grab/src/vite-plugin/index.ts +19 -0
- package/packages/angular-grab/src/webpack-plugin/__tests__/plugin.test.ts +72 -0
- package/packages/angular-grab/src/webpack-plugin/index.ts +2 -0
- package/packages/angular-grab/src/webpack-plugin/loader.ts +15 -0
- package/packages/angular-grab/src/webpack-plugin/plugin.ts +20 -0
- package/packages/angular-grab/tsconfig.json +15 -0
- package/packages/angular-grab/tsup.config.ts +119 -0
- package/pnpm-workspace.yaml +3 -0
- package/turbo.json +21 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"cli": {
|
|
5
|
+
"packageManager": "npm",
|
|
6
|
+
"analytics": false
|
|
7
|
+
},
|
|
8
|
+
"newProjectRoot": "projects",
|
|
9
|
+
"projects": {
|
|
10
|
+
"angular-19-app": {
|
|
11
|
+
"projectType": "application",
|
|
12
|
+
"schematics": {},
|
|
13
|
+
"root": "",
|
|
14
|
+
"sourceRoot": "src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular/build:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"outputPath": "dist/angular-19-app",
|
|
21
|
+
"index": "src/index.html",
|
|
22
|
+
"browser": "src/main.ts",
|
|
23
|
+
"tsConfig": "tsconfig.app.json",
|
|
24
|
+
"assets": [
|
|
25
|
+
{
|
|
26
|
+
"glob": "**/*",
|
|
27
|
+
"input": "public"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"polyfills": [
|
|
31
|
+
"zone.js"
|
|
32
|
+
],
|
|
33
|
+
"styles": [
|
|
34
|
+
"src/styles.css"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"configurations": {
|
|
38
|
+
"production": {
|
|
39
|
+
"budgets": [
|
|
40
|
+
{
|
|
41
|
+
"type": "initial",
|
|
42
|
+
"maximumWarning": "500kB",
|
|
43
|
+
"maximumError": "1MB"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "anyComponentStyle",
|
|
47
|
+
"maximumWarning": "4kB",
|
|
48
|
+
"maximumError": "8kB"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"outputHashing": "all"
|
|
52
|
+
},
|
|
53
|
+
"development": {
|
|
54
|
+
"optimization": false,
|
|
55
|
+
"extractLicenses": false,
|
|
56
|
+
"sourceMap": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"defaultConfiguration": "production"
|
|
60
|
+
},
|
|
61
|
+
"serve": {
|
|
62
|
+
"builder": "@angular/build:dev-server",
|
|
63
|
+
"configurations": {
|
|
64
|
+
"production": {
|
|
65
|
+
"buildTarget": "angular-19-app:build:production"
|
|
66
|
+
},
|
|
67
|
+
"development": {
|
|
68
|
+
"buildTarget": "angular-19-app:build:development"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"defaultConfiguration": "development"
|
|
72
|
+
},
|
|
73
|
+
"test": {
|
|
74
|
+
"builder": "@angular/build:unit-test"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "angular-19-app",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "ng serve",
|
|
7
|
+
"build": "ng build",
|
|
8
|
+
"watch": "ng build --watch --configuration development",
|
|
9
|
+
"test": "ng test"
|
|
10
|
+
},
|
|
11
|
+
"prettier": {
|
|
12
|
+
"printWidth": 100,
|
|
13
|
+
"singleQuote": true,
|
|
14
|
+
"overrides": [
|
|
15
|
+
{
|
|
16
|
+
"files": "*.html",
|
|
17
|
+
"options": {
|
|
18
|
+
"parser": "angular"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"private": true,
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@angular/common": "^19.0.0",
|
|
26
|
+
"@angular/compiler": "^19.0.0",
|
|
27
|
+
"@angular/core": "^19.0.0",
|
|
28
|
+
"@angular/forms": "^19.0.0",
|
|
29
|
+
"@angular/platform-browser": "^19.0.0",
|
|
30
|
+
"@angular/router": "^19.0.0",
|
|
31
|
+
"angular-grab": "^0.1.3",
|
|
32
|
+
"rxjs": "~7.8.0",
|
|
33
|
+
"tslib": "^2.3.0",
|
|
34
|
+
"zone.js": "~0.15.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@angular/build": "^19.0.0",
|
|
38
|
+
"@angular/cli": "^19.0.0",
|
|
39
|
+
"@angular/compiler-cli": "^19.0.0",
|
|
40
|
+
"typescript": "~5.6.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
|
2
|
+
import { provideRouter } from '@angular/router';
|
|
3
|
+
import { provideAngularGrab } from 'angular-grab/angular';
|
|
4
|
+
|
|
5
|
+
import { routes } from './app.routes';
|
|
6
|
+
|
|
7
|
+
export const appConfig: ApplicationConfig = {
|
|
8
|
+
providers: [
|
|
9
|
+
provideZoneChangeDetection({ eventCoalescing: true }),
|
|
10
|
+
provideRouter(routes),
|
|
11
|
+
provideAngularGrab(),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.main {
|
|
2
|
+
max-width: 960px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 32px 24px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.hero {
|
|
8
|
+
text-align: center;
|
|
9
|
+
margin-bottom: 40px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.hero h1 {
|
|
13
|
+
font-size: 2rem;
|
|
14
|
+
font-weight: 700;
|
|
15
|
+
margin: 0 0 12px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.hero p {
|
|
19
|
+
color: #64748b;
|
|
20
|
+
font-size: 1.1rem;
|
|
21
|
+
line-height: 1.6;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.hero kbd {
|
|
25
|
+
background: #f1f5f9;
|
|
26
|
+
border: 1px solid #e2e8f0;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
padding: 2px 6px;
|
|
29
|
+
font-family: monospace;
|
|
30
|
+
font-size: 0.9rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cards {
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
36
|
+
gap: 20px;
|
|
37
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<app-header />
|
|
2
|
+
|
|
3
|
+
<main class="main">
|
|
4
|
+
<section class="hero">
|
|
5
|
+
<h1>angular-grab Demo</h1>
|
|
6
|
+
<p>Hold <kbd>⌘C</kbd> (Mac) or <kbd>Ctrl+C</kbd> (Windows) and hover over any element to grab its context for AI coding agents.</p>
|
|
7
|
+
</section>
|
|
8
|
+
|
|
9
|
+
<section class="cards">
|
|
10
|
+
<app-card
|
|
11
|
+
title="Element Picker"
|
|
12
|
+
body="Hover over any UI element while holding the activation key. A blue overlay highlights the element under your cursor."
|
|
13
|
+
/>
|
|
14
|
+
<app-card
|
|
15
|
+
title="Component Resolution"
|
|
16
|
+
body="angular-grab uses Angular's debug APIs to identify which component owns each element, including the component class name."
|
|
17
|
+
/>
|
|
18
|
+
<app-card
|
|
19
|
+
title="Source Mapping"
|
|
20
|
+
body="The esbuild plugin injects data-ng-source attributes at build time, mapping each component to its source file and line number."
|
|
21
|
+
/>
|
|
22
|
+
</section>
|
|
23
|
+
|
|
24
|
+
<app-popover />
|
|
25
|
+
</main>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
import { App } from './app';
|
|
3
|
+
|
|
4
|
+
describe('App', () => {
|
|
5
|
+
beforeEach(async () => {
|
|
6
|
+
await TestBed.configureTestingModule({
|
|
7
|
+
imports: [App],
|
|
8
|
+
}).compileComponents();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should create the app', () => {
|
|
12
|
+
const fixture = TestBed.createComponent(App);
|
|
13
|
+
const app = fixture.componentInstance;
|
|
14
|
+
expect(app).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should render title', async () => {
|
|
18
|
+
const fixture = TestBed.createComponent(App);
|
|
19
|
+
await fixture.whenStable();
|
|
20
|
+
const compiled = fixture.nativeElement as HTMLElement;
|
|
21
|
+
expect(compiled.querySelector('h1')?.textContent).toContain('angular-grab Demo');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { HeaderComponent } from './header/header.component';
|
|
3
|
+
import { CardComponent } from './card/card.component';
|
|
4
|
+
import { PopoverComponent } from './popover/popover.component';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-root',
|
|
8
|
+
imports: [HeaderComponent, CardComponent, PopoverComponent],
|
|
9
|
+
templateUrl: './app.html',
|
|
10
|
+
styleUrl: './app.css',
|
|
11
|
+
})
|
|
12
|
+
export class App {}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-button',
|
|
5
|
+
standalone: true,
|
|
6
|
+
template: `
|
|
7
|
+
<button class="btn" type="button">{{ label }}</button>
|
|
8
|
+
`,
|
|
9
|
+
styles: [`
|
|
10
|
+
.btn {
|
|
11
|
+
padding: 8px 16px;
|
|
12
|
+
background: #3b82f6;
|
|
13
|
+
color: white;
|
|
14
|
+
border: none;
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
font-size: 0.875rem;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition: background 0.15s;
|
|
19
|
+
}
|
|
20
|
+
.btn:hover { background: #2563eb; }
|
|
21
|
+
`],
|
|
22
|
+
})
|
|
23
|
+
export class ButtonComponent {
|
|
24
|
+
@Input() label = 'Click me';
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { ButtonComponent } from '../button/button.component';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-card',
|
|
6
|
+
standalone: true,
|
|
7
|
+
template: `
|
|
8
|
+
<div class="card">
|
|
9
|
+
<h2 class="card-title">{{ title }}</h2>
|
|
10
|
+
<p class="card-body">{{ body }}</p>
|
|
11
|
+
<div class="card-footer">
|
|
12
|
+
<app-button [label]="'Learn More'" />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
16
|
+
styles: [`
|
|
17
|
+
.card {
|
|
18
|
+
border: 1px solid #e2e8f0;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
padding: 20px;
|
|
21
|
+
background: white;
|
|
22
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
23
|
+
}
|
|
24
|
+
.card-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }
|
|
25
|
+
.card-body { color: #64748b; margin: 0 0 16px; line-height: 1.5; }
|
|
26
|
+
.card-footer { display: flex; justify-content: flex-end; }
|
|
27
|
+
`],
|
|
28
|
+
imports: [ButtonComponent],
|
|
29
|
+
})
|
|
30
|
+
export class CardComponent {
|
|
31
|
+
@Input() title = '';
|
|
32
|
+
@Input() body = '';
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-header',
|
|
5
|
+
standalone: true,
|
|
6
|
+
template: `
|
|
7
|
+
<header class="header">
|
|
8
|
+
<h1 class="header-title">angular-grab Demo</h1>
|
|
9
|
+
<nav class="header-nav">
|
|
10
|
+
<a href="#" class="nav-link">Home</a>
|
|
11
|
+
<a href="#" class="nav-link">About</a>
|
|
12
|
+
<a href="#" class="nav-link">Contact</a>
|
|
13
|
+
</nav>
|
|
14
|
+
</header>
|
|
15
|
+
`,
|
|
16
|
+
styles: [`
|
|
17
|
+
.header {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
padding: 16px 24px;
|
|
22
|
+
background: #1e293b;
|
|
23
|
+
color: white;
|
|
24
|
+
}
|
|
25
|
+
.header-title { font-size: 1.25rem; font-weight: 600; margin: 0; }
|
|
26
|
+
.header-nav { display: flex; gap: 16px; }
|
|
27
|
+
.nav-link { color: #94a3b8; text-decoration: none; }
|
|
28
|
+
.nav-link:hover { color: white; }
|
|
29
|
+
`],
|
|
30
|
+
})
|
|
31
|
+
export class HeaderComponent {}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-popover',
|
|
5
|
+
standalone: true,
|
|
6
|
+
template: `
|
|
7
|
+
<div class="popover-demo">
|
|
8
|
+
<h3 class="popover-heading">Freeze Mode Test</h3>
|
|
9
|
+
<p class="popover-desc">These elements disappear on mouse-out. Use freeze mode (<kbd>F</kbd>) to grab them.</p>
|
|
10
|
+
|
|
11
|
+
<div class="popover-row">
|
|
12
|
+
<div class="popover-trigger">
|
|
13
|
+
Hover for tooltip
|
|
14
|
+
<div class="popover-tooltip tooltip-style">
|
|
15
|
+
<strong>Tooltip content</strong>
|
|
16
|
+
<p>This disappears when you move your mouse away. Freeze the page first!</p>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="dropdown-trigger">
|
|
21
|
+
Hover for dropdown ▾
|
|
22
|
+
<ul class="dropdown-menu dropdown-style">
|
|
23
|
+
<li class="dropdown-item">Dashboard</li>
|
|
24
|
+
<li class="dropdown-item">Settings</li>
|
|
25
|
+
<li class="dropdown-item">Profile</li>
|
|
26
|
+
<li class="dropdown-item highlighted">Sign out</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
styles: [`
|
|
33
|
+
.popover-demo {
|
|
34
|
+
margin-top: 40px;
|
|
35
|
+
padding: 24px;
|
|
36
|
+
border: 1px dashed #cbd5e1;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
background: #f8fafc;
|
|
39
|
+
}
|
|
40
|
+
.popover-heading { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }
|
|
41
|
+
.popover-desc { color: #64748b; margin: 0 0 20px; line-height: 1.5; }
|
|
42
|
+
.popover-desc kbd {
|
|
43
|
+
background: #f1f5f9;
|
|
44
|
+
border: 1px solid #e2e8f0;
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
padding: 2px 6px;
|
|
47
|
+
font-family: monospace;
|
|
48
|
+
font-size: 0.9rem;
|
|
49
|
+
}
|
|
50
|
+
.popover-row {
|
|
51
|
+
display: flex;
|
|
52
|
+
gap: 24px;
|
|
53
|
+
flex-wrap: wrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Tooltip */
|
|
57
|
+
.popover-trigger {
|
|
58
|
+
position: relative;
|
|
59
|
+
padding: 10px 16px;
|
|
60
|
+
background: #3b82f6;
|
|
61
|
+
color: white;
|
|
62
|
+
border-radius: 6px;
|
|
63
|
+
cursor: default;
|
|
64
|
+
font-size: 0.875rem;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
}
|
|
67
|
+
.popover-tooltip {
|
|
68
|
+
display: none;
|
|
69
|
+
position: absolute;
|
|
70
|
+
bottom: calc(100% + 8px);
|
|
71
|
+
left: 50%;
|
|
72
|
+
transform: translateX(-50%);
|
|
73
|
+
background: #1e293b;
|
|
74
|
+
color: #e2e8f0;
|
|
75
|
+
padding: 12px 16px;
|
|
76
|
+
border-radius: 8px;
|
|
77
|
+
width: 220px;
|
|
78
|
+
font-size: 0.8rem;
|
|
79
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
|
80
|
+
z-index: 10;
|
|
81
|
+
}
|
|
82
|
+
.popover-tooltip strong { color: white; }
|
|
83
|
+
.popover-tooltip p { margin: 6px 0 0; line-height: 1.4; }
|
|
84
|
+
.popover-tooltip::after {
|
|
85
|
+
content: '';
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 100%;
|
|
88
|
+
left: 50%;
|
|
89
|
+
transform: translateX(-50%);
|
|
90
|
+
border: 6px solid transparent;
|
|
91
|
+
border-top-color: #1e293b;
|
|
92
|
+
}
|
|
93
|
+
.popover-trigger:hover .popover-tooltip { display: block; }
|
|
94
|
+
|
|
95
|
+
/* Dropdown */
|
|
96
|
+
.dropdown-trigger {
|
|
97
|
+
position: relative;
|
|
98
|
+
padding: 10px 16px;
|
|
99
|
+
background: white;
|
|
100
|
+
border: 1px solid #e2e8f0;
|
|
101
|
+
border-radius: 6px;
|
|
102
|
+
cursor: default;
|
|
103
|
+
font-size: 0.875rem;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
color: #334155;
|
|
106
|
+
}
|
|
107
|
+
.dropdown-menu {
|
|
108
|
+
display: none;
|
|
109
|
+
position: absolute;
|
|
110
|
+
top: calc(100% + 4px);
|
|
111
|
+
left: 0;
|
|
112
|
+
background: white;
|
|
113
|
+
border: 1px solid #e2e8f0;
|
|
114
|
+
border-radius: 8px;
|
|
115
|
+
list-style: none;
|
|
116
|
+
margin: 0;
|
|
117
|
+
padding: 4px 0;
|
|
118
|
+
min-width: 160px;
|
|
119
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
120
|
+
z-index: 10;
|
|
121
|
+
}
|
|
122
|
+
.dropdown-item {
|
|
123
|
+
padding: 8px 14px;
|
|
124
|
+
font-size: 0.85rem;
|
|
125
|
+
color: #334155;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
.dropdown-item:hover { background: #f1f5f9; }
|
|
129
|
+
.dropdown-item.highlighted { color: #ef4444; }
|
|
130
|
+
.dropdown-trigger:hover .dropdown-menu { display: block; }
|
|
131
|
+
`],
|
|
132
|
+
})
|
|
133
|
+
export class PopoverComponent {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>Angular19App</title>
|
|
6
|
+
<base href="/">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<app-root></app-root>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "./out-tsc/app",
|
|
7
|
+
"types": []
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"src/**/*.ts"
|
|
11
|
+
],
|
|
12
|
+
"exclude": [
|
|
13
|
+
"src/**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"compileOnSave": false,
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noImplicitOverride": true,
|
|
8
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
+
"noImplicitReturns": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"experimentalDecorators": true,
|
|
14
|
+
"importHelpers": true,
|
|
15
|
+
"target": "ES2022",
|
|
16
|
+
"module": "preserve"
|
|
17
|
+
},
|
|
18
|
+
"angularCompilerOptions": {
|
|
19
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
20
|
+
"strictInjectionParameters": true,
|
|
21
|
+
"strictInputAccessModifiers": true,
|
|
22
|
+
"strictTemplates": true
|
|
23
|
+
},
|
|
24
|
+
"files": [],
|
|
25
|
+
"references": [
|
|
26
|
+
{
|
|
27
|
+
"path": "./tsconfig.app.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "./tsconfig.spec.json"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"extends": "./tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "./out-tsc/spec",
|
|
7
|
+
"types": [
|
|
8
|
+
"vitest/globals"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.d.ts",
|
|
13
|
+
"src/**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "angular-grab-monorepo",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Grab any element in your Angular app and give it to AI coding agents",
|
|
5
|
+
"author": "Nate Richardson <hello@naterichardson.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18"
|
|
9
|
+
},
|
|
10
|
+
"packageManager": "pnpm@9.15.0",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "turbo run build",
|
|
13
|
+
"dev": "turbo run dev",
|
|
14
|
+
"test": "turbo run test",
|
|
15
|
+
"lint": "turbo run lint",
|
|
16
|
+
"clean": "turbo run clean"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^25.3.4",
|
|
20
|
+
"turbo": "^2.8.13"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"builders": {
|
|
3
|
+
"application": {
|
|
4
|
+
"implementation": "./dist/builder/builders/application/index",
|
|
5
|
+
"schema": "./dist/builder/builders/application/schema.json",
|
|
6
|
+
"description": "Build an Angular application with angular-grab source injection"
|
|
7
|
+
},
|
|
8
|
+
"dev-server": {
|
|
9
|
+
"implementation": "./dist/builder/builders/dev-server/index",
|
|
10
|
+
"schema": "./dist/builder/builders/dev-server/schema.json",
|
|
11
|
+
"description": "Serve an Angular application with angular-grab source injection"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|