@popmelt.com/core 0.8.2 → 0.8.4

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,26 @@
1
+ import { IncomingMessage, ServerResponse } from 'node:http';
2
+
3
+ type PopmeltPluginOptions = {
4
+ port?: number;
5
+ projectRoot?: string;
6
+ basePath?: string;
7
+ bridge?: boolean;
8
+ };
9
+ type ConnectNext = () => void;
10
+ type ConnectMiddleware = (req: IncomingMessage, res: ServerResponse, next: ConnectNext) => void;
11
+ type DevServerLike = {
12
+ config?: {
13
+ server?: {
14
+ host?: string | boolean;
15
+ port?: number;
16
+ };
17
+ };
18
+ middlewares: {
19
+ use: (middleware: ConnectMiddleware) => void;
20
+ };
21
+ httpServer?: {
22
+ once: (event: 'close', listener: () => void) => unknown;
23
+ } | null;
24
+ };
25
+
26
+ export type { DevServerLike as D, PopmeltPluginOptions as P };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,13 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
3
 
4
+ /** Client-side envelope used for persisted and streaming bridge events. */
5
+ type BridgeEvent = {
6
+ type: string;
7
+ data: Record<string, unknown>;
8
+ timestamp: number;
9
+ };
10
+
4
11
  type PopmeltContextValue = {
5
12
  isEnabled: boolean;
6
13
  };
@@ -51,6 +58,38 @@ type StyleModification = {
51
58
  captured?: boolean;
52
59
  pathname?: string;
53
60
  };
61
+ type TextModification = {
62
+ selector: string;
63
+ durableSelector?: string;
64
+ element: ElementInfo;
65
+ textNodePath: number[];
66
+ original: string;
67
+ modified: string;
68
+ captured?: boolean;
69
+ pathname?: string;
70
+ };
71
+ type DomInsertionPlacement = 'before' | 'after';
72
+ type DomModification = {
73
+ id: string;
74
+ operation: 'move' | 'copy';
75
+ selector: string;
76
+ durableSelector?: string;
77
+ element: ElementInfo;
78
+ sourceSelector?: string;
79
+ sourceDurableSelector?: string;
80
+ sourceElement?: ElementInfo;
81
+ originalParentSelector?: string;
82
+ originalParentDurableSelector?: string;
83
+ originalIndex?: number;
84
+ targetParentSelector: string;
85
+ targetParentDurableSelector?: string;
86
+ targetIndex: number;
87
+ referenceSelector?: string;
88
+ referenceDurableSelector?: string;
89
+ placement: DomInsertionPlacement;
90
+ captured?: boolean;
91
+ pathname?: string;
92
+ };
54
93
  type SpacingElementEvidence = {
55
94
  selector: string;
56
95
  reactComponent?: string;
@@ -100,11 +139,6 @@ type BridgeStatus = {
100
139
  queueDepth: number;
101
140
  sessionId: string | null;
102
141
  };
103
- type BridgeEvent = {
104
- type: 'job_started' | 'delta' | 'tool_use' | 'done' | 'error';
105
- data: Record<string, unknown>;
106
- timestamp: number;
107
- };
108
142
  type ClaudeResponse = {
109
143
  jobId: string;
110
144
  sessionId?: string;
@@ -135,6 +169,8 @@ type FeedbackData = {
135
169
  };
136
170
  annotations: AnnotationData[];
137
171
  styleModifications: StyleModification[];
172
+ textModifications?: TextModification[];
173
+ domModifications?: DomModification[];
138
174
  inspectedElement?: ElementInfo;
139
175
  spacingTokenChanges?: SpacingTokenChange[];
140
176
  };