@np-dev/ui-ai-anotation 0.1.0 → 0.1.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.
Files changed (36) hide show
  1. package/README.md +106 -21
  2. package/dist/cjs/index.cjs +247 -14
  3. package/dist/cjs/index.cjs.map +4 -4
  4. package/dist/cjs/index.native.cjs +11 -11
  5. package/dist/cjs/index.native.cjs.map +3 -3
  6. package/dist/cjs/index.web.cjs +5 -5
  7. package/dist/cjs/index.web.cjs.map +2 -2
  8. package/dist/esm/index.js +248 -14
  9. package/dist/esm/index.js.map +4 -4
  10. package/dist/esm/index.native.js +11 -11
  11. package/dist/esm/index.native.js.map +3 -3
  12. package/dist/esm/index.web.js +5 -5
  13. package/dist/esm/index.web.js.map +2 -2
  14. package/dist/types/components/ErrorBoundary.d.ts +159 -0
  15. package/dist/types/index.d.ts +5 -3
  16. package/dist/types/index.web.d.ts +2 -2
  17. package/dist/types/store.d.ts +2 -2
  18. package/package.json +1 -1
  19. package/src/components/AnnotationInput.tsx +2 -2
  20. package/src/components/AnnotationList.tsx +2 -2
  21. package/src/components/ErrorBoundary.tsx +426 -0
  22. package/src/components/Highlighter.tsx +2 -2
  23. package/src/components/Toolbar.tsx +4 -3
  24. package/src/components/native/AnnotationInput.tsx +2 -2
  25. package/src/components/native/AnnotationList.tsx +2 -2
  26. package/src/components/native/Highlighter.tsx +2 -2
  27. package/src/components/native/Toolbar.tsx +2 -2
  28. package/src/components/web/AnnotationInput.tsx +2 -2
  29. package/src/components/web/AnnotationList.tsx +2 -2
  30. package/src/components/web/Highlighter.tsx +2 -2
  31. package/src/components/web/Toolbar.tsx +2 -2
  32. package/src/extension.tsx +1 -1
  33. package/src/index.native.tsx +4 -4
  34. package/src/index.tsx +6 -4
  35. package/src/index.web.tsx +3 -3
  36. package/src/store.tsx +3 -3
package/src/index.tsx CHANGED
@@ -1,16 +1,16 @@
1
1
  import React from 'react';
2
- import { AiAnnotationProvider as Provider } from './store';
2
+ import { AgentAnnotationProvider as Provider } from './store';
3
3
  import { Toolbar } from './components/Toolbar';
4
4
 
5
- export interface AiAnnotationProviderProps {
5
+ export interface AgentAnnotationProviderProps {
6
6
  children: React.ReactNode;
7
7
  }
8
8
 
9
9
  /**
10
- * Web AI Annotation Provider
10
+ * Web Agent Annotation Provider
11
11
  * Wraps your app to provide annotation functionality
12
12
  */
13
- export function AiAnnotationProvider({ children }: AiAnnotationProviderProps) {
13
+ export function AgentAnnotationProvider({ children }: AgentAnnotationProviderProps) {
14
14
  return (
15
15
  <Provider>
16
16
  {children}
@@ -28,6 +28,8 @@ export { Highlighter } from './components/Highlighter';
28
28
  export { AnnotationInput } from './components/AnnotationInput';
29
29
  export { AnnotationList } from './components/AnnotationList';
30
30
  export { Draggable } from './components/Draggable';
31
+ export { ErrorBoundary } from './components/ErrorBoundary';
32
+ export type { ErrorBoundaryProps, ErrorInfo, FallbackProps, ErrorButtonConfig } from './components/ErrorBoundary';
31
33
 
32
34
  // Export screenshot utility
33
35
  export { captureScreenshot } from './utils/screenshot';
package/src/index.web.tsx CHANGED
@@ -105,7 +105,7 @@ function reducer(state: State, action: Action): State {
105
105
  }
106
106
  }
107
107
 
108
- export function AiAnnotationProvider({ children }: { children: ReactNode }) {
108
+ export function AgentAnnotationProvider({ children }: { children: ReactNode }) {
109
109
  const [state, dispatch] = useReducer(reducer, initialState);
110
110
 
111
111
  return (
@@ -115,10 +115,10 @@ export function AiAnnotationProvider({ children }: { children: ReactNode }) {
115
115
  );
116
116
  }
117
117
 
118
- export function useAiAnnotation() {
118
+ export function useAgentAnnotation() {
119
119
  const context = useContext(AnnotationContext);
120
120
  if (!context) {
121
- throw new Error('useAiAnnotation must be used within an AiAnnotationProvider');
121
+ throw new Error('useAgentAnnotation must be used within an AgentAnnotationProvider');
122
122
  }
123
123
  return context;
124
124
  }
package/src/store.tsx CHANGED
@@ -101,7 +101,7 @@ function reducer(state: State, action: Action): State {
101
101
  }
102
102
  }
103
103
 
104
- export function AiAnnotationProvider({ children }: { children: ReactNode }) {
104
+ export function AgentAnnotationProvider({ children }: { children: ReactNode }) {
105
105
  const [state, dispatch] = useReducer(reducer, initialState);
106
106
 
107
107
  return (
@@ -111,10 +111,10 @@ export function AiAnnotationProvider({ children }: { children: ReactNode }) {
111
111
  );
112
112
  }
113
113
 
114
- export function useAiAnnotation() {
114
+ export function useAgentAnnotation() {
115
115
  const context = useContext(AnnotationContext);
116
116
  if (!context) {
117
- throw new Error('useAiAnnotation must be used within an AiAnnotationProvider');
117
+ throw new Error('useAgentAnnotation must be used within an AgentAnnotationProvider');
118
118
  }
119
119
  return context;
120
120
  }