fixdog 0.0.1 → 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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -433
  3. package/dist/api/client.d.ts +74 -0
  4. package/dist/components/ConversationalInputReact.d.ts +26 -0
  5. package/dist/components/ElementInfoDisplayReact.d.ts +9 -0
  6. package/dist/components/FixdogSidebarReact.d.ts +29 -0
  7. package/dist/fiber.d.ts +9 -0
  8. package/dist/index.cjs.js +33 -0
  9. package/dist/index.cjs.js.map +1 -0
  10. package/dist/index.d.ts +6 -158
  11. package/dist/index.esm.js +29 -0
  12. package/dist/index.esm.js.map +1 -0
  13. package/dist/inspector-B4F5CBT7.cjs.js +1159 -0
  14. package/dist/inspector-B4F5CBT7.cjs.js.map +1 -0
  15. package/dist/inspector-BL2pNjn-.cjs.js +1173 -0
  16. package/dist/inspector-BL2pNjn-.cjs.js.map +1 -0
  17. package/dist/inspector-Bg6uSvk0.esm.js +1273 -0
  18. package/dist/inspector-Bg6uSvk0.esm.js.map +1 -0
  19. package/dist/inspector-BuOffbVc.cjs.js +1280 -0
  20. package/dist/inspector-BuOffbVc.cjs.js.map +1 -0
  21. package/dist/inspector-CNgFkZOU.esm.js +1185 -0
  22. package/dist/inspector-CNgFkZOU.esm.js.map +1 -0
  23. package/dist/inspector-CPF1N9dL.esm.js +1185 -0
  24. package/dist/inspector-CPF1N9dL.esm.js.map +1 -0
  25. package/dist/inspector-CPGK5Lg7.esm.js +1155 -0
  26. package/dist/inspector-CPGK5Lg7.esm.js.map +1 -0
  27. package/dist/inspector-CWcTSREy.cjs.js +1174 -0
  28. package/dist/inspector-CWcTSREy.cjs.js.map +1 -0
  29. package/dist/inspector-Cn_bl9Io.cjs.js +1189 -0
  30. package/dist/inspector-Cn_bl9Io.cjs.js.map +1 -0
  31. package/dist/inspector-D9DuXirp.cjs.js +1189 -0
  32. package/dist/inspector-D9DuXirp.cjs.js.map +1 -0
  33. package/dist/inspector-DQEtAjyM.esm.js +1129 -0
  34. package/dist/inspector-DQEtAjyM.esm.js.map +1 -0
  35. package/dist/inspector-DVlU9p44.cjs.js +1189 -0
  36. package/dist/inspector-DVlU9p44.cjs.js.map +1 -0
  37. package/dist/inspector-DaRVppX9.cjs.js +1134 -0
  38. package/dist/inspector-DaRVppX9.cjs.js.map +1 -0
  39. package/dist/inspector-huqtI2MD.esm.js +1170 -0
  40. package/dist/inspector-huqtI2MD.esm.js.map +1 -0
  41. package/dist/inspector-spoCY1tf.esm.js +1169 -0
  42. package/dist/inspector-spoCY1tf.esm.js.map +1 -0
  43. package/dist/inspector-tY1kJK5_.esm.js +1185 -0
  44. package/dist/inspector-tY1kJK5_.esm.js.map +1 -0
  45. package/dist/inspector.d.ts +43 -0
  46. package/dist/keyboard.d.ts +10 -0
  47. package/dist/overlay.d.ts +31 -0
  48. package/dist/react/InspectorProvider.d.ts +6 -0
  49. package/dist/react/index.cjs.js +32 -0
  50. package/dist/react/index.cjs.js.map +1 -0
  51. package/dist/react/index.esm.js +30 -0
  52. package/dist/react/index.esm.js.map +1 -0
  53. package/dist/sidebar/SidebarRuntime.d.ts +8 -0
  54. package/dist/sidebar-runtime.esm.js +2122 -0
  55. package/dist/sidebar-runtime.esm.js.map +1 -0
  56. package/dist/sidebar-runtime.iife.js +2991 -0
  57. package/dist/styles/sidebarStyles.d.ts +2 -0
  58. package/dist/styles.d.ts +8 -0
  59. package/dist/types/sidebar.d.ts +62 -0
  60. package/dist/types.d.ts +47 -0
  61. package/dist/utils/cookies.d.ts +10 -0
  62. package/dist/utils/devMode.d.ts +17 -0
  63. package/dist/utils/sessionStorage.d.ts +19 -0
  64. package/package.json +57 -40
  65. package/USAGE.md +0 -77
  66. package/dist/client/index.d.mts +0 -110
  67. package/dist/client/index.d.ts +0 -110
  68. package/dist/client/index.js +0 -1601
  69. package/dist/client/index.mjs +0 -1582
  70. package/dist/client/init.d.mts +0 -67
  71. package/dist/client/init.d.ts +0 -67
  72. package/dist/client/init.js +0 -1609
  73. package/dist/client/init.mjs +0 -1593
  74. package/dist/index.d.mts +0 -158
  75. package/dist/index.js +0 -1635
  76. package/dist/index.mjs +0 -1606
  77. package/src/api/client.ts +0 -141
  78. package/src/client/index.ts +0 -75
  79. package/src/client/init.tsx +0 -78
  80. package/src/components/ConversationalInputReact.tsx +0 -406
  81. package/src/components/ElementInfoDisplayReact.tsx +0 -84
  82. package/src/components/UiDogSidebarReact.tsx +0 -49
  83. package/src/element-detector.ts +0 -186
  84. package/src/index.ts +0 -228
  85. package/src/instrument.ts +0 -171
  86. package/src/sidebar-initializer.ts +0 -171
  87. package/src/source-resolver.ts +0 -121
  88. package/src/styles/sidebarStyles.ts +0 -597
  89. package/src/types/css.d.ts +0 -9
  90. package/src/types/sidebar.ts +0 -56
  91. package/src/types.ts +0 -119
  92. package/tsconfig.json +0 -23
  93. package/tsup.config.ts +0 -40
