uilint-react 0.2.48 → 0.2.50
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/dist/DevTool.d.ts +1 -2
- package/dist/DevTool.d.ts.map +1 -1
- package/dist/components/ui-lint/index.d.ts +3 -10
- package/dist/components/ui-lint/index.d.ts.map +1 -1
- package/dist/consistency/highlights.d.ts.map +1 -1
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/plugin-system/index.d.ts +7 -0
- package/dist/core/plugin-system/index.d.ts.map +1 -0
- package/dist/core/plugin-system/loader.d.ts +38 -0
- package/dist/core/plugin-system/loader.d.ts.map +1 -0
- package/dist/core/plugin-system/registry.d.ts +130 -0
- package/dist/core/plugin-system/registry.d.ts.map +1 -0
- package/dist/core/plugin-system/types.d.ts +353 -0
- package/dist/core/plugin-system/types.d.ts.map +1 -0
- package/dist/core/services/dom-observer.d.ts +171 -0
- package/dist/core/services/dom-observer.d.ts.map +1 -0
- package/dist/core/services/index.d.ts +6 -0
- package/dist/core/services/index.d.ts.map +1 -0
- package/dist/core/services/websocket.d.ts +112 -0
- package/dist/core/services/websocket.d.ts.map +1 -0
- package/dist/core/store/composed-store.d.ts +212 -0
- package/dist/core/store/composed-store.d.ts.map +1 -0
- package/dist/core/store/core-slice.d.ts +126 -0
- package/dist/core/store/core-slice.d.ts.map +1 -0
- package/dist/core/store/index.d.ts +6 -0
- package/dist/core/store/index.d.ts.map +1 -0
- package/dist/devtools.js +117 -136
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1677 -12464
- package/dist/index.js.map +1 -1
- package/dist/plugins/eslint/commands.d.ts +6 -0
- package/dist/plugins/eslint/commands.d.ts.map +1 -0
- package/dist/plugins/eslint/index.d.ts +10 -0
- package/dist/plugins/eslint/index.d.ts.map +1 -0
- package/dist/plugins/eslint/slice.d.ts +66 -0
- package/dist/plugins/eslint/slice.d.ts.map +1 -0
- package/dist/plugins/eslint/types.d.ts +128 -0
- package/dist/plugins/eslint/types.d.ts.map +1 -0
- package/dist/plugins/semantic/commands.d.ts +6 -0
- package/dist/plugins/semantic/commands.d.ts.map +1 -0
- package/dist/plugins/semantic/index.d.ts +15 -0
- package/dist/plugins/semantic/index.d.ts.map +1 -0
- package/dist/plugins/semantic/slice.d.ts +52 -0
- package/dist/plugins/semantic/slice.d.ts.map +1 -0
- package/dist/plugins/semantic/types.d.ts +121 -0
- package/dist/plugins/semantic/types.d.ts.map +1 -0
- package/dist/plugins/vision/commands.d.ts +6 -0
- package/dist/plugins/vision/commands.d.ts.map +1 -0
- package/dist/plugins/vision/index.d.ts +12 -0
- package/dist/plugins/vision/index.d.ts.map +1 -0
- package/dist/plugins/vision/slice.d.ts +104 -0
- package/dist/plugins/vision/slice.d.ts.map +1 -0
- package/dist/plugins/vision/types.d.ts +169 -0
- package/dist/plugins/vision/types.d.ts.map +1 -0
- package/dist/scanner/vision-capture.d.ts.map +1 -1
- package/dist/ui/UILint.d.ts +11 -0
- package/dist/ui/UILint.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts +3 -0
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/ResultItem.d.ts +9 -0
- package/dist/ui/components/CommandPalette/ResultItem.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/SearchInput.d.ts +8 -0
- package/dist/ui/components/CommandPalette/SearchInput.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/index.d.ts +2 -0
- package/dist/ui/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/ui/components/FloatingIcon.d.ts +3 -0
- package/dist/ui/components/FloatingIcon.d.ts.map +1 -0
- package/dist/ui/components/HeatmapOverlay.d.ts.map +1 -0
- package/dist/ui/components/Inspector/ElementDetail.d.ts +8 -0
- package/dist/ui/components/Inspector/ElementDetail.d.ts.map +1 -0
- package/dist/ui/components/Inspector/InspectorSidebar.d.ts +3 -0
- package/dist/ui/components/Inspector/InspectorSidebar.d.ts.map +1 -0
- package/dist/ui/components/Inspector/IssueDetail.d.ts +7 -0
- package/dist/ui/components/Inspector/IssueDetail.d.ts.map +1 -0
- package/dist/ui/components/Inspector/index.d.ts +2 -0
- package/dist/ui/components/Inspector/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.d.ts +4 -0
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/useElementRects.d.ts +12 -0
- package/dist/ui/hooks/useElementRects.d.ts.map +1 -0
- package/dist/ui/hooks/useIssues.d.ts +17 -0
- package/dist/ui/hooks/useIssues.d.ts.map +1 -0
- package/dist/ui/hooks/useKeyboardShortcuts.d.ts +8 -0
- package/dist/ui/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/ui/icons.d.ts +20 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/index.d.ts +16 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/types.d.ts +69 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/components/ui-lint/FloatingIcon.d.ts +0 -3
- package/dist/components/ui-lint/FloatingIcon.d.ts.map +0 -1
- package/dist/components/ui-lint/HeatmapOverlay.d.ts.map +0 -1
- package/dist/components/ui-lint/IndexingIndicator.d.ts +0 -3
- package/dist/components/ui-lint/IndexingIndicator.d.ts.map +0 -1
- package/dist/components/ui-lint/RegionSelector.d.ts +0 -18
- package/dist/components/ui-lint/RegionSelector.d.ts.map +0 -1
- package/dist/components/ui-lint/ScreenshotViewer.d.ts +0 -11
- package/dist/components/ui-lint/ScreenshotViewer.d.ts.map +0 -1
- package/dist/components/ui-lint/UILintUI.d.ts +0 -5
- package/dist/components/ui-lint/UILintUI.d.ts.map +0 -1
- package/dist/components/ui-lint/VisionIssuesPanel.d.ts +0 -12
- package/dist/components/ui-lint/VisionIssuesPanel.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CategorySidebar.d.ts +0 -29
- package/dist/components/ui-lint/command-palette/CategorySidebar.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPalette.d.ts +0 -7
- package/dist/components/ui-lint/command-palette/CommandPalette.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPaletteInput.d.ts +0 -18
- package/dist/components/ui-lint/command-palette/CommandPaletteInput.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPaletteItem.d.ts +0 -26
- package/dist/components/ui-lint/command-palette/CommandPaletteItem.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/CommandPaletteResults.d.ts +0 -46
- package/dist/components/ui-lint/command-palette/CommandPaletteResults.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/FilterChips.d.ts +0 -11
- package/dist/components/ui-lint/command-palette/FilterChips.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/RuleDetailItem.d.ts +0 -15
- package/dist/components/ui-lint/command-palette/RuleDetailItem.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/RuleEditor.d.ts +0 -22
- package/dist/components/ui-lint/command-palette/RuleEditor.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/RuleToggleItem.d.ts +0 -20
- package/dist/components/ui-lint/command-palette/RuleToggleItem.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/SourceCodePreview.d.ts +0 -17
- package/dist/components/ui-lint/command-palette/SourceCodePreview.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/icons.d.ts +0 -39
- package/dist/components/ui-lint/command-palette/icons.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/index.d.ts +0 -13
- package/dist/components/ui-lint/command-palette/index.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/types.d.ts +0 -160
- package/dist/components/ui-lint/command-palette/types.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/use-fuzzy-search.d.ts +0 -19
- package/dist/components/ui-lint/command-palette/use-fuzzy-search.d.ts.map +0 -1
- package/dist/components/ui-lint/command-palette/use-keyboard-navigation.d.ts +0 -10
- package/dist/components/ui-lint/command-palette/use-keyboard-navigation.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/index.d.ts +0 -4
- package/dist/components/ui-lint/hooks/index.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/useAutoScans.d.ts +0 -5
- package/dist/components/ui-lint/hooks/useAutoScans.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/useDevToolEventHandlers.d.ts +0 -5
- package/dist/components/ui-lint/hooks/useDevToolEventHandlers.d.ts.map +0 -1
- package/dist/components/ui-lint/hooks/useNavigationDetection.d.ts +0 -6
- package/dist/components/ui-lint/hooks/useNavigationDetection.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/ElementInspector.d.ts +0 -9
- package/dist/components/ui-lint/inspector/ElementInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/FixesInspector.d.ts +0 -6
- package/dist/components/ui-lint/inspector/FixesInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/FullFileViewer.d.ts +0 -17
- package/dist/components/ui-lint/inspector/FullFileViewer.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/InspectorSidebar.d.ts +0 -12
- package/dist/components/ui-lint/inspector/InspectorSidebar.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/IssueInspector.d.ts +0 -12
- package/dist/components/ui-lint/inspector/IssueInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/MarkdownRenderer.d.ts +0 -11
- package/dist/components/ui-lint/inspector/MarkdownRenderer.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/ResizeHandle.d.ts +0 -19
- package/dist/components/ui-lint/inspector/ResizeHandle.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/RuleInspector.d.ts +0 -10
- package/dist/components/ui-lint/inspector/RuleInspector.d.ts.map +0 -1
- package/dist/components/ui-lint/inspector/index.d.ts +0 -8
- package/dist/components/ui-lint/inspector/index.d.ts.map +0 -1
- package/dist/components/ui-lint/portal-host.d.ts +0 -3
- package/dist/components/ui-lint/portal-host.d.ts.map +0 -1
- package/dist/components/ui-lint/store.d.ts +0 -431
- package/dist/components/ui-lint/store.d.ts.map +0 -1
- package/dist/components/ui-lint/useDOMObserver.d.ts +0 -11
- package/dist/components/ui-lint/useDOMObserver.d.ts.map +0 -1
- package/dist/index-L3Zm-CoX.js +0 -513
- package/dist/index-L3Zm-CoX.js.map +0 -1
- package/dist/vision-capture-8mhdjw77.js +0 -235
- package/dist/vision-capture-8mhdjw77.js.map +0 -1
- /package/dist/{components/ui-lint → ui/components}/HeatmapOverlay.d.ts +0 -0
package/dist/DevTool.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ export type DevToolProps = {
|
|
|
4
4
|
/**
|
|
5
5
|
* Main devtool React root.
|
|
6
6
|
*
|
|
7
|
-
* Handles
|
|
8
|
-
* WebSocket connection, auto-scans, and UI rendering.
|
|
7
|
+
* Handles WebSocket connection and UI rendering.
|
|
9
8
|
*/
|
|
10
9
|
export declare function DevTool({ enabled }: DevToolProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
10
|
//# sourceMappingURL=DevTool.d.ts.map
|
package/dist/DevTool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevTool.d.ts","sourceRoot":"","sources":["../src/DevTool.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DevTool.d.ts","sourceRoot":"","sources":["../src/DevTool.tsx"],"names":[],"mappings":"AA8BA,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AASF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,OAAc,EAAE,EAAE,YAAY,kDAgFvD"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* UILint
|
|
2
|
+
* UILint Legacy Utilities
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* These utilities are kept for backward compatibility.
|
|
5
|
+
* New UI components are in /ui/ directory.
|
|
6
6
|
*/
|
|
7
|
-
export { useUILintStore } from './store';
|
|
8
|
-
export type { UILintStore } from './store';
|
|
9
|
-
export { FloatingIcon } from './FloatingIcon';
|
|
10
|
-
export { CommandPalette } from './command-palette';
|
|
11
|
-
export { VisionIssuesPanel } from './VisionIssuesPanel';
|
|
12
|
-
export { ScreenshotViewer } from './ScreenshotViewer';
|
|
13
7
|
export { scanDOMForSources, groupBySourceFile, cleanupDataAttributes, getElementById, updateElementRects, buildEditorUrl, isNodeModulesPath, getDisplayName, getSourceFromDataLoc, } from './dom-utils';
|
|
14
|
-
export { useDOMObserver, getDataLocElementCount } from './useDOMObserver';
|
|
15
8
|
export { fetchSource, fetchSourceWithContext, clearSourceCache, getCachedSource, prefetchSources, } from './source-fetcher';
|
|
16
9
|
export type { SourceLocation, ScannedElement, SourceFile, UILintSettings, SourceApiResponse, CachedSource, LocatorTarget, InspectedElement, VisionIssue, VisionAnalysisResult, ElementManifest, } from './types';
|
|
17
10
|
export { FILE_COLORS, DEFAULT_SETTINGS, DATA_UILINT_ID } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui-lint/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui-lint/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGxE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,GACtB,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlights.d.ts","sourceRoot":"","sources":["../../src/consistency/highlights.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"highlights.d.ts","sourceRoot":"","sources":["../../src/consistency/highlights.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAyBzC,UAAU,2BAA2B;IACnC,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,iBAAiB,EAAE,SAAS,GAAG,IAAI,CAAC;IACpC,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;CACnC;AA4KD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,iBAAiB,EACjB,eAAe,GAChB,EAAE,2BAA2B,4BAoG7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core - Plugin system infrastructure
|
|
3
|
+
*
|
|
4
|
+
* This module provides the foundation for the UILint plugin architecture:
|
|
5
|
+
* - Plugin registration and lifecycle management
|
|
6
|
+
* - Dynamic plugin loading
|
|
7
|
+
* - Shared services (WebSocket, DOM observation)
|
|
8
|
+
* - Core UI state management
|
|
9
|
+
*/
|
|
10
|
+
export * from './plugin-system';
|
|
11
|
+
export * from './services';
|
|
12
|
+
export * from './store';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,iBAAiB,CAAC;AAGhC,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin System - Core infrastructure for UILint plugin architecture
|
|
3
|
+
*/
|
|
4
|
+
export type { Plugin, PluginServices, Command, Analyzer, InspectorPanel, InspectorPanelProps, RuleUIContribution, RuleDetailProps, IssueInlineProps, FixSuggestion, } from './types';
|
|
5
|
+
export { PluginRegistry, pluginRegistry, createPluginRegistry, sortByDependencies, } from './registry';
|
|
6
|
+
export { loadPlugins, loadPlugin, getPluginManifest, BUILT_IN_PLUGINS, type PluginManifest, } from './loader';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/plugin-system/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,MAAM,EACN,cAAc,EACd,OAAO,EACP,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Plugin } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Plugin manifest for dynamic loading
|
|
4
|
+
*/
|
|
5
|
+
export interface PluginManifest {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
/** Dynamic import function */
|
|
9
|
+
load: () => Promise<{
|
|
10
|
+
default: Plugin;
|
|
11
|
+
}>;
|
|
12
|
+
/** Whether plugin is enabled */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Built-in plugin manifests
|
|
17
|
+
*/
|
|
18
|
+
export declare const BUILT_IN_PLUGINS: PluginManifest[];
|
|
19
|
+
/**
|
|
20
|
+
* Load a single plugin from its manifest
|
|
21
|
+
* @param manifest - The plugin manifest to load
|
|
22
|
+
* @returns The loaded plugin or null on failure
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadPlugin(manifest: PluginManifest): Promise<Plugin | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Load multiple plugins from manifests
|
|
27
|
+
* @param manifests - Array of plugin manifests to load
|
|
28
|
+
* @param onProgress - Optional callback for progress updates
|
|
29
|
+
* @returns Array of loaded plugins sorted by dependencies
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadPlugins(manifests?: PluginManifest[], onProgress?: (loaded: number, total: number, pluginId: string) => void): Promise<Plugin[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Get a plugin manifest by ID
|
|
34
|
+
* @param id - The plugin ID to find
|
|
35
|
+
* @returns The plugin manifest or undefined if not found
|
|
36
|
+
*/
|
|
37
|
+
export declare function getPluginManifest(id: string): PluginManifest | undefined;
|
|
38
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/core/plugin-system/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzC,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAmB5C,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,SAAS,GAAE,cAAc,EAAqB,EAC9C,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,GACrE,OAAO,CAAC,MAAM,EAAE,CAAC,CAkCnB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAExE"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Plugin, PluginServices, Command, Analyzer, InspectorPanel, RuleUIContribution, RuleMeta } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Topologically sort plugins by their dependencies.
|
|
4
|
+
* Ensures plugins are initialized after their dependencies.
|
|
5
|
+
*
|
|
6
|
+
* @param plugins - Array of plugins to sort
|
|
7
|
+
* @returns Sorted array with dependencies before dependents
|
|
8
|
+
* @throws Error if circular dependency is detected
|
|
9
|
+
*/
|
|
10
|
+
export declare function sortByDependencies(plugins: Plugin[]): Plugin[];
|
|
11
|
+
/**
|
|
12
|
+
* Plugin Registry
|
|
13
|
+
*
|
|
14
|
+
* Central registry for managing UILint plugins. Handles:
|
|
15
|
+
* - Plugin registration with dependency validation
|
|
16
|
+
* - Ordered initialization based on dependencies
|
|
17
|
+
* - Aggregation of plugin contributions
|
|
18
|
+
* - Lifecycle management (dispose)
|
|
19
|
+
*/
|
|
20
|
+
export declare class PluginRegistry {
|
|
21
|
+
private plugins;
|
|
22
|
+
private services;
|
|
23
|
+
/**
|
|
24
|
+
* Register a plugin with the registry.
|
|
25
|
+
*
|
|
26
|
+
* @param plugin - The plugin to register
|
|
27
|
+
* @throws Warning if plugin with same ID already registered
|
|
28
|
+
* @throws Warning if plugin dependencies are not registered
|
|
29
|
+
*/
|
|
30
|
+
register(plugin: Plugin): void;
|
|
31
|
+
/**
|
|
32
|
+
* Initialize all registered plugins in dependency order.
|
|
33
|
+
*
|
|
34
|
+
* @param services - Plugin services to pass to each plugin's initialize method
|
|
35
|
+
*/
|
|
36
|
+
initializeAll(services: PluginServices): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get all registered plugins.
|
|
39
|
+
*
|
|
40
|
+
* @returns Array of all registered plugins
|
|
41
|
+
*/
|
|
42
|
+
getPlugins(): Plugin[];
|
|
43
|
+
/**
|
|
44
|
+
* Get a specific plugin by ID.
|
|
45
|
+
*
|
|
46
|
+
* @param id - The plugin ID to look up
|
|
47
|
+
* @returns The plugin if found, undefined otherwise
|
|
48
|
+
*/
|
|
49
|
+
getPlugin(id: string): Plugin | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Aggregate all commands from all registered plugins.
|
|
52
|
+
*
|
|
53
|
+
* @returns Array of all commands from all plugins
|
|
54
|
+
*/
|
|
55
|
+
getAllCommands(): Command[];
|
|
56
|
+
/**
|
|
57
|
+
* Aggregate all analyzers from all registered plugins.
|
|
58
|
+
*
|
|
59
|
+
* @returns Array of all analyzers from all plugins
|
|
60
|
+
*/
|
|
61
|
+
getAllAnalyzers(): Analyzer[];
|
|
62
|
+
/**
|
|
63
|
+
* Aggregate all inspector panels from all registered plugins.
|
|
64
|
+
* Panels are sorted by priority (higher priority first).
|
|
65
|
+
*
|
|
66
|
+
* @returns Array of all inspector panels, sorted by priority
|
|
67
|
+
*/
|
|
68
|
+
getAllInspectorPanels(): InspectorPanel[];
|
|
69
|
+
/**
|
|
70
|
+
* Resolve which plugin handles a specific rule.
|
|
71
|
+
*
|
|
72
|
+
* First checks for plugins that explicitly claim the rule via ruleContributions,
|
|
73
|
+
* then falls back to matching by rule category.
|
|
74
|
+
*
|
|
75
|
+
* @param ruleId - The rule ID to look up
|
|
76
|
+
* @param ruleMeta - The rule metadata
|
|
77
|
+
* @returns The plugin that handles this rule, or a default core plugin
|
|
78
|
+
*/
|
|
79
|
+
getPluginForRule(ruleId: string, ruleMeta: RuleMeta): Plugin;
|
|
80
|
+
/**
|
|
81
|
+
* Get custom UI contribution for a specific rule.
|
|
82
|
+
*
|
|
83
|
+
* @param ruleId - The rule ID to look up
|
|
84
|
+
* @returns The rule UI contribution if found, undefined otherwise
|
|
85
|
+
*/
|
|
86
|
+
getRuleContribution(ruleId: string): RuleUIContribution | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Dispose all plugins and clean up resources.
|
|
89
|
+
* Calls dispose on each plugin in reverse initialization order.
|
|
90
|
+
*/
|
|
91
|
+
disposeAll(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Check if a plugin is registered.
|
|
94
|
+
*
|
|
95
|
+
* @param id - The plugin ID to check
|
|
96
|
+
* @returns true if the plugin is registered
|
|
97
|
+
*/
|
|
98
|
+
isRegistered(id: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Check if a plugin is initialized.
|
|
101
|
+
*
|
|
102
|
+
* @param id - The plugin ID to check
|
|
103
|
+
* @returns true if the plugin is initialized, false otherwise
|
|
104
|
+
*/
|
|
105
|
+
isInitialized(id: string): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Get the current plugin services (available after initializeAll).
|
|
108
|
+
*
|
|
109
|
+
* @returns The plugin services, or null if not yet initialized
|
|
110
|
+
*/
|
|
111
|
+
getServices(): PluginServices | null;
|
|
112
|
+
/**
|
|
113
|
+
* Clear all registered plugins.
|
|
114
|
+
* Useful for testing or resetting the registry.
|
|
115
|
+
*/
|
|
116
|
+
clear(): void;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Factory function to create a new PluginRegistry instance.
|
|
120
|
+
* Use this in tests to get isolated registry instances.
|
|
121
|
+
*
|
|
122
|
+
* @returns A new PluginRegistry instance
|
|
123
|
+
*/
|
|
124
|
+
export declare function createPluginRegistry(): PluginRegistry;
|
|
125
|
+
/**
|
|
126
|
+
* Singleton instance of the plugin registry.
|
|
127
|
+
* Use this for global plugin management.
|
|
128
|
+
*/
|
|
129
|
+
export declare const pluginRegistry: PluginRegistry;
|
|
130
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/plugin-system/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EACd,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACT,MAAM,SAAS,CAAC;AAUjB;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA+C9D;AAED;;;;;;;;GAQG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAA4C;IAC3D,OAAO,CAAC,QAAQ,CAA+B;IAE/C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAsC9B;;;;OAIG;IACG,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA+C5D;;;;OAIG;IACH,UAAU,IAAI,MAAM,EAAE;IAItB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIzC;;;;OAIG;IACH,cAAc,IAAI,OAAO,EAAE;IAY3B;;;;OAIG;IACH,eAAe,IAAI,QAAQ,EAAE;IAY7B;;;;;OAKG;IACH,qBAAqB,IAAI,cAAc,EAAE;IAazC;;;;;;;;;OASG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM;IAmD5D;;;;;OAKG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAenE;;;OAGG;IACH,UAAU,IAAI,IAAI;IAoClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIjC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIlC;;;;OAIG;IACH,WAAW,IAAI,cAAc,GAAG,IAAI;IAIpC;;;OAGG;IACH,KAAK,IAAI,IAAI;CAKd;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAErD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,gBAAyB,CAAC"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Metadata describing a plugin
|
|
4
|
+
*/
|
|
5
|
+
export interface PluginMeta {
|
|
6
|
+
/** Unique plugin identifier (e.g., "uilint-eslint", "uilint-vision") */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Human-readable plugin name */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Semantic version string */
|
|
11
|
+
version: string;
|
|
12
|
+
/** Short description of the plugin's purpose */
|
|
13
|
+
description: string;
|
|
14
|
+
/** Optional icon (React component or emoji string) */
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Plugin IDs this plugin depends on */
|
|
17
|
+
dependencies?: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Services injected into plugins for accessing core functionality
|
|
21
|
+
*/
|
|
22
|
+
export interface PluginServices {
|
|
23
|
+
/** WebSocket service for server communication */
|
|
24
|
+
websocket: WebSocketService;
|
|
25
|
+
/** DOM observer service for tracking element changes */
|
|
26
|
+
domObserver: DOMObserverService;
|
|
27
|
+
/** Get current state from the store */
|
|
28
|
+
getState: <T = unknown>() => T;
|
|
29
|
+
/** Update state in the store */
|
|
30
|
+
setState: <T = unknown>(partial: Partial<T>) => void;
|
|
31
|
+
/** Open the inspector sidebar with specific content */
|
|
32
|
+
openInspector: (mode: "rule" | "issue" | "element" | "fixes", data: {
|
|
33
|
+
ruleId?: string;
|
|
34
|
+
issue?: unknown;
|
|
35
|
+
elementId?: string;
|
|
36
|
+
filePath?: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
/** Close the command palette */
|
|
39
|
+
closeCommandPalette: () => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A command that can be triggered from the command palette
|
|
43
|
+
*/
|
|
44
|
+
export interface Command {
|
|
45
|
+
/** Unique command identifier */
|
|
46
|
+
id: string;
|
|
47
|
+
/** Display title in the command palette */
|
|
48
|
+
title: string;
|
|
49
|
+
/** Keywords for fuzzy search matching */
|
|
50
|
+
keywords: string[];
|
|
51
|
+
/** Category for grouping (e.g., "actions", "navigation", "settings") */
|
|
52
|
+
category: string;
|
|
53
|
+
/** Optional subtitle for additional context */
|
|
54
|
+
subtitle?: string;
|
|
55
|
+
/** Optional icon (React component or emoji string) */
|
|
56
|
+
icon?: ReactNode;
|
|
57
|
+
/** Optional keyboard shortcut (e.g., "Cmd+K", "Ctrl+Shift+P") */
|
|
58
|
+
shortcut?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Predicate to determine if the command is available in the current state
|
|
61
|
+
* @param state Current application state
|
|
62
|
+
* @returns true if the command should be shown
|
|
63
|
+
*/
|
|
64
|
+
isAvailable?: (state: unknown) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Execute the command
|
|
67
|
+
* @param services Plugin services for accessing core functionality
|
|
68
|
+
* @returns Optional promise for async commands
|
|
69
|
+
*/
|
|
70
|
+
execute: (services: PluginServices) => void | Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Props passed to inspector panel components
|
|
74
|
+
*/
|
|
75
|
+
export interface InspectorPanelProps {
|
|
76
|
+
/** Optional data payload for the panel */
|
|
77
|
+
data?: Record<string, unknown>;
|
|
78
|
+
/** Plugin services for accessing core functionality */
|
|
79
|
+
services: PluginServices;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* An inspector panel contributed by a plugin
|
|
83
|
+
*/
|
|
84
|
+
export interface InspectorPanel {
|
|
85
|
+
/** Unique panel identifier */
|
|
86
|
+
id: string;
|
|
87
|
+
/** Panel title (string or function for dynamic titles) */
|
|
88
|
+
title: string | ((props: InspectorPanelProps) => string);
|
|
89
|
+
/** Optional icon (React component or emoji string) */
|
|
90
|
+
icon?: ReactNode;
|
|
91
|
+
/** React component to render the panel content */
|
|
92
|
+
component: ComponentType<InspectorPanelProps>;
|
|
93
|
+
/** Priority for ordering (higher = appears first, default: 0) */
|
|
94
|
+
priority?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Trigger conditions for when an analyzer should run
|
|
98
|
+
*/
|
|
99
|
+
export type AnalyzerTrigger = "manual" | "page-load" | "route-change" | "file-change" | "dom-mutation";
|
|
100
|
+
/**
|
|
101
|
+
* Context provided to analyzers during analysis
|
|
102
|
+
*/
|
|
103
|
+
export interface AnalysisContext {
|
|
104
|
+
/** Current route/pathname */
|
|
105
|
+
route: string;
|
|
106
|
+
/** Scanned DOM elements with data-loc attributes */
|
|
107
|
+
elements: ScannedElementInfo[];
|
|
108
|
+
/** Send a message to the server via WebSocket */
|
|
109
|
+
sendMessage: (message: unknown) => void;
|
|
110
|
+
/** Get current application state */
|
|
111
|
+
getState: <T = unknown>() => T;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* An analyzer that can scan the page for issues
|
|
115
|
+
*/
|
|
116
|
+
export interface Analyzer {
|
|
117
|
+
/** Unique analyzer identifier */
|
|
118
|
+
id: string;
|
|
119
|
+
/** Human-readable analyzer name */
|
|
120
|
+
name: string;
|
|
121
|
+
/** When this analyzer should be triggered */
|
|
122
|
+
triggers: AnalyzerTrigger[];
|
|
123
|
+
/** Whether this analyzer requires a WebSocket connection to function */
|
|
124
|
+
requiresConnection: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Run the analysis
|
|
127
|
+
* @param context Analysis context with elements and services
|
|
128
|
+
* @returns Array of discovered issues or a promise resolving to them
|
|
129
|
+
*/
|
|
130
|
+
analyze: (context: AnalysisContext) => PluginIssue[] | Promise<PluginIssue[]>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Severity level for issues
|
|
134
|
+
*/
|
|
135
|
+
export type IssueSeverity = "error" | "warning" | "info";
|
|
136
|
+
/**
|
|
137
|
+
* A unified issue type for all plugin-reported problems
|
|
138
|
+
*/
|
|
139
|
+
export interface PluginIssue {
|
|
140
|
+
/** Unique issue identifier */
|
|
141
|
+
id: string;
|
|
142
|
+
/** Human-readable issue message */
|
|
143
|
+
message: string;
|
|
144
|
+
/** Severity level */
|
|
145
|
+
severity: IssueSeverity;
|
|
146
|
+
/** data-loc attribute value linking to source location */
|
|
147
|
+
dataLoc?: string;
|
|
148
|
+
/** Source file path */
|
|
149
|
+
filePath?: string;
|
|
150
|
+
/** Line number in source file (1-indexed) */
|
|
151
|
+
line?: number;
|
|
152
|
+
/** Column number in source file (1-indexed) */
|
|
153
|
+
column?: number;
|
|
154
|
+
/** Rule ID that generated this issue */
|
|
155
|
+
ruleId?: string;
|
|
156
|
+
/** Additional metadata for the issue */
|
|
157
|
+
metadata?: Record<string, unknown>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Issues contributed by a plugin for heatmap aggregation
|
|
161
|
+
*/
|
|
162
|
+
export interface IssueContribution {
|
|
163
|
+
/** Plugin ID that contributed these issues */
|
|
164
|
+
pluginId: string;
|
|
165
|
+
/**
|
|
166
|
+
* Map of dataLoc -> issues for that location
|
|
167
|
+
* Multiple issues can exist at the same source location
|
|
168
|
+
*/
|
|
169
|
+
issues: Map<string, PluginIssue[]>;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Custom UI contribution for a specific rule
|
|
173
|
+
*/
|
|
174
|
+
export interface RuleUIContribution {
|
|
175
|
+
/** Rule ID this contribution applies to */
|
|
176
|
+
ruleId: string;
|
|
177
|
+
/** Custom inspector panel for this rule's issues */
|
|
178
|
+
inspectorPanel?: ComponentType<InspectorPanelProps>;
|
|
179
|
+
/** Custom icon for this rule */
|
|
180
|
+
icon?: ReactNode;
|
|
181
|
+
/** Additional commands specific to this rule */
|
|
182
|
+
commands?: Command[];
|
|
183
|
+
/** Custom heatmap color for this rule's issues (CSS color string) */
|
|
184
|
+
heatmapColor?: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Rule metadata for handlesRules predicate
|
|
188
|
+
*/
|
|
189
|
+
export interface RuleMeta {
|
|
190
|
+
/** Rule ID (e.g., "uilint/semantic") */
|
|
191
|
+
id: string;
|
|
192
|
+
/** Rule category */
|
|
193
|
+
category?: string;
|
|
194
|
+
/** Rule name */
|
|
195
|
+
name?: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Complete plugin definition with all contributions
|
|
199
|
+
* @template TSlice Type of the plugin's state slice
|
|
200
|
+
*/
|
|
201
|
+
export interface Plugin<TSlice = unknown> {
|
|
202
|
+
/** Plugin metadata (for structured access) */
|
|
203
|
+
meta?: PluginMeta;
|
|
204
|
+
/** Unique plugin identifier (e.g., "uilint-eslint", "uilint-vision") */
|
|
205
|
+
id: string;
|
|
206
|
+
/** Human-readable plugin name */
|
|
207
|
+
name: string;
|
|
208
|
+
/** Semantic version string */
|
|
209
|
+
version: string;
|
|
210
|
+
/** Short description of the plugin's purpose */
|
|
211
|
+
description?: string;
|
|
212
|
+
/** Optional icon (React component or emoji string) */
|
|
213
|
+
icon?: ReactNode;
|
|
214
|
+
/** Plugin IDs this plugin depends on */
|
|
215
|
+
dependencies?: string[];
|
|
216
|
+
/** Rule categories this plugin handles (e.g., ["semantic", "static"]) */
|
|
217
|
+
ruleCategories?: string[];
|
|
218
|
+
/**
|
|
219
|
+
* Create the plugin's state slice
|
|
220
|
+
* @param services Plugin services for initialization
|
|
221
|
+
* @returns Initial state slice for this plugin
|
|
222
|
+
*/
|
|
223
|
+
createSlice?: (services: PluginServices) => TSlice;
|
|
224
|
+
/** Commands contributed by this plugin */
|
|
225
|
+
commands?: Command[];
|
|
226
|
+
/** Inspector panels contributed by this plugin */
|
|
227
|
+
inspectorPanels?: InspectorPanel[];
|
|
228
|
+
/** Analyzers contributed by this plugin */
|
|
229
|
+
analyzers?: Analyzer[];
|
|
230
|
+
/** Per-rule UI contributions */
|
|
231
|
+
ruleContributions?: RuleUIContribution[];
|
|
232
|
+
/**
|
|
233
|
+
* Predicate to determine if this plugin handles a specific rule
|
|
234
|
+
* Used for routing issues to the correct plugin
|
|
235
|
+
* @param ruleMeta Metadata about the rule
|
|
236
|
+
* @returns true if this plugin should handle issues from this rule
|
|
237
|
+
*/
|
|
238
|
+
handlesRules?: (ruleMeta: RuleMeta) => boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Get issues from the plugin's state for heatmap display
|
|
241
|
+
* @param state Current plugin state slice
|
|
242
|
+
* @returns Issue contribution for heatmap aggregation
|
|
243
|
+
*/
|
|
244
|
+
getIssues?: (state: TSlice) => IssueContribution;
|
|
245
|
+
/**
|
|
246
|
+
* Initialize the plugin (called once on registration)
|
|
247
|
+
* @param services Plugin services
|
|
248
|
+
* @returns Optional cleanup function or promise
|
|
249
|
+
*/
|
|
250
|
+
initialize?: (services: PluginServices) => void | (() => void) | Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Dispose the plugin (called on unregistration)
|
|
253
|
+
* @param services Plugin services
|
|
254
|
+
*/
|
|
255
|
+
dispose?: (services: PluginServices) => void | Promise<void>;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Handler for WebSocket messages
|
|
259
|
+
*/
|
|
260
|
+
export type WebSocketMessageHandler = (message: unknown) => void;
|
|
261
|
+
/**
|
|
262
|
+
* Handler for WebSocket connection state changes
|
|
263
|
+
*/
|
|
264
|
+
export type WebSocketConnectionHandler = (connected: boolean) => void;
|
|
265
|
+
/**
|
|
266
|
+
* WebSocket service for server communication
|
|
267
|
+
*/
|
|
268
|
+
export interface WebSocketService {
|
|
269
|
+
/** Whether the WebSocket is currently connected */
|
|
270
|
+
readonly isConnected: boolean;
|
|
271
|
+
/** Current WebSocket URL */
|
|
272
|
+
readonly url: string;
|
|
273
|
+
/**
|
|
274
|
+
* Connect to the WebSocket server
|
|
275
|
+
* @param url Optional URL to connect to (uses default if not provided)
|
|
276
|
+
*/
|
|
277
|
+
connect: (url?: string) => void;
|
|
278
|
+
/**
|
|
279
|
+
* Disconnect from the WebSocket server
|
|
280
|
+
*/
|
|
281
|
+
disconnect: () => void;
|
|
282
|
+
/**
|
|
283
|
+
* Send a message to the server
|
|
284
|
+
* @param message Message to send (will be JSON stringified)
|
|
285
|
+
*/
|
|
286
|
+
send: (message: unknown) => void;
|
|
287
|
+
/**
|
|
288
|
+
* Subscribe to messages of a specific type
|
|
289
|
+
* @param type Message type to listen for
|
|
290
|
+
* @param handler Handler function for messages of this type
|
|
291
|
+
* @returns Unsubscribe function
|
|
292
|
+
*/
|
|
293
|
+
on: (type: string, handler: WebSocketMessageHandler) => () => void;
|
|
294
|
+
/**
|
|
295
|
+
* Subscribe to connection state changes
|
|
296
|
+
* @param handler Handler function for connection state changes
|
|
297
|
+
* @returns Unsubscribe function
|
|
298
|
+
*/
|
|
299
|
+
onConnectionChange: (handler: WebSocketConnectionHandler) => () => void;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Handler for DOM element additions
|
|
303
|
+
*/
|
|
304
|
+
export type ElementsAddedHandler = (elements: ScannedElementInfo[]) => void;
|
|
305
|
+
/**
|
|
306
|
+
* Handler for DOM element removals
|
|
307
|
+
*/
|
|
308
|
+
export type ElementsRemovedHandler = (elementIds: string[]) => void;
|
|
309
|
+
/**
|
|
310
|
+
* DOM observer service for tracking element changes
|
|
311
|
+
*/
|
|
312
|
+
export interface DOMObserverService {
|
|
313
|
+
/**
|
|
314
|
+
* Start observing DOM changes
|
|
315
|
+
*/
|
|
316
|
+
start: () => void;
|
|
317
|
+
/**
|
|
318
|
+
* Stop observing DOM changes
|
|
319
|
+
*/
|
|
320
|
+
stop: () => void;
|
|
321
|
+
/**
|
|
322
|
+
* Subscribe to element additions
|
|
323
|
+
* @param handler Handler function for added elements
|
|
324
|
+
* @returns Unsubscribe function
|
|
325
|
+
*/
|
|
326
|
+
onElementsAdded: (handler: ElementsAddedHandler) => () => void;
|
|
327
|
+
/**
|
|
328
|
+
* Subscribe to element removals
|
|
329
|
+
* @param handler Handler function for removed element IDs
|
|
330
|
+
* @returns Unsubscribe function
|
|
331
|
+
*/
|
|
332
|
+
onElementsRemoved: (handler: ElementsRemovedHandler) => () => void;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Information about a scanned DOM element with data-loc attribute
|
|
336
|
+
*/
|
|
337
|
+
export interface ScannedElementInfo {
|
|
338
|
+
/**
|
|
339
|
+
* Unique element identifier
|
|
340
|
+
* Format: "loc:path:line:column#occurrence"
|
|
341
|
+
*/
|
|
342
|
+
id: string;
|
|
343
|
+
/** data-loc attribute value (format: "path:line:column") */
|
|
344
|
+
dataLoc: string;
|
|
345
|
+
/** Reference to the DOM element */
|
|
346
|
+
element: Element;
|
|
347
|
+
/** HTML tag name (e.g., "div", "button") */
|
|
348
|
+
tagName: string;
|
|
349
|
+
/** Element's bounding rectangle */
|
|
350
|
+
rect: DOMRect;
|
|
351
|
+
}
|
|
352
|
+
export type { ComponentType, ReactNode };
|
|
353
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/plugin-system/types.ts"],"names":[],"mapp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