mesurer 0.2.4 → 0.2.6

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/index.d.cts CHANGED
@@ -8,22 +8,22 @@ type ColorSample = {
8
8
  alpha: number;
9
9
  };
10
10
 
11
- type Point = {
11
+ type Point$1 = {
12
12
  x: number;
13
13
  y: number;
14
14
  };
15
15
  type Arrow = {
16
16
  id: string;
17
- start: Point;
18
- end: Point;
19
- control?: Point;
17
+ start: Point$1;
18
+ end: Point$1;
19
+ control?: Point$1;
20
20
  color: string;
21
21
  width: number;
22
22
  rotation?: number;
23
23
  };
24
24
  type PenStroke = {
25
25
  id: string;
26
- points: Point[];
26
+ points: Point$1[];
27
27
  color: string;
28
28
  width: number;
29
29
  rotation?: number;
@@ -54,8 +54,17 @@ type CommentTarget = {
54
54
  attributes: Record<string, string>;
55
55
  styles: string;
56
56
  rect: Rect;
57
- documentPoint: Point;
58
- anchor?: Point;
57
+ documentPoint: Point$1;
58
+ anchor?: Point$1;
59
+ /** The address of the page the element was on when it was commented on. */
60
+ url?: string;
61
+ /** The size, in CSS px, of the window that page was in. */
62
+ viewport?: {
63
+ width: number;
64
+ height: number;
65
+ };
66
+ /** That window was a responsive preview of this size, not the page itself. */
67
+ preview?: boolean;
59
68
  };
60
69
  type CommentThread = {
61
70
  id: string;
@@ -103,8 +112,8 @@ type DistanceOverlay = {
103
112
  elementRefB?: Element | null;
104
113
  pinTargetRef?: Element | null;
105
114
  pinTargetRect?: Rect | null;
106
- pinCursor?: Point | null;
107
- pinCursorOffset?: Point | null;
115
+ pinCursor?: Point$1 | null;
116
+ pinCursorOffset?: Point$1 | null;
108
117
  horizontal: {
109
118
  x1: number;
110
119
  x2: number;
@@ -139,6 +148,17 @@ type DistanceOverlay = {
139
148
  type ToolMode = "none" | "select" | "selection" | "guides" | "xray" | "rulers" | "arrows" | "pen" | "text" | "comments";
140
149
  type PersistentToolMode = Exclude<ToolMode, "none" | "xray" | "rulers">;
141
150
 
151
+ type Point = {
152
+ x: number;
153
+ y: number;
154
+ };
155
+ type ToolbarPlacement = Point & {
156
+ edge?: ToolbarSide | null;
157
+ align?: DockAlign;
158
+ vertical?: boolean;
159
+ };
160
+ type DockAlign = "start" | "center" | "end";
161
+
142
162
  type TextFont = "handwritten" | "code" | "serif" | "sans-serif";
143
163
  type TextStyleSettings = {
144
164
  font: TextFont;
@@ -164,6 +184,8 @@ declare const MESURER_STORAGE_VERSION = 2;
164
184
  type GuidePattern = "solid" | "dashed" | "dotted";
165
185
  type InfoCardMode = "hover" | "click";
166
186
  type ThemeMode = "system" | "light" | "dark";
187
+ type ToolbarSide = "top" | "bottom" | "left" | "right";
188
+ type ToolbarDock = "free" | "snap";
167
189
  type GuideStyle = {
168
190
  opacity: number;
169
191
  width: number;
@@ -183,10 +205,9 @@ type ScreenshotSettings = {
183
205
  };
184
206
  type MesurerStoredSettings = {
185
207
  lastToolMode?: PersistentToolMode;
186
- toolbarPosition?: {
187
- x: number;
188
- y: number;
189
- };
208
+ toolbarPosition?: ToolbarPlacement;
209
+ toolbarDock?: ToolbarDock;
210
+ toolbarAutoHide?: boolean;
190
211
  highlightColor?: string;
191
212
  guideColor?: string;
192
213
  arrowColor?: string;
@@ -264,6 +285,7 @@ type MesurerFeatures = {
264
285
  screenshot?: boolean;
265
286
  rulers?: boolean;
266
287
  settings?: boolean;
288
+ responsive?: boolean;
267
289
  };
268
290
 
269
291
  type ExtensionRecordingSession = {
@@ -345,7 +367,7 @@ type MesurerProps = {
345
367
  };
346
368
  };
347
369
 
348
- declare function Mesurer({ highlightColor, guideColor, arrowColor, guideHighlightEnabled, hoverHighlightEnabled, layoutDetailsEnabled, persistOnReload, persistSession, shortcutsEnabled, theme, portalTarget, persistKey, colorPickerFormats, colorPickerClickFormat, snapEnabled, snapGuidesEnabled, snapArrowsEnabled, arrowClickToPlace, selectNewGuideEnabled, multiMeasureEnabled, guideStyle, rulerSettings, textStyle, persistence, onPersistenceError, captureVisibleTab, extensionRecording, extensionRecordingPlayer, features, initialState, }: MesurerProps): react_jsx_runtime.JSX.Element | null;
370
+ declare function Mesurer(props: MesurerProps): react_jsx_runtime.JSX.Element;
349
371
 
350
372
  type TypographyRow = {
351
373
  label: string;
@@ -384,4 +406,4 @@ type TextInspectorOptions = {
384
406
  declare const createTextInspector: (options?: TextInspectorOptions, legacy?: boolean) => TextInspectorAPI;
385
407
  declare const TextInspector: TextInspectorAPI;
386
408
 
387
- export { type Arrow, type ColorPickerFormat, type ColorSample, type GuidePattern, type GuideStyle, MESURER_STORAGE_VERSION, Mesurer, type MesurerFeatures, type MesurerPageArtifacts, type MesurerPersistence, type MesurerPersistenceSnapshot, type MesurerProps, type MesurerSessionChrome, type MesurerStoredSettings, type MesurerStoredWorkspace, type PagedWorkspaceStore, type PenStroke, type Point, type RulerSettings, type ScreenshotSettings, type ShareMode, type TextAnnotation, type TextFont, TextInspector, type TextInspectorAPI, type TextInspectorOptions, type TextStyleSettings, type TypographyInfo, type TypographyRow, createLocalStoragePersistence, createPageScopedPersistence, createTextInspector, isPagedWorkspaceStore, normalizeStoredSettings, normalizeStoredWorkspace };
409
+ export { type Arrow, type ColorPickerFormat, type ColorSample, type GuidePattern, type GuideStyle, MESURER_STORAGE_VERSION, Mesurer, type MesurerFeatures, type MesurerPageArtifacts, type MesurerPersistence, type MesurerPersistenceSnapshot, type MesurerProps, type MesurerSessionChrome, type MesurerStoredSettings, type MesurerStoredWorkspace, type PagedWorkspaceStore, type PenStroke, type Point$1 as Point, type RulerSettings, type ScreenshotSettings, type ShareMode, type TextAnnotation, type TextFont, TextInspector, type TextInspectorAPI, type TextInspectorOptions, type TextStyleSettings, type TypographyInfo, type TypographyRow, createLocalStoragePersistence, createPageScopedPersistence, createTextInspector, isPagedWorkspaceStore, normalizeStoredSettings, normalizeStoredWorkspace };
package/dist/index.d.ts CHANGED
@@ -8,22 +8,22 @@ type ColorSample = {
8
8
  alpha: number;
9
9
  };
10
10
 
11
- type Point = {
11
+ type Point$1 = {
12
12
  x: number;
13
13
  y: number;
14
14
  };
15
15
  type Arrow = {
16
16
  id: string;
17
- start: Point;
18
- end: Point;
19
- control?: Point;
17
+ start: Point$1;
18
+ end: Point$1;
19
+ control?: Point$1;
20
20
  color: string;
21
21
  width: number;
22
22
  rotation?: number;
23
23
  };
24
24
  type PenStroke = {
25
25
  id: string;
26
- points: Point[];
26
+ points: Point$1[];
27
27
  color: string;
28
28
  width: number;
29
29
  rotation?: number;
@@ -54,8 +54,17 @@ type CommentTarget = {
54
54
  attributes: Record<string, string>;
55
55
  styles: string;
56
56
  rect: Rect;
57
- documentPoint: Point;
58
- anchor?: Point;
57
+ documentPoint: Point$1;
58
+ anchor?: Point$1;
59
+ /** The address of the page the element was on when it was commented on. */
60
+ url?: string;
61
+ /** The size, in CSS px, of the window that page was in. */
62
+ viewport?: {
63
+ width: number;
64
+ height: number;
65
+ };
66
+ /** That window was a responsive preview of this size, not the page itself. */
67
+ preview?: boolean;
59
68
  };
60
69
  type CommentThread = {
61
70
  id: string;
@@ -103,8 +112,8 @@ type DistanceOverlay = {
103
112
  elementRefB?: Element | null;
104
113
  pinTargetRef?: Element | null;
105
114
  pinTargetRect?: Rect | null;
106
- pinCursor?: Point | null;
107
- pinCursorOffset?: Point | null;
115
+ pinCursor?: Point$1 | null;
116
+ pinCursorOffset?: Point$1 | null;
108
117
  horizontal: {
109
118
  x1: number;
110
119
  x2: number;
@@ -139,6 +148,17 @@ type DistanceOverlay = {
139
148
  type ToolMode = "none" | "select" | "selection" | "guides" | "xray" | "rulers" | "arrows" | "pen" | "text" | "comments";
140
149
  type PersistentToolMode = Exclude<ToolMode, "none" | "xray" | "rulers">;
141
150
 
151
+ type Point = {
152
+ x: number;
153
+ y: number;
154
+ };
155
+ type ToolbarPlacement = Point & {
156
+ edge?: ToolbarSide | null;
157
+ align?: DockAlign;
158
+ vertical?: boolean;
159
+ };
160
+ type DockAlign = "start" | "center" | "end";
161
+
142
162
  type TextFont = "handwritten" | "code" | "serif" | "sans-serif";
143
163
  type TextStyleSettings = {
144
164
  font: TextFont;
@@ -164,6 +184,8 @@ declare const MESURER_STORAGE_VERSION = 2;
164
184
  type GuidePattern = "solid" | "dashed" | "dotted";
165
185
  type InfoCardMode = "hover" | "click";
166
186
  type ThemeMode = "system" | "light" | "dark";
187
+ type ToolbarSide = "top" | "bottom" | "left" | "right";
188
+ type ToolbarDock = "free" | "snap";
167
189
  type GuideStyle = {
168
190
  opacity: number;
169
191
  width: number;
@@ -183,10 +205,9 @@ type ScreenshotSettings = {
183
205
  };
184
206
  type MesurerStoredSettings = {
185
207
  lastToolMode?: PersistentToolMode;
186
- toolbarPosition?: {
187
- x: number;
188
- y: number;
189
- };
208
+ toolbarPosition?: ToolbarPlacement;
209
+ toolbarDock?: ToolbarDock;
210
+ toolbarAutoHide?: boolean;
190
211
  highlightColor?: string;
191
212
  guideColor?: string;
192
213
  arrowColor?: string;
@@ -264,6 +285,7 @@ type MesurerFeatures = {
264
285
  screenshot?: boolean;
265
286
  rulers?: boolean;
266
287
  settings?: boolean;
288
+ responsive?: boolean;
267
289
  };
268
290
 
269
291
  type ExtensionRecordingSession = {
@@ -345,7 +367,7 @@ type MesurerProps = {
345
367
  };
346
368
  };
347
369
 
348
- declare function Mesurer({ highlightColor, guideColor, arrowColor, guideHighlightEnabled, hoverHighlightEnabled, layoutDetailsEnabled, persistOnReload, persistSession, shortcutsEnabled, theme, portalTarget, persistKey, colorPickerFormats, colorPickerClickFormat, snapEnabled, snapGuidesEnabled, snapArrowsEnabled, arrowClickToPlace, selectNewGuideEnabled, multiMeasureEnabled, guideStyle, rulerSettings, textStyle, persistence, onPersistenceError, captureVisibleTab, extensionRecording, extensionRecordingPlayer, features, initialState, }: MesurerProps): react_jsx_runtime.JSX.Element | null;
370
+ declare function Mesurer(props: MesurerProps): react_jsx_runtime.JSX.Element;
349
371
 
350
372
  type TypographyRow = {
351
373
  label: string;
@@ -384,4 +406,4 @@ type TextInspectorOptions = {
384
406
  declare const createTextInspector: (options?: TextInspectorOptions, legacy?: boolean) => TextInspectorAPI;
385
407
  declare const TextInspector: TextInspectorAPI;
386
408
 
387
- export { type Arrow, type ColorPickerFormat, type ColorSample, type GuidePattern, type GuideStyle, MESURER_STORAGE_VERSION, Mesurer, type MesurerFeatures, type MesurerPageArtifacts, type MesurerPersistence, type MesurerPersistenceSnapshot, type MesurerProps, type MesurerSessionChrome, type MesurerStoredSettings, type MesurerStoredWorkspace, type PagedWorkspaceStore, type PenStroke, type Point, type RulerSettings, type ScreenshotSettings, type ShareMode, type TextAnnotation, type TextFont, TextInspector, type TextInspectorAPI, type TextInspectorOptions, type TextStyleSettings, type TypographyInfo, type TypographyRow, createLocalStoragePersistence, createPageScopedPersistence, createTextInspector, isPagedWorkspaceStore, normalizeStoredSettings, normalizeStoredWorkspace };
409
+ export { type Arrow, type ColorPickerFormat, type ColorSample, type GuidePattern, type GuideStyle, MESURER_STORAGE_VERSION, Mesurer, type MesurerFeatures, type MesurerPageArtifacts, type MesurerPersistence, type MesurerPersistenceSnapshot, type MesurerProps, type MesurerSessionChrome, type MesurerStoredSettings, type MesurerStoredWorkspace, type PagedWorkspaceStore, type PenStroke, type Point$1 as Point, type RulerSettings, type ScreenshotSettings, type ShareMode, type TextAnnotation, type TextFont, TextInspector, type TextInspectorAPI, type TextInspectorOptions, type TextStyleSettings, type TypographyInfo, type TypographyRow, createLocalStoragePersistence, createPageScopedPersistence, createTextInspector, isPagedWorkspaceStore, normalizeStoredSettings, normalizeStoredWorkspace };