package/dist/index.d.mts DELETED
@@ -1,158 +0,0 @@
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
- interface SourceLocation {
22
- fileName: string;
23
- lineNumber: number;
24
- columnNumber: number;
25
- functionName?: string;
26
- }
27
- type EditorType = "vscode" | "vscode-insiders" | "cursor" | "webstorm" | "atom" | "sublime";
28
- interface UiDogNextOptions {
29
- /**
30
- * Editor to open when clicking elements
31
- * @default 'cursor'
32
- */
33
- editor?: EditorType;
34
- /**
35
- * Project root path for resolving file paths
36
- */
37
- projectPath?: string;
38
- /**
39
- * Modifier key for element selection
40
- * @default 'alt'
41
- */
42
- modifier?: "alt" | "ctrl" | "meta" | "shift";
43
- /**
44
- * Enable sidebar mode
45
- * @default true
46
- */
47
- enableSidebar?: boolean;
48
- /**
49
- * API endpoint for edit requests
50
- * @default 'https://api.ui.dog'
51
- */
52
- apiEndpoint?: string;
53
- }
54
- interface SidebarConfig {
55
- apiEndpoint: string;
56
- }
57
- interface EditRequest {
58
- editorUrl: string;
59
- userInput: string;
60
- /**
61
- * Optional metadata to help when source is unavailable (e.g., server components)
62
- */
63
- elementKind?: ElementInfoKind;
64
- domSnapshot?: DomSnapshot;
65
- }
66
- interface EditResponse {
67
- sessionId: string;
68
- message: string;
69
- status: "success" | "error";
70
- error?: string;
71
- }
72
- declare global {
73
- interface Window {
74
- __UIDOG_NEXT_INITIALIZED__?: boolean;
75
- __UIDOG_SIDEBAR__?: {
76
- isOpen: boolean;
77
- elementInfo: ElementInfo | null;
78
- editorUrl: string | null;
79
- };
80
- }
81
- }
82
-
83
- /**
84
- * Source resolver - builds editor URLs from source location information
85
- */
86
-
87
- /**
88
- * Build an editor URL from source location information
89
- */
90
- declare function buildEditorUrl(source: SourceLocation, editor?: EditorType, projectPath?: string): string;
91
- /**
92
- * Normalize file name by removing bundler prefixes and query strings
93
- */
94
- declare function normalizeFileName(fileName: string): string;
95
- /**
96
- * Get the file name without path for display
97
- */
98
- declare function getShortFileName(filePath: string): string;
99
-
100
- /**
101
- * Sidebar initializer - mounts the UiDog sidebar in a shadow DOM for style isolation
102
- */
103
-
104
- /**
105
- * Open the sidebar with element information
106
- */
107
- declare function openSidebar(elementInfo: ElementInfo, editorUrl: string): void;
108
- /**
109
- * Close the sidebar
110
- */
111
- declare function closeSidebar(): void;
112
-
113
- /**
114
- * Bippy instrumentation setup for React fiber inspection
115
- *
116
- * Bippy hooks into React's DevTools API (window.__REACT_DEVTOOLS_GLOBAL_HOOK__)
117
- * to intercept fiber tree data and extract source location information.
118
- */
119
-
120
- /**
121
- * Setup Bippy instrumentation to hook into React's internals
122
- * This must be called BEFORE React loads (via instrumentation-client.ts)
123
- */
124
- declare function setupBippyInstrumentation(): void;
125
- /**
126
- * Get source location from a DOM element by traversing its React fiber
127
- */
128
- declare function getSourceFromElement(element: Element): Promise<SourceLocation | null>;
129
- /**
130
- * Get component name from a fiber
131
- */
132
- declare function getComponentNameFromFiber(fiber: any): string;
133
-
134
- /**
135
- * UiDog SDK for Next.js - Main entry point
136
- *
137
- * Uses Bippy to hook into React's internals for element source detection,
138
- * providing a seamless developer experience for inspecting component locations.
139
- */
140
-
141
- /**
142
- * Initialize UiDog for Next.js
143
- *
144
- * This function sets up Bippy instrumentation, element detection, and the sidebar UI.
145
- * It should be called early in your application's lifecycle, ideally via
146
- * instrumentation-client.ts (Next.js 15.3+) or at the top of _app.tsx.
147
- */
148
- declare function initializeUiDogNext(options?: UiDogNextOptions): void;
149
- /**
150
- * Cleanup UiDog - removes all event listeners and UI
151
- */
152
- declare function cleanupUiDogNext(): void;
153
- /**
154
- * Check if UiDog is initialized
155
- */
156
- declare function isUiDogNextInitialized(): boolean;
157
-
158
- export { EditRequest, EditResponse, EditorType, ElementInfo, SidebarConfig, SourceLocation, UiDogNextOptions, buildEditorUrl, cleanupUiDogNext, closeSidebar, getComponentNameFromFiber, getShortFileName, getSourceFromElement, initializeUiDogNext, isUiDogNextInitialized, normalizeFileName, openSidebar, setupBippyInstrumentation };