@useclickly/react 1.0.0 → 1.0.2

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.
Files changed (48) hide show
  1. package/dist/Clickly.d.ts +25 -0
  2. package/dist/Clickly.d.ts.map +1 -0
  3. package/dist/hooks/useDraggable.d.ts +28 -0
  4. package/dist/hooks/useDraggable.d.ts.map +1 -0
  5. package/dist/hooks/usePersistedState.d.ts +6 -0
  6. package/dist/hooks/usePersistedState.d.ts.map +1 -0
  7. package/dist/index.cjs +2667 -386
  8. package/dist/index.d.ts +12 -69
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +2597 -342
  11. package/dist/internal/AnnotationList.d.ts +11 -0
  12. package/dist/internal/AnnotationList.d.ts.map +1 -0
  13. package/dist/internal/AnnotationPins.d.ts +2 -0
  14. package/dist/internal/AnnotationPins.d.ts.map +1 -0
  15. package/dist/internal/AnnotationPopup.d.ts +5 -0
  16. package/dist/internal/AnnotationPopup.d.ts.map +1 -0
  17. package/dist/internal/ClicklyRoot.d.ts +15 -0
  18. package/dist/internal/ClicklyRoot.d.ts.map +1 -0
  19. package/dist/internal/CollapsedFAB.d.ts +10 -0
  20. package/dist/internal/CollapsedFAB.d.ts.map +1 -0
  21. package/dist/internal/SettingsPopover.d.ts +11 -0
  22. package/dist/internal/SettingsPopover.d.ts.map +1 -0
  23. package/dist/internal/Toolbar.d.ts +8 -0
  24. package/dist/internal/Toolbar.d.ts.map +1 -0
  25. package/dist/internal/globalStyles.d.ts +13 -0
  26. package/dist/internal/globalStyles.d.ts.map +1 -0
  27. package/dist/internal/icons.d.ts +12 -0
  28. package/dist/internal/icons.d.ts.map +1 -0
  29. package/dist/internal/styles.d.ts +7 -0
  30. package/dist/internal/styles.d.ts.map +1 -0
  31. package/dist/output/markdown.d.ts +5 -0
  32. package/dist/output/markdown.d.ts.map +1 -0
  33. package/dist/output/markdown.test.d.ts +2 -0
  34. package/dist/output/markdown.test.d.ts.map +1 -0
  35. package/dist/state/annotations.d.ts +21 -0
  36. package/dist/state/annotations.d.ts.map +1 -0
  37. package/dist/state/annotations.test.d.ts +2 -0
  38. package/dist/state/annotations.test.d.ts.map +1 -0
  39. package/dist/state/settings.d.ts +14 -0
  40. package/dist/state/settings.d.ts.map +1 -0
  41. package/dist/state/settings.test.d.ts +2 -0
  42. package/dist/state/settings.test.d.ts.map +1 -0
  43. package/dist/state/useEngineState.d.ts +7 -0
  44. package/dist/state/useEngineState.d.ts.map +1 -0
  45. package/dist/test/setup.d.ts +7 -0
  46. package/dist/test/setup.d.ts.map +1 -0
  47. package/package.json +12 -12
  48. package/LICENSE +0 -21
package/dist/index.d.ts CHANGED
@@ -1,72 +1,15 @@
1
- import * as react from 'react';
2
- import * as zustand from 'zustand';
3
- import { Annotation } from '@useclickly/core';
4
- export { Annotation, AnnotationKind, AnnotationStatus, ScreenshotData } from '@useclickly/core';
5
-
6
- interface ClicklyProps {
7
- /** Custom class on the host element (for z-index / positioning overrides). */
8
- className?: string;
9
- /** Optional MCP server endpoint, e.g. "http://localhost:4747". */
10
- endpoint?: string;
11
- /** Join an existing MCP session by ID. */
12
- sessionId?: string;
13
- onAnnotationAdd?: (id: string) => void;
14
- onAnnotationDelete?: (id: string) => void;
15
- onAnnotationsClear?: () => void;
16
- onCopy?: (markdown: string) => void;
17
- onSessionCreated?: (sessionId: string) => void;
18
- }
19
1
  /**
20
- * Mount once near the root of your React app. Dev-only by convention:
2
+ * @useclickly/react public surface
21
3
  *
22
- * ```tsx
23
- * {process.env.NODE_ENV === "development" && <Clickly />}
24
- * ```
25
- *
26
- * Renders a small floating button (FAB) in the bottom-right corner.
27
- * Click it (or press `⌘/Ctrl+Shift+F`) to open the full toolbar.
28
- */
29
- declare function Clickly({ className }?: ClicklyProps): react.ReactPortal | null;
30
-
31
- interface AnnotationsStore {
32
- byId: Record<string, Annotation>;
33
- order: string[];
34
- add: (a: Annotation) => void;
35
- remove: (id: string) => void;
36
- update: (id: string, patch: Partial<Annotation>) => void;
37
- clear: () => void;
38
- /** Imperative read. Hooks should use `useAnnotationsList()` instead. */
39
- list: () => Annotation[];
40
- }
41
- declare const useAnnotations: zustand.UseBoundStore<zustand.StoreApi<AnnotationsStore>>;
42
- /**
43
- * Subscribe to the annotation list with shallow equality — re-renders
44
- * only when items add/remove/reorder/update. Always use this from
45
- * component code; never call `useAnnotations(s => s.list())`, which
46
- * returns a new array reference on every store change and infinite-loops
47
- * `useSyncExternalStore`.
48
- */
49
- declare function useAnnotationsList(): Annotation[];
50
-
51
- type OutputDetail = "compact" | "standard" | "detailed" | "forensic";
52
- interface Settings {
53
- outputDetail: OutputDetail;
54
- copyOnAdd: boolean;
55
- showReactComponents: boolean;
56
- markerColor: string;
57
- }
58
- interface SettingsStore extends Settings {
59
- set: (patch: Partial<Settings>) => void;
60
- reset: () => void;
61
- }
62
- declare const DEFAULTS: Settings;
63
- declare const useSettings: zustand.UseBoundStore<zustand.StoreApi<SettingsStore>>;
64
-
65
- /**
66
- * Phase 5 placeholder formatter — Phase 9 adds the React + Source lines
67
- * when those fields are populated. Phase 8 replaces the whole thing with
68
- * a full AFS-compliant implementation.
4
+ * The single export is `<Clickly />`. Stores and types are also
5
+ * re-exported for advanced integrations.
69
6
  */
70
- declare function annotationsToMarkdown(annotations: Annotation[], detail?: OutputDetail): string;
71
-
72
- export { type AnnotationsStore, Clickly, type ClicklyProps, DEFAULTS as DEFAULT_SETTINGS, type OutputDetail, type Settings, type SettingsStore, annotationsToMarkdown, useAnnotations, useAnnotationsList, useSettings };
7
+ export { Clickly } from "./Clickly";
8
+ export type { ClicklyProps } from "./Clickly";
9
+ export { useAnnotations, useAnnotationsList } from "./state/annotations";
10
+ export { useSettings, DEFAULTS as DEFAULT_SETTINGS } from "./state/settings";
11
+ export type { AnnotationsStore } from "./state/annotations";
12
+ export type { Settings, SettingsStore, OutputDetail } from "./state/settings";
13
+ export { annotationsToMarkdown } from "./output/markdown";
14
+ export type { Annotation, AnnotationStatus, AnnotationKind, ScreenshotData, } from "@useclickly/core";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,cAAc,GACf,MAAM,kBAAkB,CAAC"}