fixdog 0.0.1

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.
@@ -0,0 +1,110 @@
1
+ type ElementInfoKind = "source" | "dom";
2
+ interface DomSnapshot {
3
+ outerHTML: string;
4
+ text: string;
5
+ attributes: Record<string, string>;
6
+ }
7
+ interface ElementInfo {
8
+ kind: ElementInfoKind;
9
+ componentName?: string;
10
+ filePath?: string;
11
+ line?: number;
12
+ column?: number;
13
+ domSnapshot?: DomSnapshot;
14
+ box?: {
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ };
20
+ }
21
+ type EditorType = "vscode" | "vscode-insiders" | "cursor" | "webstorm" | "atom" | "sublime";
22
+ interface UiDogNextOptions {
23
+ /**
24
+ * Editor to open when clicking elements
25
+ * @default 'cursor'
26
+ */
27
+ editor?: EditorType;
28
+ /**
29
+ * Project root path for resolving file paths
30
+ */
31
+ projectPath?: string;
32
+ /**
33
+ * Modifier key for element selection
34
+ * @default 'alt'
35
+ */
36
+ modifier?: "alt" | "ctrl" | "meta" | "shift";
37
+ /**
38
+ * Enable sidebar mode
39
+ * @default true
40
+ */
41
+ enableSidebar?: boolean;
42
+ /**
43
+ * API endpoint for edit requests
44
+ * @default 'https://api.ui.dog'
45
+ */
46
+ apiEndpoint?: string;
47
+ }
48
+ declare global {
49
+ interface Window {
50
+ __UIDOG_NEXT_INITIALIZED__?: boolean;
51
+ __UIDOG_SIDEBAR__?: {
52
+ isOpen: boolean;
53
+ elementInfo: ElementInfo | null;
54
+ editorUrl: string | null;
55
+ };
56
+ }
57
+ }
58
+
59
+ /**
60
+ * UiDog SDK for Next.js - Main entry point
61
+ *
62
+ * Uses Bippy to hook into React's internals for element source detection,
63
+ * providing a seamless developer experience for inspecting component locations.
64
+ */
65
+
66
+ /**
67
+ * Initialize UiDog for Next.js
68
+ *
69
+ * This function sets up Bippy instrumentation, element detection, and the sidebar UI.
70
+ * It should be called early in your application's lifecycle, ideally via
71
+ * instrumentation-client.ts (Next.js 15.3+) or at the top of _app.tsx.
72
+ */
73
+ declare function initializeUiDogNext(options?: UiDogNextOptions): void;
74
+
75
+ /**
76
+ * Client entry point for UiDog Next.js integration
77
+ *
78
+ * This file is designed to be imported in:
79
+ * - Next.js 15.3+: instrumentation-client.ts at project root
80
+ * - Next.js 14.x / Pages Router: top of _app.tsx (must be first import)
81
+ *
82
+ * IMPORTANT: This file MUST be imported BEFORE React loads to properly
83
+ * install Bippy's React DevTools hook.
84
+ *
85
+ * Usage:
86
+ * ```typescript
87
+ * // instrumentation-client.ts (Next.js 15.3+)
88
+ * import 'uidog-sdk-next/client';
89
+ * ```
90
+ *
91
+ * ```typescript
92
+ * // pages/_app.tsx (Next.js 14.x / Pages Router)
93
+ * import 'uidog-sdk-next/client'; // MUST be first import
94
+ * import type { AppProps } from 'next/app';
95
+ * // ... rest of your imports
96
+ * ```
97
+ */
98
+
99
+ /**
100
+ * Configure UiDog options before initialization
101
+ * Call this before auto-initialization happens (at DOMContentLoaded)
102
+ */
103
+ declare function configureUiDogNext(options: UiDogNextOptions): void;
104
+ /**
105
+ * Disable auto-initialization
106
+ * Use this if you want to manually initialize UiDog later
107
+ */
108
+ declare function disableAutoInit(): void;
109
+
110
+ export { UiDogNextOptions, configureUiDogNext, disableAutoInit, initializeUiDogNext };