@githumbi/grabby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +22 -0
- package/README.md +262 -0
- package/builders.json +14 -0
- package/dist/angular/index.d.ts +279 -0
- package/dist/angular/index.js +5145 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/babel-plugin/index.cjs +95 -0
- package/dist/babel-plugin/index.cjs.map +1 -0
- package/dist/babel-plugin/index.d.cts +28 -0
- package/dist/babel-plugin/index.d.ts +28 -0
- package/dist/babel-plugin/index.js +60 -0
- package/dist/babel-plugin/index.js.map +1 -0
- package/dist/builder/builders/application/index.js +141 -0
- package/dist/builder/builders/application/index.js.map +1 -0
- package/dist/builder/builders/application/schema.json +7 -0
- package/dist/builder/builders/dev-server/index.js +137 -0
- package/dist/builder/builders/dev-server/index.js.map +1 -0
- package/dist/builder/builders/dev-server/schema.json +26 -0
- package/dist/builder/index.js +2 -0
- package/dist/builder/index.js.map +1 -0
- package/dist/builder/package.json +1 -0
- package/dist/chunk-6CBIOKZV.cjs +45 -0
- package/dist/chunk-6CBIOKZV.cjs.map +1 -0
- package/dist/chunk-M3DOFJA7.js +45 -0
- package/dist/chunk-M3DOFJA7.js.map +1 -0
- package/dist/cli/index.js +406 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/index.cjs +5081 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +96 -0
- package/dist/core/index.d.ts +96 -0
- package/dist/core/index.js +5081 -0
- package/dist/core/index.js.map +1 -0
- package/dist/esbuild-plugin/index.cjs +134 -0
- package/dist/esbuild-plugin/index.cjs.map +1 -0
- package/dist/esbuild-plugin/index.d.cts +21 -0
- package/dist/esbuild-plugin/index.d.ts +21 -0
- package/dist/esbuild-plugin/index.js +96 -0
- package/dist/esbuild-plugin/index.js.map +1 -0
- package/dist/export/index.cjs +166 -0
- package/dist/export/index.cjs.map +1 -0
- package/dist/export/index.d.cts +86 -0
- package/dist/export/index.d.ts +86 -0
- package/dist/export/index.js +137 -0
- package/dist/export/index.js.map +1 -0
- package/dist/grabby.global.js +635 -0
- package/dist/live/index.cjs +30 -0
- package/dist/live/index.cjs.map +1 -0
- package/dist/live/index.d.cts +20 -0
- package/dist/live/index.d.ts +20 -0
- package/dist/live/index.js +30 -0
- package/dist/live/index.js.map +1 -0
- package/dist/loader.global.js +1 -0
- package/dist/plugin/index.cjs +229 -0
- package/dist/plugin/index.cjs.map +1 -0
- package/dist/plugin/index.d.cts +76 -0
- package/dist/plugin/index.d.ts +76 -0
- package/dist/plugin/index.js +186 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/react/index.d.ts +290 -0
- package/dist/react/index.js +5110 -0
- package/dist/react/index.js.map +1 -0
- package/dist/types-CMgpkvBz.d.cts +265 -0
- package/dist/types-CMgpkvBz.d.ts +265 -0
- package/package.json +191 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { G as GrabbyAPI, a as GrabbyOptions, F as FrameworkAdapter, C as ComponentResolver, S as SourceResolver, b as GrabbyComment, D as DetailLevel, c as GrabbyTarget } from '../types-CMgpkvBz.cjs';
|
|
2
|
+
export { d as CommentAuthor, e as ComponentStackEntry, E as ElementContext, P as PageInfo, f as Plugin, g as PluginCleanup, h as PluginHooks, i as ScreenshotRef, j as SourceLocation, k as StackFrame, T as TargetKind, l as Theme, m as ThemeMode, n as ToolbarState } from '../types-CMgpkvBz.cjs';
|
|
3
|
+
|
|
4
|
+
declare function init(options?: Partial<GrabbyOptions>): GrabbyAPI;
|
|
5
|
+
/**
|
|
6
|
+
* Best guess at whether the host app is a development build. Both checks are
|
|
7
|
+
* written as bare identifiers on purpose: bundlers replace `ngDevMode` and
|
|
8
|
+
* `process.env.NODE_ENV` with literals at build time, including inside
|
|
9
|
+
* dependencies, and a property read off globalThis would never be replaced.
|
|
10
|
+
*/
|
|
11
|
+
declare function isDevMode(): boolean;
|
|
12
|
+
/** No-op API returned when devOnly is true and the app is in production. */
|
|
13
|
+
declare function createNoopApi(): GrabbyAPI;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Names come from Angular's dev-mode `ng` debug API; locations from the
|
|
17
|
+
* component source map the Grabby builders inject at build time.
|
|
18
|
+
*/
|
|
19
|
+
declare const angularAdapter: FrameworkAdapter;
|
|
20
|
+
|
|
21
|
+
/** Names come from the React fiber; locations come from build-time stamps. */
|
|
22
|
+
declare const reactAdapter: FrameworkAdapter;
|
|
23
|
+
|
|
24
|
+
declare const vueAdapter: FrameworkAdapter;
|
|
25
|
+
|
|
26
|
+
declare const svelteAdapter: FrameworkAdapter;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Plain HTML, or any stack Grabby has no adapter for: a `data-component`
|
|
30
|
+
* attribute names the component that owns an element.
|
|
31
|
+
*/
|
|
32
|
+
declare const domAdapter: FrameworkAdapter;
|
|
33
|
+
|
|
34
|
+
declare const SOURCE_ATTRIBUTE = "data-grabby-loc";
|
|
35
|
+
|
|
36
|
+
/** Every built-in adapter, most specific first; the DOM adapter is the fallback. */
|
|
37
|
+
declare const DEFAULT_ADAPTERS: readonly FrameworkAdapter[];
|
|
38
|
+
interface ComposedAdapters {
|
|
39
|
+
resolveComponent: ComponentResolver;
|
|
40
|
+
resolveSource: SourceResolver;
|
|
41
|
+
/** Name of the framework that rendered this element, or "HTML". */
|
|
42
|
+
frameworkFor(el: Element): string;
|
|
43
|
+
cleanClasses(classes: string[]): string[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Tries adapters per element rather than picking one per page, so it copes
|
|
47
|
+
* with an app that mounts late, and with micro-frontends mixing frameworks.
|
|
48
|
+
*/
|
|
49
|
+
declare function composeAdapters(adapters?: readonly FrameworkAdapter[]): ComposedAdapters;
|
|
50
|
+
|
|
51
|
+
declare function filterAngularClasses(classList: DOMTokenList): string[];
|
|
52
|
+
|
|
53
|
+
interface ExportEnv {
|
|
54
|
+
/** Page origin shown in the header, e.g. "localhost:4200". */
|
|
55
|
+
origin?: string;
|
|
56
|
+
now?: Date;
|
|
57
|
+
/** Print each comment's id, so an agent can act on it (e.g. resolve it). */
|
|
58
|
+
showIds?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Rough token count (≈4 characters per token), for the Copy dialog. */
|
|
61
|
+
declare function estimateTokens(text: string): number;
|
|
62
|
+
/**
|
|
63
|
+
* Turns comments into text for an AI agent. Page-level context is said once
|
|
64
|
+
* in the header, comments are grouped by the file they point at, and only the
|
|
65
|
+
* facts that matter for each element's kind are included.
|
|
66
|
+
*/
|
|
67
|
+
declare function formatExport(comments: GrabbyComment[], level?: DetailLevel, env?: ExportEnv): string;
|
|
68
|
+
|
|
69
|
+
interface CaptureDeps {
|
|
70
|
+
componentResolver: ComponentResolver | null;
|
|
71
|
+
sourceResolver: SourceResolver | null;
|
|
72
|
+
/** Framework-specific class filter; the default drops Angular/Svelte scoping classes. */
|
|
73
|
+
cleanClasses?: (classes: string[]) => string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Builds the compact description of an element that a comment carries:
|
|
77
|
+
* where it lives in the code, what kind of UI it is, and only the facts that
|
|
78
|
+
* matter for that kind. Replaces capturing the element's full outerHTML.
|
|
79
|
+
*/
|
|
80
|
+
declare function captureTarget(el: Element, deps: CaptureDeps): GrabbyTarget;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Scrubs things that look like secrets or personal data out of captured text
|
|
84
|
+
* before it's stored, copied or sent. It's a safety net for page content that
|
|
85
|
+
* ends up in labels and previews; form values are never captured at all.
|
|
86
|
+
*/
|
|
87
|
+
interface RedactOptions {
|
|
88
|
+
/**
|
|
89
|
+
* Keep email addresses. Only for developer-written strings such as
|
|
90
|
+
* placeholders ("you@company.com"), never for page content.
|
|
91
|
+
*/
|
|
92
|
+
keepEmails?: boolean;
|
|
93
|
+
}
|
|
94
|
+
declare function redact(text: string, options?: RedactOptions): string;
|
|
95
|
+
|
|
96
|
+
export { ComponentResolver, DEFAULT_ADAPTERS, DetailLevel, FrameworkAdapter, GrabbyAPI, GrabbyComment, GrabbyOptions, GrabbyTarget, SOURCE_ATTRIBUTE, SourceResolver, angularAdapter, captureTarget, composeAdapters, createNoopApi, domAdapter, estimateTokens, filterAngularClasses, formatExport, init, init as initGrabby, isDevMode, reactAdapter, redact, svelteAdapter, vueAdapter };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { G as GrabbyAPI, a as GrabbyOptions, F as FrameworkAdapter, C as ComponentResolver, S as SourceResolver, b as GrabbyComment, D as DetailLevel, c as GrabbyTarget } from '../types-CMgpkvBz.js';
|
|
2
|
+
export { d as CommentAuthor, e as ComponentStackEntry, E as ElementContext, P as PageInfo, f as Plugin, g as PluginCleanup, h as PluginHooks, i as ScreenshotRef, j as SourceLocation, k as StackFrame, T as TargetKind, l as Theme, m as ThemeMode, n as ToolbarState } from '../types-CMgpkvBz.js';
|
|
3
|
+
|
|
4
|
+
declare function init(options?: Partial<GrabbyOptions>): GrabbyAPI;
|
|
5
|
+
/**
|
|
6
|
+
* Best guess at whether the host app is a development build. Both checks are
|
|
7
|
+
* written as bare identifiers on purpose: bundlers replace `ngDevMode` and
|
|
8
|
+
* `process.env.NODE_ENV` with literals at build time, including inside
|
|
9
|
+
* dependencies, and a property read off globalThis would never be replaced.
|
|
10
|
+
*/
|
|
11
|
+
declare function isDevMode(): boolean;
|
|
12
|
+
/** No-op API returned when devOnly is true and the app is in production. */
|
|
13
|
+
declare function createNoopApi(): GrabbyAPI;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Names come from Angular's dev-mode `ng` debug API; locations from the
|
|
17
|
+
* component source map the Grabby builders inject at build time.
|
|
18
|
+
*/
|
|
19
|
+
declare const angularAdapter: FrameworkAdapter;
|
|
20
|
+
|
|
21
|
+
/** Names come from the React fiber; locations come from build-time stamps. */
|
|
22
|
+
declare const reactAdapter: FrameworkAdapter;
|
|
23
|
+
|
|
24
|
+
declare const vueAdapter: FrameworkAdapter;
|
|
25
|
+
|
|
26
|
+
declare const svelteAdapter: FrameworkAdapter;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Plain HTML, or any stack Grabby has no adapter for: a `data-component`
|
|
30
|
+
* attribute names the component that owns an element.
|
|
31
|
+
*/
|
|
32
|
+
declare const domAdapter: FrameworkAdapter;
|
|
33
|
+
|
|
34
|
+
declare const SOURCE_ATTRIBUTE = "data-grabby-loc";
|
|
35
|
+
|
|
36
|
+
/** Every built-in adapter, most specific first; the DOM adapter is the fallback. */
|
|
37
|
+
declare const DEFAULT_ADAPTERS: readonly FrameworkAdapter[];
|
|
38
|
+
interface ComposedAdapters {
|
|
39
|
+
resolveComponent: ComponentResolver;
|
|
40
|
+
resolveSource: SourceResolver;
|
|
41
|
+
/** Name of the framework that rendered this element, or "HTML". */
|
|
42
|
+
frameworkFor(el: Element): string;
|
|
43
|
+
cleanClasses(classes: string[]): string[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Tries adapters per element rather than picking one per page, so it copes
|
|
47
|
+
* with an app that mounts late, and with micro-frontends mixing frameworks.
|
|
48
|
+
*/
|
|
49
|
+
declare function composeAdapters(adapters?: readonly FrameworkAdapter[]): ComposedAdapters;
|
|
50
|
+
|
|
51
|
+
declare function filterAngularClasses(classList: DOMTokenList): string[];
|
|
52
|
+
|
|
53
|
+
interface ExportEnv {
|
|
54
|
+
/** Page origin shown in the header, e.g. "localhost:4200". */
|
|
55
|
+
origin?: string;
|
|
56
|
+
now?: Date;
|
|
57
|
+
/** Print each comment's id, so an agent can act on it (e.g. resolve it). */
|
|
58
|
+
showIds?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Rough token count (≈4 characters per token), for the Copy dialog. */
|
|
61
|
+
declare function estimateTokens(text: string): number;
|
|
62
|
+
/**
|
|
63
|
+
* Turns comments into text for an AI agent. Page-level context is said once
|
|
64
|
+
* in the header, comments are grouped by the file they point at, and only the
|
|
65
|
+
* facts that matter for each element's kind are included.
|
|
66
|
+
*/
|
|
67
|
+
declare function formatExport(comments: GrabbyComment[], level?: DetailLevel, env?: ExportEnv): string;
|
|
68
|
+
|
|
69
|
+
interface CaptureDeps {
|
|
70
|
+
componentResolver: ComponentResolver | null;
|
|
71
|
+
sourceResolver: SourceResolver | null;
|
|
72
|
+
/** Framework-specific class filter; the default drops Angular/Svelte scoping classes. */
|
|
73
|
+
cleanClasses?: (classes: string[]) => string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Builds the compact description of an element that a comment carries:
|
|
77
|
+
* where it lives in the code, what kind of UI it is, and only the facts that
|
|
78
|
+
* matter for that kind. Replaces capturing the element's full outerHTML.
|
|
79
|
+
*/
|
|
80
|
+
declare function captureTarget(el: Element, deps: CaptureDeps): GrabbyTarget;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Scrubs things that look like secrets or personal data out of captured text
|
|
84
|
+
* before it's stored, copied or sent. It's a safety net for page content that
|
|
85
|
+
* ends up in labels and previews; form values are never captured at all.
|
|
86
|
+
*/
|
|
87
|
+
interface RedactOptions {
|
|
88
|
+
/**
|
|
89
|
+
* Keep email addresses. Only for developer-written strings such as
|
|
90
|
+
* placeholders ("you@company.com"), never for page content.
|
|
91
|
+
*/
|
|
92
|
+
keepEmails?: boolean;
|
|
93
|
+
}
|
|
94
|
+
declare function redact(text: string, options?: RedactOptions): string;
|
|
95
|
+
|
|
96
|
+
export { ComponentResolver, DEFAULT_ADAPTERS, DetailLevel, FrameworkAdapter, GrabbyAPI, GrabbyComment, GrabbyOptions, GrabbyTarget, SOURCE_ATTRIBUTE, SourceResolver, angularAdapter, captureTarget, composeAdapters, createNoopApi, domAdapter, estimateTokens, filterAngularClasses, formatExport, init, init as initGrabby, isDevMode, reactAdapter, redact, svelteAdapter, vueAdapter };
|