made-refine 0.2.1-beta.2 → 0.2.3

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/README.md CHANGED
@@ -55,4 +55,4 @@ Your app keeps running normally. The editor floats on top and never touches your
55
55
 
56
56
  ## License
57
57
 
58
- [FSL-1.1-MIT](./LICENSE)
58
+ [FSL-1.1-MIT](./LICENSE.md)
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { D as DragState, a as DropIndicator, S as SpacingPropertyKey, C as CSSPropertyValue, B as BorderRadiusPropertyKey, b as BorderPropertyKey, c as BorderProperties, F as FlexPropertyKey, d as SizingPropertyKey, e as SizingValue, f as ColorPropertyKey, g as ColorValue, T as TypographyPropertyKey, A as ActiveTool, h as Theme, i as BorderStyleControlPreference, j as DirectEditState, k as SessionEdit, l as SessionItem, m as TypographyProperties, M as MeasurementLine, G as Guideline, n as Comment } from './utils-BHGlXxF7.mjs';
4
- export { o as BorderRadiusProperties, p as BorderStyle, q as ColorProperties, r as CommentReply, s as DomSourceLocation, t as DropTarget, E as ElementInfo, u as ElementLocator, v as FlexProperties, w as MeasurementState, R as ReactComponentFrame, x as SizingMode, y as SizingProperties, z as SpacingProperties, U as UndoEditEntry, H as UndoEntry, I as UndoMoveEntry, J as UndoSelectionEntry, K as buildCommentExport, L as buildSessionExport, N as calculateDropPosition, O as calculateElementMeasurements, P as calculateGuidelineMeasurements, Q as calculateParentMeasurements, V as colorToTailwind, W as elementFromPointWithoutOverlays, X as findContainerAtPoint, Y as formatPropertyValue, Z as getComputedBorderStyles, _ as getComputedBoxShadow, $ as getComputedColorStyles, a0 as getComputedStyles, a1 as getDimensionDisplay, a2 as getElementInfo, a3 as getElementLocator, a4 as getFlexDirection, a5 as isFlexContainer, a6 as parseColorValue, a7 as parsePropertyValue, a8 as stylesToTailwind } from './utils-BHGlXxF7.mjs';
3
+ import { D as DragState, a as DropIndicator, S as SpacingPropertyKey, C as CSSPropertyValue, B as BorderRadiusPropertyKey, b as BorderPropertyKey, c as BorderProperties, F as FlexPropertyKey, d as SizingPropertyKey, e as SizingValue, f as ColorPropertyKey, g as ColorValue, T as TypographyPropertyKey, A as ActiveTool, h as Theme, i as BorderStyleControlPreference, j as DirectEditState, k as SessionEdit, l as SessionItem, m as TypographyProperties, M as MeasurementLine, G as Guideline, n as Comment } from './utils-C7RBdUAE.mjs';
4
+ export { o as BorderRadiusProperties, p as BorderStyle, q as ColorProperties, r as CommentReply, s as DomSourceLocation, t as DropTarget, E as ElementInfo, u as ElementLocator, v as FlexProperties, w as MeasurementState, R as ReactComponentFrame, x as SizingMode, y as SizingProperties, z as SpacingProperties, U as UndoEditEntry, H as UndoEntry, I as UndoMoveEntry, J as UndoSelectionEntry, K as buildCommentExport, L as buildSessionExport, N as calculateDropPosition, O as calculateElementMeasurements, P as calculateGuidelineMeasurements, Q as calculateParentMeasurements, V as colorToTailwind, W as elementFromPointWithoutOverlays, X as findContainerAtPoint, Y as formatPropertyValue, Z as getComputedBorderStyles, _ as getComputedBoxShadow, $ as getComputedColorStyles, a0 as getComputedStyles, a1 as getDimensionDisplay, a2 as getElementInfo, a3 as getElementLocator, a4 as getFlexDirection, a5 as isFlexContainer, a6 as parseColorValue, a7 as parsePropertyValue, a8 as stylesToTailwind } from './utils-C7RBdUAE.mjs';
5
5
 
6
6
  declare function DirectEdit(): react_jsx_runtime.JSX.Element;
7
7
 
@@ -78,6 +78,10 @@ interface DirectEditActionsContextValue {
78
78
  removeSessionEdit: (element: HTMLElement) => void;
79
79
  startTextEditing: (element: HTMLElement) => void;
80
80
  commitTextEditing: () => void;
81
+ toggleCanvas: () => void;
82
+ setCanvasZoom: (zoom: number) => void;
83
+ fitCanvasToViewport: () => void;
84
+ zoomCanvasTo100: () => void;
81
85
  }
