@aznabee/freehand-ui 0.1.8 → 0.2.1
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 +35 -1
- package/dist/freehand-ui.cjs +14 -9
- package/dist/freehand-ui.js +14 -9
- package/dist/native.cjs +2422 -0
- package/dist/native.d.ts +51 -0
- package/dist/native.js +2428 -0
- package/dist/react.cjs +14 -9
- package/dist/react.js +14 -9
- package/native/package.json +7 -0
- package/package.json +18 -2
- package/react/package.json +7 -0
package/dist/native.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode, Ref } from "react";
|
|
2
|
+
import type { View, ViewProps } from "react-native";
|
|
3
|
+
import type { DoodleOptions } from "./index";
|
|
4
|
+
|
|
5
|
+
export type {
|
|
6
|
+
DoodleOptions,
|
|
7
|
+
DoodlePosition,
|
|
8
|
+
DecorationType,
|
|
9
|
+
LocalizedText,
|
|
10
|
+
NoteOptions,
|
|
11
|
+
ArrowOptions,
|
|
12
|
+
ArrowAnimationOptions,
|
|
13
|
+
DecorationOptions,
|
|
14
|
+
BreakOptions,
|
|
15
|
+
} from "./index";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `children` (a selector on the web) has no native equivalent, and fonts are
|
|
19
|
+
* never fetched. `fontFamily` names a font linked into the app; omitted, notes
|
|
20
|
+
* use the platform's own handwriting face - Noteworthy on iOS, `casual` on
|
|
21
|
+
* Android.
|
|
22
|
+
*/
|
|
23
|
+
type NativeDoodleOptions = Omit<DoodleOptions, "children">;
|
|
24
|
+
|
|
25
|
+
export interface DoodleProps extends NativeDoodleOptions, ViewProps {
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
/** Skip drawing entirely - useful for feature flags or hiding the notes. */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
ref?: Ref<View>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Wrap any React Native view in a hand-drawn doodle layer.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import Doodle from "@aznabee/freehand-ui/native";
|
|
37
|
+
*
|
|
38
|
+
* <Doodle note="start chat" arrow decorations>
|
|
39
|
+
* <Button />
|
|
40
|
+
* </Doodle>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* The wrapper is a plain `View`; the doodle is drawn with react-native-svg in
|
|
44
|
+
* a touch-transparent layer that never affects layout, but is clipped by an
|
|
45
|
+
* ancestor with `overflow: "hidden"`. The corner radius is taken from `radius`
|
|
46
|
+
* or the wrapper's own `borderRadius` style.
|
|
47
|
+
*/
|
|
48
|
+
declare const Doodle: (props: DoodleProps) => ReactElement;
|
|
49
|
+
|
|
50
|
+
export default Doodle;
|
|
51
|
+
export { Doodle };
|