@antigenic-oss/paint 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/LICENSE +178 -0
- package/NOTICE +4 -0
- package/README.md +180 -0
- package/bin/paint.js +266 -0
- package/next-env.d.ts +6 -0
- package/next.config.ts +19 -0
- package/package.json +81 -0
- package/postcss.config.mjs +8 -0
- package/public/dev-editor-inspector.js +1872 -0
- package/src/app/api/claude/analyze/route.ts +319 -0
- package/src/app/api/claude/apply/route.ts +185 -0
- package/src/app/api/claude/pick-folder/route.ts +64 -0
- package/src/app/api/claude/scan/route.ts +221 -0
- package/src/app/api/claude/status/route.ts +55 -0
- package/src/app/api/project/scan/route.ts +634 -0
- package/src/app/api/project-scan/css-variables/route.ts +238 -0
- package/src/app/api/project-scan/route.ts +40 -0
- package/src/app/api/project-scan/tailwind-config/route.ts +172 -0
- package/src/app/api/proxy/[[...path]]/route.ts +2400 -0
- package/src/app/docs/DocsClient.tsx +322 -0
- package/src/app/docs/layout.tsx +7 -0
- package/src/app/docs/page.tsx +855 -0
- package/src/app/globals.css +176 -0
- package/src/app/layout.tsx +19 -0
- package/src/app/page.tsx +46 -0
- package/src/bridge/api-handlers.ts +885 -0
- package/src/bridge/proxy-handler.ts +329 -0
- package/src/bridge/server.ts +113 -0
- package/src/components/BreakpointTabs.tsx +72 -0
- package/src/components/ChangeSummaryModal.tsx +267 -0
- package/src/components/ConnectModal.tsx +994 -0
- package/src/components/Editor.tsx +90 -0
- package/src/components/PageSelector.tsx +208 -0
- package/src/components/PreviewFrame.tsx +299 -0
- package/src/components/ProjectFolderBanner.tsx +91 -0
- package/src/components/ResponsiveToolbar.tsx +222 -0
- package/src/components/TargetSelector.tsx +243 -0
- package/src/components/TopBar.tsx +315 -0
- package/src/components/common/CollapsibleSection.tsx +36 -0
- package/src/components/common/ColorPicker.tsx +920 -0
- package/src/components/common/EditablePre.tsx +136 -0
- package/src/components/common/ErrorBoundary.tsx +65 -0
- package/src/components/common/ResizablePanel.tsx +83 -0
- package/src/components/common/ScanAnimation.tsx +76 -0
- package/src/components/common/ToastContainer.tsx +97 -0
- package/src/components/common/UnitInput.tsx +77 -0
- package/src/components/common/VariableColorPicker.tsx +622 -0
- package/src/components/left-panel/AddElementPanel.tsx +237 -0
- package/src/components/left-panel/ComponentsPanel.tsx +609 -0
- package/src/components/left-panel/IconSidebar.tsx +99 -0
- package/src/components/left-panel/LayerNode.tsx +874 -0
- package/src/components/left-panel/LayerSearch.tsx +23 -0
- package/src/components/left-panel/LayersPanel.tsx +52 -0
- package/src/components/left-panel/LeftPanel.tsx +122 -0
- package/src/components/left-panel/PagesPanel.tsx +114 -0
- package/src/components/left-panel/icons.tsx +162 -0
- package/src/components/left-panel/terminal/ScanOverlay.tsx +66 -0
- package/src/components/left-panel/terminal/TerminalPanel.tsx +217 -0
- package/src/components/right-panel/ElementLogBox.tsx +248 -0
- package/src/components/right-panel/PanelTabs.tsx +83 -0
- package/src/components/right-panel/RightPanel.tsx +41 -0
- package/src/components/right-panel/changes/AiScanResultPanel.tsx +285 -0
- package/src/components/right-panel/changes/ChangeEntry.tsx +59 -0
- package/src/components/right-panel/changes/ChangelogActions.tsx +105 -0
- package/src/components/right-panel/changes/ChangesPanel.tsx +1474 -0
- package/src/components/right-panel/claude/ApplyConfirmModal.tsx +376 -0
- package/src/components/right-panel/claude/ClaudeErrorState.tsx +125 -0
- package/src/components/right-panel/claude/ClaudeIntegrationPanel.tsx +482 -0
- package/src/components/right-panel/claude/ClaudeProgressIndicator.tsx +76 -0
- package/src/components/right-panel/claude/DiffCard.tsx +130 -0
- package/src/components/right-panel/claude/DiffViewer.tsx +54 -0
- package/src/components/right-panel/claude/ProjectRootSelector.tsx +275 -0
- package/src/components/right-panel/claude/ResultsSummary.tsx +119 -0
- package/src/components/right-panel/claude/SetupFlow.tsx +315 -0
- package/src/components/right-panel/console/ConsolePanel.tsx +209 -0
- package/src/components/right-panel/design/AppearanceSection.tsx +703 -0
- package/src/components/right-panel/design/BackgroundSection.tsx +516 -0
- package/src/components/right-panel/design/BorderSection.tsx +161 -0
- package/src/components/right-panel/design/CSSRawView.tsx +412 -0
- package/src/components/right-panel/design/DesignCSSTabToggle.tsx +51 -0
- package/src/components/right-panel/design/DesignPanel.tsx +275 -0
- package/src/components/right-panel/design/ElementBreadcrumb.tsx +51 -0
- package/src/components/right-panel/design/GradientEditor.tsx +726 -0
- package/src/components/right-panel/design/LayoutSection.tsx +1948 -0
- package/src/components/right-panel/design/PositionSection.tsx +865 -0
- package/src/components/right-panel/design/PropertiesSection.tsx +86 -0
- package/src/components/right-panel/design/SVGSection.tsx +361 -0
- package/src/components/right-panel/design/ShadowBlurSection.tsx +227 -0
- package/src/components/right-panel/design/SizeSection.tsx +183 -0
- package/src/components/right-panel/design/TextSection.tsx +719 -0
- package/src/components/right-panel/design/icons.tsx +948 -0
- package/src/components/right-panel/design/inputs/BoxModelPreview.tsx +467 -0
- package/src/components/right-panel/design/inputs/ColorInput.tsx +43 -0
- package/src/components/right-panel/design/inputs/CompactInput.tsx +333 -0
- package/src/components/right-panel/design/inputs/DraggableLabel.tsx +118 -0
- package/src/components/right-panel/design/inputs/IconToggleGroup.tsx +54 -0
- package/src/components/right-panel/design/inputs/LinkedInputPair.tsx +174 -0
- package/src/components/right-panel/design/inputs/SectionHeader.tsx +79 -0
- package/src/components/right-panel/variables/VariablesPanel.tsx +388 -0
- package/src/hooks/useBridge.ts +95 -0
- package/src/hooks/useChangeTracker.ts +563 -0
- package/src/hooks/useClaudeAPI.ts +118 -0
- package/src/hooks/useDOMTree.ts +25 -0
- package/src/hooks/useKeyboardShortcuts.ts +76 -0
- package/src/hooks/usePostMessage.ts +589 -0
- package/src/hooks/useProjectScan.ts +204 -0
- package/src/hooks/useResizable.ts +20 -0
- package/src/hooks/useSelectedElement.ts +51 -0
- package/src/hooks/useTargetUrl.ts +81 -0
- package/src/inspector/DOMTraverser.ts +71 -0
- package/src/inspector/ElementSelector.ts +23 -0
- package/src/inspector/HoverHighlighter.ts +54 -0
- package/src/inspector/SelectionHighlighter.ts +27 -0
- package/src/inspector/StyleExtractor.ts +19 -0
- package/src/inspector/inspector.ts +17 -0
- package/src/inspector/messaging.ts +30 -0
- package/src/lib/apiBase.ts +15 -0
- package/src/lib/classifyElement.ts +430 -0
- package/src/lib/claude-bin.ts +197 -0
- package/src/lib/claude-stream.ts +158 -0
- package/src/lib/clientProjectScanner.ts +344 -0
- package/src/lib/componentMatcher.ts +156 -0
- package/src/lib/constants.ts +573 -0
- package/src/lib/cssVariableUtils.ts +409 -0
- package/src/lib/diffParser.ts +206 -0
- package/src/lib/folderPicker.ts +84 -0
- package/src/lib/gradientParser.ts +160 -0
- package/src/lib/projectScanner.ts +355 -0
- package/src/lib/promptBuilder.ts +402 -0
- package/src/lib/shadowParser.ts +124 -0
- package/src/lib/tailwindClassParser.ts +248 -0
- package/src/lib/textShadowUtils.ts +106 -0
- package/src/lib/utils.ts +299 -0
- package/src/lib/validatePath.ts +40 -0
- package/src/proxy.ts +92 -0
- package/src/server/terminal-server.ts +104 -0
- package/src/store/changeSlice.ts +288 -0
- package/src/store/claudeSlice.ts +222 -0
- package/src/store/componentSlice.ts +90 -0
- package/src/store/consoleSlice.ts +51 -0
- package/src/store/cssVariableSlice.ts +94 -0
- package/src/store/elementSlice.ts +78 -0
- package/src/store/index.ts +35 -0
- package/src/store/terminalSlice.ts +30 -0
- package/src/store/treeSlice.ts +69 -0
- package/src/store/uiSlice.ts +327 -0
- package/src/types/changelog.ts +49 -0
- package/src/types/claude.ts +131 -0
- package/src/types/component.ts +49 -0
- package/src/types/cssVariables.ts +18 -0
- package/src/types/element.ts +21 -0
- package/src/types/file-system-access.d.ts +27 -0
- package/src/types/gradient.ts +12 -0
- package/src/types/messages.ts +392 -0
- package/src/types/shadow.ts +8 -0
- package/src/types/tree.ts +9 -0
- package/tsconfig.json +42 -0
- package/tsconfig.server.json +12 -0
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import type { TreeNode } from './tree'
|
|
2
|
+
import type { CSSVariableDefinition } from './cssVariables'
|
|
3
|
+
import type { DetectedComponent } from './component'
|
|
4
|
+
import type { SourceInfo } from './claude'
|
|
5
|
+
|
|
6
|
+
// Inspector → Editor messages
|
|
7
|
+
|
|
8
|
+
export interface InspectorReadyMessage {
|
|
9
|
+
type: 'INSPECTOR_READY'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ElementSelectedMessage {
|
|
13
|
+
type: 'ELEMENT_SELECTED'
|
|
14
|
+
payload: {
|
|
15
|
+
selectorPath: string
|
|
16
|
+
tagName: string
|
|
17
|
+
className: string | null
|
|
18
|
+
id: string | null
|
|
19
|
+
attributes: Record<string, string>
|
|
20
|
+
innerText: string | null
|
|
21
|
+
computedStyles: Record<string, string>
|
|
22
|
+
cssVariableUsages?: Record<string, string>
|
|
23
|
+
sourceInfo?: SourceInfo | null
|
|
24
|
+
boundingRect: {
|
|
25
|
+
x: number
|
|
26
|
+
y: number
|
|
27
|
+
width: number
|
|
28
|
+
height: number
|
|
29
|
+
top: number
|
|
30
|
+
right: number
|
|
31
|
+
bottom: number
|
|
32
|
+
left: number
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ElementHoveredMessage {
|
|
38
|
+
type: 'ELEMENT_HOVERED'
|
|
39
|
+
payload: {
|
|
40
|
+
selectorPath: string | null
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface DOMUpdatedMessage {
|
|
45
|
+
type: 'DOM_UPDATED'
|
|
46
|
+
payload: {
|
|
47
|
+
tree: TreeNode
|
|
48
|
+
removedSelectors: string[]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface DOMTreeMessage {
|
|
53
|
+
type: 'DOM_TREE'
|
|
54
|
+
payload: {
|
|
55
|
+
tree: TreeNode
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface PageLinksMessage {
|
|
60
|
+
type: 'PAGE_LINKS'
|
|
61
|
+
payload: {
|
|
62
|
+
links: Array<{ href: string; text: string }>
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface HeartbeatResponseMessage {
|
|
67
|
+
type: 'HEARTBEAT_RESPONSE'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface CSSVariablesMessage {
|
|
71
|
+
type: 'CSS_VARIABLES'
|
|
72
|
+
payload: {
|
|
73
|
+
definitions: Record<string, CSSVariableDefinition>
|
|
74
|
+
isExplicit: boolean
|
|
75
|
+
scopes?: string[] // selectors where variables are defined: ':root', '.dark', etc.
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface ComponentsDetectedMessage {
|
|
80
|
+
type: 'COMPONENTS_DETECTED'
|
|
81
|
+
payload: {
|
|
82
|
+
components: DetectedComponent[]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface VariantAppliedMessage {
|
|
87
|
+
type: 'VARIANT_APPLIED'
|
|
88
|
+
payload: {
|
|
89
|
+
selectorPath: string
|
|
90
|
+
computedStyles: Record<string, string>
|
|
91
|
+
cssVariableUsages: Record<string, string>
|
|
92
|
+
boundingRect: { top: number; left: number; width: number; height: number }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface PageNavigateMessage {
|
|
97
|
+
type: 'PAGE_NAVIGATE'
|
|
98
|
+
payload: {
|
|
99
|
+
path: string
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface TextChangedMessage {
|
|
104
|
+
type: 'TEXT_CHANGED'
|
|
105
|
+
payload: {
|
|
106
|
+
selectorPath: string
|
|
107
|
+
originalText: string
|
|
108
|
+
newText: string
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface ElementDeletedMessage {
|
|
113
|
+
type: 'ELEMENT_DELETED'
|
|
114
|
+
payload: {
|
|
115
|
+
selectorPath: string
|
|
116
|
+
originalDisplay: string
|
|
117
|
+
tagName: string
|
|
118
|
+
className: string | null
|
|
119
|
+
elementId: string | null
|
|
120
|
+
innerText: string | null
|
|
121
|
+
attributes: Record<string, string>
|
|
122
|
+
computedStyles: Record<string, string>
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type ConsoleLevel = 'log' | 'info' | 'warn' | 'error'
|
|
127
|
+
|
|
128
|
+
export interface ConsoleMessageMessage {
|
|
129
|
+
type: 'CONSOLE_MESSAGE'
|
|
130
|
+
payload: {
|
|
131
|
+
level: ConsoleLevel
|
|
132
|
+
args: string[]
|
|
133
|
+
timestamp: number
|
|
134
|
+
source?: string
|
|
135
|
+
line?: number
|
|
136
|
+
column?: number
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Editor → Inspector messages
|
|
141
|
+
|
|
142
|
+
export interface SelectElementMessage {
|
|
143
|
+
type: 'SELECT_ELEMENT'
|
|
144
|
+
payload: {
|
|
145
|
+
selectorPath: string
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface PreviewChangeMessage {
|
|
150
|
+
type: 'PREVIEW_CHANGE'
|
|
151
|
+
payload: {
|
|
152
|
+
selectorPath: string
|
|
153
|
+
property: string
|
|
154
|
+
value: string
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface RevertChangeMessage {
|
|
159
|
+
type: 'REVERT_CHANGE'
|
|
160
|
+
payload: {
|
|
161
|
+
selectorPath: string
|
|
162
|
+
property: string
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface RevertAllMessage {
|
|
167
|
+
type: 'REVERT_ALL'
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface SetBreakpointMessage {
|
|
171
|
+
type: 'SET_BREAKPOINT'
|
|
172
|
+
payload: {
|
|
173
|
+
width: number
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface RequestDOMTreeMessage {
|
|
178
|
+
type: 'REQUEST_DOM_TREE'
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface RequestPageLinksMessage {
|
|
182
|
+
type: 'REQUEST_PAGE_LINKS'
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface HeartbeatMessage {
|
|
186
|
+
type: 'HEARTBEAT'
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface RequestCSSVariablesMessage {
|
|
190
|
+
type: 'REQUEST_CSS_VARIABLES'
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface SetSelectionModeMessage {
|
|
194
|
+
type: 'SET_SELECTION_MODE'
|
|
195
|
+
payload: {
|
|
196
|
+
enabled: boolean
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface RequestComponentsMessage {
|
|
201
|
+
type: 'REQUEST_COMPONENTS'
|
|
202
|
+
payload: {
|
|
203
|
+
rootSelectorPath?: string
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface ApplyVariantMessage {
|
|
208
|
+
type: 'APPLY_VARIANT'
|
|
209
|
+
payload: {
|
|
210
|
+
selectorPath: string
|
|
211
|
+
type: 'class' | 'pseudo'
|
|
212
|
+
addClassName?: string
|
|
213
|
+
removeClassNames?: string[]
|
|
214
|
+
pseudoStyles?: Record<string, string>
|
|
215
|
+
revertPseudo?: boolean
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface RevertVariantMessage {
|
|
220
|
+
type: 'REVERT_VARIANT'
|
|
221
|
+
payload: {
|
|
222
|
+
selectorPath: string
|
|
223
|
+
removeClassName?: string
|
|
224
|
+
restoreClassName?: string
|
|
225
|
+
revertPseudo?: boolean
|
|
226
|
+
pseudoProperties?: string[]
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface SetTextContentMessage {
|
|
231
|
+
type: 'SET_TEXT_CONTENT'
|
|
232
|
+
payload: {
|
|
233
|
+
selectorPath: string
|
|
234
|
+
text: string
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface RevertTextContentMessage {
|
|
239
|
+
type: 'REVERT_TEXT_CONTENT'
|
|
240
|
+
payload: {
|
|
241
|
+
selectorPath: string
|
|
242
|
+
originalText: string
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface RevertDeleteMessage {
|
|
247
|
+
type: 'REVERT_DELETE'
|
|
248
|
+
payload: {
|
|
249
|
+
selectorPath: string
|
|
250
|
+
originalDisplay: string
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface InsertElementMessage {
|
|
255
|
+
type: 'INSERT_ELEMENT'
|
|
256
|
+
payload: {
|
|
257
|
+
tagName: string
|
|
258
|
+
parentSelectorPath: string
|
|
259
|
+
placeholderText?: string
|
|
260
|
+
defaultStyles?: Record<string, string>
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface RemoveInsertedElementMessage {
|
|
265
|
+
type: 'REMOVE_INSERTED_ELEMENT'
|
|
266
|
+
payload: {
|
|
267
|
+
selectorPath: string
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface DeleteElementMessage {
|
|
272
|
+
type: 'DELETE_ELEMENT'
|
|
273
|
+
payload: {
|
|
274
|
+
selectorPath: string
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface MoveElementMessage {
|
|
279
|
+
type: 'MOVE_ELEMENT'
|
|
280
|
+
payload: {
|
|
281
|
+
selectorPath: string
|
|
282
|
+
newParentSelectorPath: string
|
|
283
|
+
newIndex: number
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface RevertMoveElementMessage {
|
|
288
|
+
type: 'REVERT_MOVE_ELEMENT'
|
|
289
|
+
payload: {
|
|
290
|
+
selectorPath: string
|
|
291
|
+
oldParentSelectorPath: string
|
|
292
|
+
oldIndex: number
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface HideSelectionOverlayMessage {
|
|
297
|
+
type: 'HIDE_SELECTION_OVERLAY'
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface ShowSelectionOverlayMessage {
|
|
301
|
+
type: 'SHOW_SELECTION_OVERLAY'
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface HideHoverMessage {
|
|
305
|
+
type: 'HIDE_HOVER'
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface NavigateToMessage {
|
|
309
|
+
type: 'NAVIGATE_TO'
|
|
310
|
+
payload: {
|
|
311
|
+
path: string
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface RecursiveEmbedDetectedMessage {
|
|
316
|
+
type: 'RECURSIVE_EMBED_DETECTED'
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface ElementInsertedMessage {
|
|
320
|
+
type: 'ELEMENT_INSERTED'
|
|
321
|
+
payload: {
|
|
322
|
+
selectorPath: string
|
|
323
|
+
parentSelectorPath: string
|
|
324
|
+
tagName: string
|
|
325
|
+
insertionIndex: number
|
|
326
|
+
placeholderText: string
|
|
327
|
+
defaultStyles?: Record<string, string>
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface ElementMovedMessage {
|
|
332
|
+
type: 'ELEMENT_MOVED'
|
|
333
|
+
payload: {
|
|
334
|
+
selectorPath: string
|
|
335
|
+
newSelectorPath: string
|
|
336
|
+
oldParentSelectorPath: string
|
|
337
|
+
newParentSelectorPath: string
|
|
338
|
+
oldIndex: number
|
|
339
|
+
newIndex: number
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Union types
|
|
344
|
+
export type InspectorToEditorMessage =
|
|
345
|
+
| InspectorReadyMessage
|
|
346
|
+
| ElementSelectedMessage
|
|
347
|
+
| ElementHoveredMessage
|
|
348
|
+
| DOMUpdatedMessage
|
|
349
|
+
| DOMTreeMessage
|
|
350
|
+
| PageLinksMessage
|
|
351
|
+
| HeartbeatResponseMessage
|
|
352
|
+
| CSSVariablesMessage
|
|
353
|
+
| ComponentsDetectedMessage
|
|
354
|
+
| VariantAppliedMessage
|
|
355
|
+
| PageNavigateMessage
|
|
356
|
+
| TextChangedMessage
|
|
357
|
+
| ElementDeletedMessage
|
|
358
|
+
| ConsoleMessageMessage
|
|
359
|
+
| RecursiveEmbedDetectedMessage
|
|
360
|
+
| ElementInsertedMessage
|
|
361
|
+
| ElementMovedMessage
|
|
362
|
+
|
|
363
|
+
export type EditorToInspectorMessage =
|
|
364
|
+
| SelectElementMessage
|
|
365
|
+
| PreviewChangeMessage
|
|
366
|
+
| RevertChangeMessage
|
|
367
|
+
| RevertAllMessage
|
|
368
|
+
| SetBreakpointMessage
|
|
369
|
+
| RequestDOMTreeMessage
|
|
370
|
+
| RequestPageLinksMessage
|
|
371
|
+
| HeartbeatMessage
|
|
372
|
+
| RequestCSSVariablesMessage
|
|
373
|
+
| SetSelectionModeMessage
|
|
374
|
+
| RequestComponentsMessage
|
|
375
|
+
| ApplyVariantMessage
|
|
376
|
+
| RevertVariantMessage
|
|
377
|
+
| SetTextContentMessage
|
|
378
|
+
| RevertTextContentMessage
|
|
379
|
+
| RevertDeleteMessage
|
|
380
|
+
| HideSelectionOverlayMessage
|
|
381
|
+
| ShowSelectionOverlayMessage
|
|
382
|
+
| HideHoverMessage
|
|
383
|
+
| NavigateToMessage
|
|
384
|
+
| DeleteElementMessage
|
|
385
|
+
| InsertElementMessage
|
|
386
|
+
| RemoveInsertedElementMessage
|
|
387
|
+
| MoveElementMessage
|
|
388
|
+
| RevertMoveElementMessage
|
|
389
|
+
|
|
390
|
+
export type PostMessageType =
|
|
391
|
+
| InspectorToEditorMessage['type']
|
|
392
|
+
| EditorToInspectorMessage['type']
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"module": "esnext",
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"isolatedModules": true,
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
"incremental": true,
|
|
20
|
+
"plugins": [
|
|
21
|
+
{
|
|
22
|
+
"name": "next"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": [
|
|
27
|
+
"./src/*"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"next-env.d.ts",
|
|
33
|
+
"**/*.ts",
|
|
34
|
+
"**/*.tsx",
|
|
35
|
+
".next/types/**/*.ts",
|
|
36
|
+
".next/dev/types/**/*.ts"
|
|
37
|
+
],
|
|
38
|
+
"exclude": [
|
|
39
|
+
"node_modules",
|
|
40
|
+
"src/server"
|
|
41
|
+
]
|
|
42
|
+
}
|