82
86
  interface DirectEditStateContextValue extends DirectEditState {
83
87
  sessionEditCount: number;
@@ -186,8 +190,14 @@ interface DirectEditToolbarInnerProps {
186
190
  onRemoveSessionEdit?: (element: HTMLElement) => void;
187
191
  onDeleteComment?: (id: string) => void;
188
192
  className?: string;
193
+ canvasActive?: boolean;
194
+ canvasZoom?: number;
195
+ onToggleCanvas?: () => void;
196
+ onSetCanvasZoom?: (zoom: number) => void;
197
+ onZoomTo100?: () => void;
198
+ onFitToViewport?: () => void;
189
199
  }
190
- declare function DirectEditToolbarInner({ editModeActive, onToggleEditMode, rulersVisible, onToggleRulers, activeTool, onSetActiveTool, theme, onSetTheme, sessionEditCount, onGetSessionItems, onExportAllEdits, onSendAllToAgents, onClearSessionEdits, onRemoveSessionEdit, onDeleteComment, className, }: DirectEditToolbarInnerProps): react_jsx_runtime.JSX.Element;
200
+ declare function DirectEditToolbarInner({ editModeActive, onToggleEditMode, rulersVisible, onToggleRulers, activeTool, onSetActiveTool, theme, onSetTheme, sessionEditCount, onGetSessionItems, onExportAllEdits, onSendAllToAgents, onClearSessionEdits, onRemoveSessionEdit, onDeleteComment, className, canvasActive, canvasZoom, onToggleCanvas, onSetCanvasZoom, onZoomTo100, onFitToViewport, }: DirectEditToolbarInnerProps): react_jsx_runtime.JSX.Element;
191
201
  declare function DirectEditToolbar(): react_jsx_runtime.JSX.Element | null;
192
202
 
193
203
  interface UseMeasurementResult {
@@ -221,12 +231,13 @@ interface SelectionOverlayProps {
221
231
  };
222
232
  onMoveStart: (e: React.PointerEvent, targetElement?: HTMLElement, options?: MoveStartOptions) => void;
223
233
  showMoveHandle?: boolean;
234
+ activeTool?: ActiveTool;
224
235
  isTextEditing?: boolean;
225
236
  onDoubleClick?: (clientX: number, clientY: number) => void;
226
237
  onHoverElement?: (element: HTMLElement | null) => void;
227
238
  onClickThrough?: (clientX: number, clientY: number) => void;
228
239
  }
229
- declare function SelectionOverlay({ selectedElement, draggedElement, isDragging, ghostPosition, onMoveStart, showMoveHandle, isTextEditing, onDoubleClick, onHoverElement, onClickThrough, }: SelectionOverlayProps): react_jsx_runtime.JSX.Element;
240
+ declare function SelectionOverlay({ selectedElement, draggedElement, isDragging, ghostPosition, onMoveStart, showMoveHandle, activeTool, isTextEditing, onDoubleClick, onHoverElement, onClickThrough, }: SelectionOverlayProps): react_jsx_runtime.JSX.Element;
230
241
 
231
242
  interface MoveOverlayProps {
232
243
  dropIndicator: DropIndicator | null;
@@ -244,6 +255,7 @@ interface UseGuidelinesResult {
244
255
  activeGuideline: Guideline | null;
245
256
  dragPosition: number | null;
246
257
  isCreating: boolean;
258
+ isSnapped: boolean;
247
259
  scrollOffset: {
248
260
  x: number;
249
261
  y: number;
@@ -254,7 +266,12 @@ interface UseGuidelinesResult {
254
266
  clearAll: () => void;
255
267
  }
256
268
  declare function getStoredGuidelines(): Guideline[];
257
- declare function useGuidelines(enabled: boolean, hostElement?: HTMLElement | null): UseGuidelinesResult;
269
+ declare function useGuidelines(enabled: boolean, hostElement?: HTMLElement | null, canvas?: {
270
+ active: boolean;
271
+ zoom: number;
272
+ panX: number;
273
+ panY: number;
274
+ } | null): UseGuidelinesResult;
258
275
 
259
276
  interface CommentOverlayProps {
260
277
  comments: Comment[];
@@ -269,8 +286,9 @@ interface CommentOverlayProps {
269
286
  commentId: string;
270
287
  nonce: number;
271
288
  } | null;
289
+ draftRef?: React.MutableRefObject<string>;
272
290
  }
273
- declare function CommentOverlay({ comments, activeCommentId, onSetActiveComment, onUpdateText, onAddReply, onDelete, onExport, onSendToAgent, attentionRequest, }: CommentOverlayProps): react_jsx_runtime.JSX.Element | null;
291
+ declare function CommentOverlay({ comments, activeCommentId, onSetActiveComment, onUpdateText, onAddReply, onDelete, onExport, onSendToAgent, attentionRequest, draftRef, }: CommentOverlayProps): react_jsx_runtime.JSX.Element | null;
274
292
 
275
293
  declare function formatColorValue(color: ColorValue): string;
276
294
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { D as DragState, a as DropIndicator, S as SpacingPropertyKey, C as CSSPropertyValue, B as BorderRadiusPropertyKey, b as BorderPropertyKey, c as BorderProperties, F as FlexPropertyKey, d as SizingPropertyKey, e as SizingValue, f as ColorPropertyKey, g as ColorValue, T as TypographyPropertyKey, A as ActiveTool, h as Theme, i as BorderStyleControlPreference, j as DirectEditState, k as SessionEdit, l as SessionItem, m as TypographyProperties, M as MeasurementLine, G as Guideline, n as Comment } from './utils-BHGlXxF7.js';
4
- export { o as BorderRadiusProperties, p as BorderStyle, q as ColorProperties, r as CommentReply, s as DomSourceLocation, t as DropTarget, E as ElementInfo, u as ElementLocator, v as FlexProperties, w as MeasurementState, R as ReactComponentFrame, x as SizingMode, y as SizingProperties, z as SpacingProperties, U as UndoEditEntry, H as UndoEntry, I as UndoMoveEntry, J as UndoSelectionEntry, K as buildCommentExport, L as buildSessionExport, N as calculateDropPosition, O as calculateElementMeasurements, P as calculateGuidelineMeasurements, Q as calculateParentMeasurements, V as colorToTailwind, W as elementFromPointWithoutOverlays, X as findContainerAtPoint, Y as formatPropertyValue, Z as getComputedBorderStyles, _ as getComputedBoxShadow, $ as getComputedColorStyles, a0 as getComputedStyles, a1 as getDimensionDisplay, a2 as getElementInfo, a3 as getElementLocator, a4 as getFlexDirection, a5 as isFlexContainer, a6 as parseColorValue, a7 as parsePropertyValue, a8 as stylesToTailwind } from './utils-BHGlXxF7.js';
3
+ import { D as DragState, a as DropIndicator, S as SpacingPropertyKey, C as CSSPropertyValue, B as BorderRadiusPropertyKey, b as BorderPropertyKey, c as BorderProperties, F as FlexPropertyKey, d as SizingPropertyKey, e as SizingValue, f as ColorPropertyKey, g as ColorValue, T as TypographyPropertyKey, A as ActiveTool, h as Theme, i as BorderStyleControlPreference, j as DirectEditState, k as SessionEdit, l as SessionItem, m as TypographyProperties, M as MeasurementLine, G as Guideline, n as Comment } from './utils-C7RBdUAE.js';
4
+ export { o as BorderRadiusProperties, p as BorderStyle, q as ColorProperties, r as CommentReply, s as DomSourceLocation, t as DropTarget, E as ElementInfo, u as ElementLocator, v as FlexProperties, w as MeasurementState, R as ReactComponentFrame, x as SizingMode, y as SizingProperties, z as SpacingProperties, U as UndoEditEntry, H as UndoEntry, I as UndoMoveEntry, J as UndoSelectionEntry, K as buildCommentExport, L as buildSessionExport, N as calculateDropPosition, O as calculateElementMeasurements, P as calculateGuidelineMeasurements, Q as calculateParentMeasurements, V as colorToTailwind, W as elementFromPointWithoutOverlays, X as findContainerAtPoint, Y as formatPropertyValue, Z as getComputedBorderStyles, _ as getComputedBoxShadow, $ as getComputedColorStyles, a0 as getComputedStyles, a1 as getDimensionDisplay, a2 as getElementInfo, a3 as getElementLocator, a4 as getFlexDirection, a5 as isFlexContainer, a6 as parseColorValue, a7 as parsePropertyValue, a8 as stylesToTailwind } from './utils-C7RBdUAE.js';
5
5
 
6
6
  declare function DirectEdit(): react_jsx_runtime.JSX.Element;
7
7
 
@@ -78,6 +78,10 @@ interface DirectEditActionsContextValue {
78
78
  removeSessionEdit: (element: HTMLElement) => void;
79
79
  startTextEditing: (element: HTMLElement) => void;
80
80
  commitTextEditing: () => void;
81
+ toggleCanvas: () => void;
82
+ setCanvasZoom: (zoom: number) => void;
83
+ fitCanvasToViewport: () => void;
84
+ zoomCanvasTo100: () => void;
81
85
  }
82
86
  interface DirectEditStateContextValue extends DirectEditState {
83
87
  sessionEditCount: number;
@@ -186,8 +190,14 @@ interface DirectEditToolbarInnerProps {
186
190
  onRemoveSessionEdit?: (element: HTMLElement) => void;
187
191
  onDeleteComment?: (id: string) => void;
188
192
  className?: string;
193
+ canvasActive?: boolean;
194
+ canvasZoom?: number;
195
+ onToggleCanvas?: () => void;
196
+ onSetCanvasZoom?: (zoom: number) => void;
197
+ onZoomTo100?: () => void;
198
+ onFitToViewport?: () => void;
189
199
  }
190
- declare function DirectEditToolbarInner({ editModeActive, onToggleEditMode, rulersVisible, onToggleRulers, activeTool, onSetActiveTool, theme, onSetTheme, sessionEditCount, onGetSessionItems, onExportAllEdits, onSendAllToAgents, onClearSessionEdits, onRemoveSessionEdit, onDeleteComment, className, }: DirectEditToolbarInnerProps): react_jsx_runtime.JSX.Element;
200
+ declare function DirectEditToolbarInner({ editModeActive, onToggleEditMode, rulersVisible, onToggleRulers, activeTool, onSetActiveTool, theme, onSetTheme, sessionEditCount, onGetSessionItems, onExportAllEdits, onSendAllToAgents, onClearSessionEdits, onRemoveSessionEdit, onDeleteComment, className, canvasActive, canvasZoom, onToggleCanvas, onSetCanvasZoom, onZoomTo100, onFitToViewport, }: DirectEditToolbarInnerProps): react_jsx_runtime.JSX.Element;
191
201
  declare function DirectEditToolbar(): react_jsx_runtime.JSX.Element | null;
192
202
 
193
203
  interface UseMeasurementResult {
@@ -221,12 +231,13 @@ interface SelectionOverlayProps {
221
231
  };
222
232
  onMoveStart: (e: React.PointerEvent, targetElement?: HTMLElement, options?: MoveStartOptions) => void;
223
233
  showMoveHandle?: boolean;
234
+ activeTool?: ActiveTool;
224
235
  isTextEditing?: boolean;
225
236
  onDoubleClick?: (clientX: number, clientY: number) => void;
226
237
  onHoverElement?: (element: HTMLElement | null) => void;
227
238
  onClickThrough?: (clientX: number, clientY: number) => void;
228
239
  }
229
- declare function SelectionOverlay({ selectedElement, draggedElement, isDragging, ghostPosition, onMoveStart, showMoveHandle, isTextEditing, onDoubleClick, onHoverElement, onClickThrough, }: SelectionOverlayProps): react_jsx_runtime.JSX.Element;
240
+ declare function SelectionOverlay({ selectedElement, draggedElement, isDragging, ghostPosition, onMoveStart, showMoveHandle, activeTool, isTextEditing, onDoubleClick, onHoverElement, onClickThrough, }: SelectionOverlayProps): react_jsx_runtime.JSX.Element;
230
241
 
231
242
  interface MoveOverlayProps {
232
243
  dropIndicator: DropIndicator | null;
@@ -244,6 +255,7 @@ interface UseGuidelinesResult {
244
255
  activeGuideline: Guideline | null;
245
256
  dragPosition: number | null;
246
257
  isCreating: boolean;
258
+ isSnapped: boolean;
247
259
  scrollOffset: {
248
260
  x: number;
249
261
  y: number;
@@ -254,7 +266,12 @@ interface UseGuidelinesResult {
254
266
  clearAll: () => void;
255
267
  }
256
268
  declare function getStoredGuidelines(): Guideline[];
257
- declare function useGuidelines(enabled: boolean, hostElement?: HTMLElement | null): UseGuidelinesResult;
269
+ declare function useGuidelines(enabled: boolean, hostElement?: HTMLElement | null, canvas?: {
270
+ active: boolean;
271
+ zoom: number;
272
+ panX: number;
273
+ panY: number;
274
+ } | null): UseGuidelinesResult;
258
275
 
259
276
  interface CommentOverlayProps {
260
277
  comments: Comment[];
@@ -269,8 +286,9 @@ interface CommentOverlayProps {
269
286
  commentId: string;
270
287
  nonce: number;
271
288
  } | null;
289
+ draftRef?: React.MutableRefObject<string>;
272
290
  }
273
- declare function CommentOverlay({ comments, activeCommentId, onSetActiveComment, onUpdateText, onAddReply, onDelete, onExport, onSendToAgent, attentionRequest, }: CommentOverlayProps): react_jsx_runtime.JSX.Element | null;
291
+ declare function CommentOverlay({ comments, activeCommentId, onSetActiveComment, onUpdateText, onAddReply, onDelete, onExport, onSendToAgent, attentionRequest, draftRef, }: CommentOverlayProps): react_jsx_runtime.JSX.Element | null;
274
292
 
275
293
  declare function formatColorValue(color: ColorValue): string;
276
294