@objectifthunes/whiteboard 0.4.0 → 0.5.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/README.md +5 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +707 -604
- package/dist/whiteboard.css +26 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,6 +68,11 @@ Every component is driven by `--wb-*` CSS custom properties. Override on `:root`
|
|
|
68
68
|
|
|
69
69
|
See the live demo for the full prop reference and copy-pasteable examples per component.
|
|
70
70
|
|
|
71
|
+
## New in 0.5
|
|
72
|
+
|
|
73
|
+
- **`Draggable` / `DraggableSurface`** — screen-space dragging for overlay chrome, no `WhiteboardShell` required. Keep your CSS anchoring; the drag is a `translate()` delta on top, so layouts stay responsive. Drags from any non-interactive area, snaps to the whiteboard grid on release, honours the global `whiteboard-snap-now` event, persists per `id` in localStorage. Double-click resets one element; `resetDraggables()` resets all.
|
|
74
|
+
- `Toolbar` reads slightly larger (roomier padding, `--wb-fs-md` buttons) — it's app chrome, not a panel row.
|
|
75
|
+
|
|
71
76
|
## New in 0.4
|
|
72
77
|
|
|
73
78
|
Battle-tested additions from building a real app on the kit:
|
package/dist/index.d.ts
CHANGED
|
@@ -194,6 +194,40 @@ declare interface DividerProps extends HTMLAttributes<HTMLElement> {
|
|
|
194
194
|
orientation?: 'horizontal' | 'vertical';
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Screen-space dragging for overlay chrome — toolbars, legends, log
|
|
199
|
+
* panes — WITHOUT a WhiteboardShell. Keep your CSS anchoring (top/right/
|
|
200
|
+
* bottom/left, even percentage centring on a parent): the drag is a
|
|
201
|
+
* translate() delta on top of it, so layouts stay responsive and reset
|
|
202
|
+
* is just "delta = 0".
|
|
203
|
+
*
|
|
204
|
+
* - drags from any non-interactive area (inputs, buttons, canvases keep
|
|
205
|
+
* their own pointer behaviour)
|
|
206
|
+
* - snaps to WHITEBOARD_GRID on release; honours the global
|
|
207
|
+
* `whiteboard-snap-now` event dispatched by ZoomBar
|
|
208
|
+
* - double-click an empty area to reset one element;
|
|
209
|
+
* `resetDraggables()` resets them all
|
|
210
|
+
* - position persists per `id` in localStorage
|
|
211
|
+
*/
|
|
212
|
+
export declare function Draggable({ id, snap, persist, disabled, className, style, children, ...props }: DraggableProps): JSX_2.Element;
|
|
213
|
+
|
|
214
|
+
declare interface DraggableProps extends HTMLAttributes<HTMLDivElement> {
|
|
215
|
+
/** Stable id — keys persistence and the reset registry. */
|
|
216
|
+
id: string;
|
|
217
|
+
/** Snap the offset to the whiteboard grid on release. Default true. */
|
|
218
|
+
snap?: boolean;
|
|
219
|
+
/** Remember the offset in localStorage. Default true. */
|
|
220
|
+
persist?: boolean;
|
|
221
|
+
disabled?: boolean;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** A Surface you can drag — the overlay-panel workhorse. */
|
|
225
|
+
export declare function DraggableSurface({ padding, className, ...props }: DraggableSurfaceProps): JSX_2.Element;
|
|
226
|
+
|
|
227
|
+
declare interface DraggableSurfaceProps extends DraggableProps {
|
|
228
|
+
padding?: 'none' | 'sm' | 'md';
|
|
229
|
+
}
|
|
230
|
+
|
|
197
231
|
export declare function EmptyState({ title, description, action }: EmptyStateProps): JSX_2.Element;
|
|
198
232
|
|
|
199
233
|
declare interface EmptyStateProps {
|
|
@@ -495,6 +529,9 @@ declare interface Props_6 {
|
|
|
495
529
|
fallbackMessage?: string;
|
|
496
530
|
}
|
|
497
531
|
|
|
532
|
+
/** Snap every Draggable back to its anchored position (and clear persistence). */
|
|
533
|
+
export declare function resetDraggables(): void;
|
|
534
|
+
|
|
498
535
|
export declare function SectionDescription({ as, className, ...props }: TypographyProps): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
499
536
|
|
|
500
537
|
export declare function SectionTitle({ as, className, ...props }: TypographyProps): ReactElement<any, string | JSXElementConstructor<any>>;
|