@framed-dev/react 0.0.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 +126 -0
- package/dist/index.cjs +6989 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +264 -0
- package/dist/index.d.ts +264 -0
- package/dist/index.js +6975 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { FramedConfig, Session, WidgetDataLayer, Task, LimitStatus, WidgetFeatures, AuthConfig, FeedbackComment, TaskStatus, SyncResult } from '@framed/core';
|
|
2
|
+
export { AIConfig, AnnotationData, AnnotationMode, Assignment, Attachment, AuthConfig, AuthMode, Comment, ElementInfo, FeedbackComment, FeedbackInfo, FramedConfig, LimitStatus, Mention, PageInfo, PendingAttachment, Position, Session, SyncConfig, SyncResult, Task, TaskInfo, TaskStatus, TaskType, UsageLimits, ViewportMode, WidgetConfig, WidgetDataLayer, WidgetFeatures } from '@framed/core';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
type WidgetVersion = 'latest' | 'v3' | string;
|
|
7
|
+
type WidgetSource = 'cdn' | 'bundled';
|
|
8
|
+
interface FramedProviderConfig extends FramedConfig {
|
|
9
|
+
widgetVersion?: WidgetVersion;
|
|
10
|
+
widgetSource?: WidgetSource;
|
|
11
|
+
}
|
|
12
|
+
interface FramedContextValue {
|
|
13
|
+
config: FramedProviderConfig;
|
|
14
|
+
projectId: string;
|
|
15
|
+
isAuthenticated: boolean;
|
|
16
|
+
session: Session | null;
|
|
17
|
+
isAuthLoading: boolean;
|
|
18
|
+
authError: string | null;
|
|
19
|
+
login: () => void;
|
|
20
|
+
logout: () => void;
|
|
21
|
+
dataLayer: WidgetDataLayer;
|
|
22
|
+
tasks: Task[];
|
|
23
|
+
openTasks: Task[];
|
|
24
|
+
isTasksLoading: boolean;
|
|
25
|
+
refreshTasks: () => Promise<void>;
|
|
26
|
+
saveTask: (task: Task) => Promise<void>;
|
|
27
|
+
updateTask: (id: string, updates: Partial<Task>) => Promise<void>;
|
|
28
|
+
limits: LimitStatus | null;
|
|
29
|
+
checkLimits: () => Promise<LimitStatus>;
|
|
30
|
+
features: WidgetFeatures;
|
|
31
|
+
isWidgetReady: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface FramedProviderProps {
|
|
34
|
+
config: FramedProviderConfig;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function FramedProvider({ config, children }: FramedProviderProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare function useFramed(): FramedContextValue;
|
|
39
|
+
|
|
40
|
+
interface AuthContextValue {
|
|
41
|
+
isAuthenticated: boolean;
|
|
42
|
+
session: Session | null;
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
login: () => void;
|
|
46
|
+
logout: () => void;
|
|
47
|
+
}
|
|
48
|
+
interface AuthProviderProps {
|
|
49
|
+
config: AuthConfig;
|
|
50
|
+
projectId: string;
|
|
51
|
+
apiKey?: string;
|
|
52
|
+
supabaseUrl?: string;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
}
|
|
55
|
+
declare function AuthProvider({ config, projectId, apiKey, supabaseUrl, children, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function useAuth(): AuthContextValue;
|
|
57
|
+
|
|
58
|
+
interface FeedbackWidgetProps {
|
|
59
|
+
/** User's display name for feedback attribution */
|
|
60
|
+
author?: string;
|
|
61
|
+
/** Called when a new comment is submitted */
|
|
62
|
+
onSubmit?: (comment: FeedbackComment) => void;
|
|
63
|
+
/** Called when a task is created from feedback */
|
|
64
|
+
onTaskCreated?: (task: Task) => void;
|
|
65
|
+
/** Called when user takes a screenshot */
|
|
66
|
+
onScreenshot?: () => void;
|
|
67
|
+
/** Called when user locates a comment */
|
|
68
|
+
onLocateComment?: (comment: FeedbackComment) => void;
|
|
69
|
+
/** Called when user exports summary */
|
|
70
|
+
onExport?: () => void;
|
|
71
|
+
/** Called when widget is closed */
|
|
72
|
+
onClose?: () => void;
|
|
73
|
+
}
|
|
74
|
+
declare function FeedbackWidget({ author, onSubmit, onTaskCreated, onScreenshot, onLocateComment, onExport, onClose, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
75
|
+
|
|
76
|
+
interface TasksReadyPanelProps {
|
|
77
|
+
/** Maximum number of tasks to show in preview */
|
|
78
|
+
maxPreview?: number;
|
|
79
|
+
/** Called when prompt is copied */
|
|
80
|
+
onPromptCopied?: () => void;
|
|
81
|
+
/** Custom class name */
|
|
82
|
+
className?: string;
|
|
83
|
+
}
|
|
84
|
+
declare function TasksReadyPanel({ maxPreview, onPromptCopied, className, }: TasksReadyPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
85
|
+
|
|
86
|
+
interface SiteContext {
|
|
87
|
+
capturedAt: string;
|
|
88
|
+
capturedBy: 'widget' | 'cli';
|
|
89
|
+
pages: SitePageInfo[];
|
|
90
|
+
navigation: NavigationItem[];
|
|
91
|
+
patterns: SitePatterns;
|
|
92
|
+
framework: FrameworkInfo;
|
|
93
|
+
contentMap: ContentMap[];
|
|
94
|
+
}
|
|
95
|
+
interface SitePageInfo {
|
|
96
|
+
url: string;
|
|
97
|
+
title: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
hasContent: boolean;
|
|
100
|
+
sections: string[];
|
|
101
|
+
lastModified?: string;
|
|
102
|
+
}
|
|
103
|
+
interface NavigationItem {
|
|
104
|
+
label: string;
|
|
105
|
+
href: string;
|
|
106
|
+
isActive: boolean;
|
|
107
|
+
children?: NavigationItem[];
|
|
108
|
+
location: 'header' | 'footer' | 'sidebar';
|
|
109
|
+
}
|
|
110
|
+
interface SitePatterns {
|
|
111
|
+
hasBlog: boolean;
|
|
112
|
+
hasBlogPosts: boolean;
|
|
113
|
+
hasTeamSection: boolean;
|
|
114
|
+
hasContactForm: boolean;
|
|
115
|
+
hasNewsletter: boolean;
|
|
116
|
+
hasPricing: boolean;
|
|
117
|
+
hasTestimonials: boolean;
|
|
118
|
+
hasFAQ: boolean;
|
|
119
|
+
hasProducts: boolean;
|
|
120
|
+
hasCart: boolean;
|
|
121
|
+
hasCheckout: boolean;
|
|
122
|
+
hasHero: boolean;
|
|
123
|
+
hasFooter: boolean;
|
|
124
|
+
hasSidebar: boolean;
|
|
125
|
+
}
|
|
126
|
+
interface FrameworkInfo {
|
|
127
|
+
detected: 'nextjs-app' | 'nextjs-pages' | 'remix' | 'react-router' | 'astro' | 'unknown';
|
|
128
|
+
confidence: number;
|
|
129
|
+
hints: string[];
|
|
130
|
+
}
|
|
131
|
+
interface ContentMap {
|
|
132
|
+
page: string;
|
|
133
|
+
sections: {
|
|
134
|
+
id: string;
|
|
135
|
+
selector: string;
|
|
136
|
+
type: 'hero' | 'content' | 'list' | 'form' | 'cta' | 'unknown';
|
|
137
|
+
hasImages: boolean;
|
|
138
|
+
hasText: boolean;
|
|
139
|
+
approximateWords: number;
|
|
140
|
+
}[];
|
|
141
|
+
}
|
|
142
|
+
declare function scanSiteContext(): Promise<SiteContext>;
|
|
143
|
+
|
|
144
|
+
interface PromptOptions {
|
|
145
|
+
apiKey: string;
|
|
146
|
+
includeContext?: boolean;
|
|
147
|
+
format?: 'full' | 'compact';
|
|
148
|
+
}
|
|
149
|
+
declare function generateAIPrompt(tasks: Task[], options: PromptOptions, siteContext?: SiteContext): string;
|
|
150
|
+
declare function copyPromptToClipboard(prompt: string): Promise<boolean>;
|
|
151
|
+
|
|
152
|
+
interface UseFramedTasksResult {
|
|
153
|
+
tasks: Task[];
|
|
154
|
+
openTasks: Task[];
|
|
155
|
+
inProgressTasks: Task[];
|
|
156
|
+
doneTasks: Task[];
|
|
157
|
+
isLoading: boolean;
|
|
158
|
+
openCount: number;
|
|
159
|
+
totalCount: number;
|
|
160
|
+
refresh: () => Promise<void>;
|
|
161
|
+
markDone: (taskId: string) => Promise<void>;
|
|
162
|
+
updateStatus: (taskId: string, status: TaskStatus) => Promise<void>;
|
|
163
|
+
generatePrompt: (options?: Partial<PromptOptions>) => Promise<string>;
|
|
164
|
+
copyPrompt: (options?: Partial<PromptOptions>) => Promise<boolean>;
|
|
165
|
+
}
|
|
166
|
+
declare function useFramedTasks(): UseFramedTasksResult;
|
|
167
|
+
|
|
168
|
+
declare class LocalDataLayer implements WidgetDataLayer {
|
|
169
|
+
private projectId;
|
|
170
|
+
constructor(projectId: string);
|
|
171
|
+
getSession(): Promise<Session | null>;
|
|
172
|
+
loadTasks(page?: string): Promise<Task[]>;
|
|
173
|
+
saveTask(task: Task): Promise<void>;
|
|
174
|
+
updateTask(id: string, updates: Partial<Task>): Promise<void>;
|
|
175
|
+
uploadFile(file: File): Promise<{
|
|
176
|
+
url: string;
|
|
177
|
+
path: string;
|
|
178
|
+
}>;
|
|
179
|
+
checkLimits(): Promise<LimitStatus>;
|
|
180
|
+
sync: undefined;
|
|
181
|
+
deleteTask(id: string): Promise<void>;
|
|
182
|
+
clearAllTasks(): Promise<void>;
|
|
183
|
+
exportTasks(): Promise<string>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface FramedAPIConfig {
|
|
187
|
+
apiKey: string;
|
|
188
|
+
supabaseUrl: string;
|
|
189
|
+
}
|
|
190
|
+
interface TasksResponse {
|
|
191
|
+
tasks: Task[];
|
|
192
|
+
meta: {
|
|
193
|
+
total: number;
|
|
194
|
+
projectId: string;
|
|
195
|
+
projectName: string;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
interface UploadResponse {
|
|
199
|
+
url: string;
|
|
200
|
+
path: string;
|
|
201
|
+
expiresAt?: string;
|
|
202
|
+
}
|
|
203
|
+
interface ValidationResult {
|
|
204
|
+
valid: boolean;
|
|
205
|
+
session?: Session;
|
|
206
|
+
error?: string;
|
|
207
|
+
}
|
|
208
|
+
declare class FramedAPIClient {
|
|
209
|
+
private apiKey;
|
|
210
|
+
private baseUrl;
|
|
211
|
+
constructor(config: FramedAPIConfig);
|
|
212
|
+
private request;
|
|
213
|
+
getTasks(options?: {
|
|
214
|
+
status?: 'open' | 'in_progress' | 'done' | 'rejected';
|
|
215
|
+
page?: string;
|
|
216
|
+
}): Promise<TasksResponse>;
|
|
217
|
+
createTask(task: Omit<Task, 'id' | 'meta'>): Promise<Task>;
|
|
218
|
+
updateTask(taskId: string, updates: Partial<Task>): Promise<Task>;
|
|
219
|
+
markTaskDone(taskId: string): Promise<{
|
|
220
|
+
success: boolean;
|
|
221
|
+
task: Task;
|
|
222
|
+
}>;
|
|
223
|
+
uploadFile(file: File): Promise<UploadResponse>;
|
|
224
|
+
validateMagicToken(token: string): Promise<ValidationResult>;
|
|
225
|
+
exchangeSessionToken(sessionToken: string): Promise<ValidationResult>;
|
|
226
|
+
getSession(): Promise<Session | null>;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare class SyncDataLayer implements WidgetDataLayer {
|
|
230
|
+
private projectId;
|
|
231
|
+
private client;
|
|
232
|
+
private session;
|
|
233
|
+
constructor(projectId: string, config: FramedAPIConfig);
|
|
234
|
+
private loadCachedSession;
|
|
235
|
+
private cacheSession;
|
|
236
|
+
getSession(): Promise<Session | null>;
|
|
237
|
+
loadTasks(page?: string): Promise<Task[]>;
|
|
238
|
+
saveTask(task: Task): Promise<void>;
|
|
239
|
+
updateTask(id: string, updates: Partial<Task>): Promise<void>;
|
|
240
|
+
uploadFile(file: File): Promise<{
|
|
241
|
+
url: string;
|
|
242
|
+
path: string;
|
|
243
|
+
}>;
|
|
244
|
+
private createFormData;
|
|
245
|
+
checkLimits(): Promise<LimitStatus>;
|
|
246
|
+
sync(): Promise<SyncResult>;
|
|
247
|
+
private getPendingTasks;
|
|
248
|
+
private savePendingTasks;
|
|
249
|
+
private addPendingTask;
|
|
250
|
+
validateMagicToken(token: string): Promise<{
|
|
251
|
+
valid: boolean;
|
|
252
|
+
session?: Session;
|
|
253
|
+
error?: string;
|
|
254
|
+
}>;
|
|
255
|
+
exchangeSessionToken(sessionToken: string): Promise<{
|
|
256
|
+
valid: boolean;
|
|
257
|
+
session?: Session;
|
|
258
|
+
error?: string;
|
|
259
|
+
}>;
|
|
260
|
+
clearSession(): void;
|
|
261
|
+
markTaskDone(taskId: string): Promise<void>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { AuthProvider, type ContentMap, FeedbackWidget, type FeedbackWidgetProps, FramedAPIClient, type FramedAPIConfig, FramedProvider, type FramedProviderConfig, type FramedProviderProps, type FrameworkInfo, LocalDataLayer, type NavigationItem, type PromptOptions, type SiteContext, type SitePageInfo, type SitePatterns, SyncDataLayer, TasksReadyPanel, type TasksReadyPanelProps, type TasksResponse, type UploadResponse, type UseFramedTasksResult, type ValidationResult, copyPromptToClipboard, generateAIPrompt, scanSiteContext, useAuth, useFramed, useFramedTasks };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { FramedConfig, Session, WidgetDataLayer, Task, LimitStatus, WidgetFeatures, AuthConfig, FeedbackComment, TaskStatus, SyncResult } from '@framed/core';
|
|
2
|
+
export { AIConfig, AnnotationData, AnnotationMode, Assignment, Attachment, AuthConfig, AuthMode, Comment, ElementInfo, FeedbackComment, FeedbackInfo, FramedConfig, LimitStatus, Mention, PageInfo, PendingAttachment, Position, Session, SyncConfig, SyncResult, Task, TaskInfo, TaskStatus, TaskType, UsageLimits, ViewportMode, WidgetConfig, WidgetDataLayer, WidgetFeatures } from '@framed/core';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
type WidgetVersion = 'latest' | 'v3' | string;
|
|
7
|
+
type WidgetSource = 'cdn' | 'bundled';
|
|
8
|
+
interface FramedProviderConfig extends FramedConfig {
|
|
9
|
+
widgetVersion?: WidgetVersion;
|
|
10
|
+
widgetSource?: WidgetSource;
|
|
11
|
+
}
|
|
12
|
+
interface FramedContextValue {
|
|
13
|
+
config: FramedProviderConfig;
|
|
14
|
+
projectId: string;
|
|
15
|
+
isAuthenticated: boolean;
|
|
16
|
+
session: Session | null;
|
|
17
|
+
isAuthLoading: boolean;
|
|
18
|
+
authError: string | null;
|
|
19
|
+
login: () => void;
|
|
20
|
+
logout: () => void;
|
|
21
|
+
dataLayer: WidgetDataLayer;
|
|
22
|
+
tasks: Task[];
|
|
23
|
+
openTasks: Task[];
|
|
24
|
+
isTasksLoading: boolean;
|
|
25
|
+
refreshTasks: () => Promise<void>;
|
|
26
|
+
saveTask: (task: Task) => Promise<void>;
|
|
27
|
+
updateTask: (id: string, updates: Partial<Task>) => Promise<void>;
|
|
28
|
+
limits: LimitStatus | null;
|
|
29
|
+
checkLimits: () => Promise<LimitStatus>;
|
|
30
|
+
features: WidgetFeatures;
|
|
31
|
+
isWidgetReady: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface FramedProviderProps {
|
|
34
|
+
config: FramedProviderConfig;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare function FramedProvider({ config, children }: FramedProviderProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare function useFramed(): FramedContextValue;
|
|
39
|
+
|
|
40
|
+
interface AuthContextValue {
|
|
41
|
+
isAuthenticated: boolean;
|
|
42
|
+
session: Session | null;
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
login: () => void;
|
|
46
|
+
logout: () => void;
|
|
47
|
+
}
|
|
48
|
+
interface AuthProviderProps {
|
|
49
|
+
config: AuthConfig;
|
|
50
|
+
projectId: string;
|
|
51
|
+
apiKey?: string;
|
|
52
|
+
supabaseUrl?: string;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
}
|
|
55
|
+
declare function AuthProvider({ config, projectId, apiKey, supabaseUrl, children, }: AuthProviderProps): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function useAuth(): AuthContextValue;
|
|
57
|
+
|
|
58
|
+
interface FeedbackWidgetProps {
|
|
59
|
+
/** User's display name for feedback attribution */
|
|
60
|
+
author?: string;
|
|
61
|
+
/** Called when a new comment is submitted */
|
|
62
|
+
onSubmit?: (comment: FeedbackComment) => void;
|
|
63
|
+
/** Called when a task is created from feedback */
|
|
64
|
+
onTaskCreated?: (task: Task) => void;
|
|
65
|
+
/** Called when user takes a screenshot */
|
|
66
|
+
onScreenshot?: () => void;
|
|
67
|
+
/** Called when user locates a comment */
|
|
68
|
+
onLocateComment?: (comment: FeedbackComment) => void;
|
|
69
|
+
/** Called when user exports summary */
|
|
70
|
+
onExport?: () => void;
|
|
71
|
+
/** Called when widget is closed */
|
|
72
|
+
onClose?: () => void;
|
|
73
|
+
}
|
|
74
|
+
declare function FeedbackWidget({ author, onSubmit, onTaskCreated, onScreenshot, onLocateComment, onExport, onClose, }: FeedbackWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
75
|
+
|
|
76
|
+
interface TasksReadyPanelProps {
|
|
77
|
+
/** Maximum number of tasks to show in preview */
|
|
78
|
+
maxPreview?: number;
|
|
79
|
+
/** Called when prompt is copied */
|
|
80
|
+
onPromptCopied?: () => void;
|
|
81
|
+
/** Custom class name */
|
|
82
|
+
className?: string;
|
|
83
|
+
}
|
|
84
|
+
declare function TasksReadyPanel({ maxPreview, onPromptCopied, className, }: TasksReadyPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
85
|
+
|
|
86
|
+
interface SiteContext {
|
|
87
|
+
capturedAt: string;
|
|
88
|
+
capturedBy: 'widget' | 'cli';
|
|
89
|
+
pages: SitePageInfo[];
|
|
90
|
+
navigation: NavigationItem[];
|
|
91
|
+
patterns: SitePatterns;
|
|
92
|
+
framework: FrameworkInfo;
|
|
93
|
+
contentMap: ContentMap[];
|
|
94
|
+
}
|
|
95
|
+
interface SitePageInfo {
|
|
96
|
+
url: string;
|
|
97
|
+
title: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
hasContent: boolean;
|
|
100
|
+
sections: string[];
|
|
101
|
+
lastModified?: string;
|
|
102
|
+
}
|
|
103
|
+
interface NavigationItem {
|
|
104
|
+
label: string;
|
|
105
|
+
href: string;
|
|
106
|
+
isActive: boolean;
|
|
107
|
+
children?: NavigationItem[];
|
|
108
|
+
location: 'header' | 'footer' | 'sidebar';
|
|
109
|
+
}
|
|
110
|
+
interface SitePatterns {
|
|
111
|
+
hasBlog: boolean;
|
|
112
|
+
hasBlogPosts: boolean;
|
|
113
|
+
hasTeamSection: boolean;
|
|
114
|
+
hasContactForm: boolean;
|
|
115
|
+
hasNewsletter: boolean;
|
|
116
|
+
hasPricing: boolean;
|
|
117
|
+
hasTestimonials: boolean;
|
|
118
|
+
hasFAQ: boolean;
|
|
119
|
+
hasProducts: boolean;
|
|
120
|
+
hasCart: boolean;
|
|
121
|
+
hasCheckout: boolean;
|
|
122
|
+
hasHero: boolean;
|
|
123
|
+
hasFooter: boolean;
|
|
124
|
+
hasSidebar: boolean;
|
|
125
|
+
}
|
|
126
|
+
interface FrameworkInfo {
|
|
127
|
+
detected: 'nextjs-app' | 'nextjs-pages' | 'remix' | 'react-router' | 'astro' | 'unknown';
|
|
128
|
+
confidence: number;
|
|
129
|
+
hints: string[];
|
|
130
|
+
}
|
|
131
|
+
interface ContentMap {
|
|
132
|
+
page: string;
|
|
133
|
+
sections: {
|
|
134
|
+
id: string;
|
|
135
|
+
selector: string;
|
|
136
|
+
type: 'hero' | 'content' | 'list' | 'form' | 'cta' | 'unknown';
|
|
137
|
+
hasImages: boolean;
|
|
138
|
+
hasText: boolean;
|
|
139
|
+
approximateWords: number;
|
|
140
|
+
}[];
|
|
141
|
+
}
|
|
142
|
+
declare function scanSiteContext(): Promise<SiteContext>;
|
|
143
|
+
|
|
144
|
+
interface PromptOptions {
|
|
145
|
+
apiKey: string;
|
|
146
|
+
includeContext?: boolean;
|
|
147
|
+
format?: 'full' | 'compact';
|
|
148
|
+
}
|
|
149
|
+
declare function generateAIPrompt(tasks: Task[], options: PromptOptions, siteContext?: SiteContext): string;
|
|
150
|
+
declare function copyPromptToClipboard(prompt: string): Promise<boolean>;
|
|
151
|
+
|
|
152
|
+
interface UseFramedTasksResult {
|
|
153
|
+
tasks: Task[];
|
|
154
|
+
openTasks: Task[];
|
|
155
|
+
inProgressTasks: Task[];
|
|
156
|
+
doneTasks: Task[];
|
|
157
|
+
isLoading: boolean;
|
|
158
|
+
openCount: number;
|
|
159
|
+
totalCount: number;
|
|
160
|
+
refresh: () => Promise<void>;
|
|
161
|
+
markDone: (taskId: string) => Promise<void>;
|
|
162
|
+
updateStatus: (taskId: string, status: TaskStatus) => Promise<void>;
|
|
163
|
+
generatePrompt: (options?: Partial<PromptOptions>) => Promise<string>;
|
|
164
|
+
copyPrompt: (options?: Partial<PromptOptions>) => Promise<boolean>;
|
|
165
|
+
}
|
|
166
|
+
declare function useFramedTasks(): UseFramedTasksResult;
|
|
167
|
+
|
|
168
|
+
declare class LocalDataLayer implements WidgetDataLayer {
|
|
169
|
+
private projectId;
|
|
170
|
+
constructor(projectId: string);
|
|
171
|
+
getSession(): Promise<Session | null>;
|
|
172
|
+
loadTasks(page?: string): Promise<Task[]>;
|
|
173
|
+
saveTask(task: Task): Promise<void>;
|
|
174
|
+
updateTask(id: string, updates: Partial<Task>): Promise<void>;
|
|
175
|
+
uploadFile(file: File): Promise<{
|
|
176
|
+
url: string;
|
|
177
|
+
path: string;
|
|
178
|
+
}>;
|
|
179
|
+
checkLimits(): Promise<LimitStatus>;
|
|
180
|
+
sync: undefined;
|
|
181
|
+
deleteTask(id: string): Promise<void>;
|
|
182
|
+
clearAllTasks(): Promise<void>;
|
|
183
|
+
exportTasks(): Promise<string>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface FramedAPIConfig {
|
|
187
|
+
apiKey: string;
|
|
188
|
+
supabaseUrl: string;
|
|
189
|
+
}
|
|
190
|
+
interface TasksResponse {
|
|
191
|
+
tasks: Task[];
|
|
192
|
+
meta: {
|
|
193
|
+
total: number;
|
|
194
|
+
projectId: string;
|
|
195
|
+
projectName: string;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
interface UploadResponse {
|
|
199
|
+
url: string;
|
|
200
|
+
path: string;
|
|
201
|
+
expiresAt?: string;
|
|
202
|
+
}
|
|
203
|
+
interface ValidationResult {
|
|
204
|
+
valid: boolean;
|
|
205
|
+
session?: Session;
|
|
206
|
+
error?: string;
|
|
207
|
+
}
|
|
208
|
+
declare class FramedAPIClient {
|
|
209
|
+
private apiKey;
|
|
210
|
+
private baseUrl;
|
|
211
|
+
constructor(config: FramedAPIConfig);
|
|
212
|
+
private request;
|
|
213
|
+
getTasks(options?: {
|
|
214
|
+
status?: 'open' | 'in_progress' | 'done' | 'rejected';
|
|
215
|
+
page?: string;
|
|
216
|
+
}): Promise<TasksResponse>;
|
|
217
|
+
createTask(task: Omit<Task, 'id' | 'meta'>): Promise<Task>;
|
|
218
|
+
updateTask(taskId: string, updates: Partial<Task>): Promise<Task>;
|
|
219
|
+
markTaskDone(taskId: string): Promise<{
|
|
220
|
+
success: boolean;
|
|
221
|
+
task: Task;
|
|
222
|
+
}>;
|
|
223
|
+
uploadFile(file: File): Promise<UploadResponse>;
|
|
224
|
+
validateMagicToken(token: string): Promise<ValidationResult>;
|
|
225
|
+
exchangeSessionToken(sessionToken: string): Promise<ValidationResult>;
|
|
226
|
+
getSession(): Promise<Session | null>;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare class SyncDataLayer implements WidgetDataLayer {
|
|
230
|
+
private projectId;
|
|
231
|
+
private client;
|
|
232
|
+
private session;
|
|
233
|
+
constructor(projectId: string, config: FramedAPIConfig);
|
|
234
|
+
private loadCachedSession;
|
|
235
|
+
private cacheSession;
|
|
236
|
+
getSession(): Promise<Session | null>;
|
|
237
|
+
loadTasks(page?: string): Promise<Task[]>;
|
|
238
|
+
saveTask(task: Task): Promise<void>;
|
|
239
|
+
updateTask(id: string, updates: Partial<Task>): Promise<void>;
|
|
240
|
+
uploadFile(file: File): Promise<{
|
|
241
|
+
url: string;
|
|
242
|
+
path: string;
|
|
243
|
+
}>;
|
|
244
|
+
private createFormData;
|
|
245
|
+
checkLimits(): Promise<LimitStatus>;
|
|
246
|
+
sync(): Promise<SyncResult>;
|
|
247
|
+
private getPendingTasks;
|
|
248
|
+
private savePendingTasks;
|
|
249
|
+
private addPendingTask;
|
|
250
|
+
validateMagicToken(token: string): Promise<{
|
|
251
|
+
valid: boolean;
|
|
252
|
+
session?: Session;
|
|
253
|
+
error?: string;
|
|
254
|
+
}>;
|
|
255
|
+
exchangeSessionToken(sessionToken: string): Promise<{
|
|
256
|
+
valid: boolean;
|
|
257
|
+
session?: Session;
|
|
258
|
+
error?: string;
|
|
259
|
+
}>;
|
|
260
|
+
clearSession(): void;
|
|
261
|
+
markTaskDone(taskId: string): Promise<void>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { AuthProvider, type ContentMap, FeedbackWidget, type FeedbackWidgetProps, FramedAPIClient, type FramedAPIConfig, FramedProvider, type FramedProviderConfig, type FramedProviderProps, type FrameworkInfo, LocalDataLayer, type NavigationItem, type PromptOptions, type SiteContext, type SitePageInfo, type SitePatterns, SyncDataLayer, TasksReadyPanel, type TasksReadyPanelProps, type TasksResponse, type UploadResponse, type UseFramedTasksResult, type ValidationResult, copyPromptToClipboard, generateAIPrompt, scanSiteContext, useAuth, useFramed, useFramedTasks };
|