@aznabee/freehand-ui 0.1.1 → 0.1.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/dist/index.d.ts CHANGED
@@ -23,17 +23,33 @@ export type DecorationType =
23
23
 
24
24
  export interface NoteOptions {
25
25
  text: string;
26
- /** Preferred side. Flips automatically if it would run off screen. */
26
+ /**
27
+ * Which side of the element the note sits on. Always honoured — a note that
28
+ * would run off screen slides horizontally to stay in view rather than
29
+ * moving to another side.
30
+ */
27
31
  position?: DoodlePosition;
28
32
  /** Underline sized to the measured text. Default `true`. */
29
33
  underline?: boolean;
34
+ /**
35
+ * Nudge the note from where `position` put it, in px. The note is still kept
36
+ * in view from the offset spot, so a large `x` slides back rather than
37
+ * running off screen.
38
+ */
39
+ offset?: { x?: number; y?: number };
30
40
  }
31
41
 
32
42
  export interface ArrowOptions {
33
- from?: DoodlePosition;
43
+ /**
44
+ * Where the arrow leaves. With a `note` this names a side of *the note* —
45
+ * the arrow always departs from the handwriting and travels to the element,
46
+ * however far an `offset` has moved it. `"note"` (the default) picks the side
47
+ * facing the element. Without a note it names a side of the element instead.
48
+ */
49
+ from?: DoodlePosition | "note";
34
50
  /** `"edge"` lands just outside the frame; `"center"` points into it. */
35
51
  to?: DoodlePosition | "edge";
36
- style?: "curved" | "straight" | "dotted";
52
+ style?: "curved" | "straight" | "dotted" | "looped";
37
53
  }
38
54
 
39
55
  export interface DecorationOptions {
@@ -59,6 +75,7 @@ export interface DoodleOptions {
59
75
  color?: string;
60
76
  strokeWidth?: number;
61
77
  roughness?: number;
78
+ /** Gap between the element's edge and the frame. Default `0`. */
62
79
  padding?: number;
63
80
  /** Auto-detected from CSS when omitted. */
64
81
  radius?: number | null;
@@ -70,6 +87,18 @@ export interface DoodleOptions {
70
87
  decorations?: boolean | DecorationOptions;
71
88
  /** Lift the pen at random points around the outline. */
72
89
  addBreaks?: boolean | number | BreakOptions;
90
+ /**
91
+ * Font stack for handwritten notes. Point this at your own family — a
92
+ * `next/font` CSS variable, for instance — to take over from the built-in one.
93
+ */
94
+ fontFamily?: string | null;
95
+ /**
96
+ * Fetch the Caveat webfont when the page has not already provided it.
97
+ * Default `true`. Set `false` if a strict CSP blocks Google Fonts, or if you
98
+ * self-host the family; the notes then use `fontFamily` or the system
99
+ * handwriting fallbacks.
100
+ */
101
+ autoLoadFont?: boolean;
73
102
  }
74
103
 
75
104
  export interface DoodleInstance {