@base44-preview/cli 0.0.26-pr.174.9ce53d2 → 0.0.26-pr.176.1ee3c89

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 (27) hide show
  1. package/dist/index.js +38 -7
  2. package/dist/templates/templates.json +0 -6
  3. package/package.json +1 -1
  4. package/dist/templates/chrome-extension/.nvmrc +0 -1
  5. package/dist/templates/chrome-extension/README.md +0 -90
  6. package/dist/templates/chrome-extension/base44/agents/search_agent.jsonc +0 -13
  7. package/dist/templates/chrome-extension/base44/app.jsonc.ejs +0 -9
  8. package/dist/templates/chrome-extension/base44/config.jsonc.ejs +0 -8
  9. package/dist/templates/chrome-extension/base44/entities/bookmark.jsonc +0 -41
  10. package/dist/templates/chrome-extension/gitignore.ejs +0 -25
  11. package/dist/templates/chrome-extension/package.json +0 -30
  12. package/dist/templates/chrome-extension/postcss.config.js +0 -6
  13. package/dist/templates/chrome-extension/public/icon/README.md +0 -12
  14. package/dist/templates/chrome-extension/public/manifest.json +0 -25
  15. package/dist/templates/chrome-extension/tailwind.config.js +0 -8
  16. package/dist/templates/chrome-extension/tsconfig.json +0 -31
  17. package/dist/templates/chrome-extension/tsconfig.node.json +0 -10
  18. package/dist/templates/chrome-extension/wxt-src/components/BookmarkCard.tsx +0 -83
  19. package/dist/templates/chrome-extension/wxt-src/components/Button.tsx +0 -36
  20. package/dist/templates/chrome-extension/wxt-src/components/Input.tsx +0 -12
  21. package/dist/templates/chrome-extension/wxt-src/entrypoints/background.ts +0 -19
  22. package/dist/templates/chrome-extension/wxt-src/entrypoints/popup/App.tsx +0 -186
  23. package/dist/templates/chrome-extension/wxt-src/entrypoints/popup/index.html +0 -12
  24. package/dist/templates/chrome-extension/wxt-src/entrypoints/popup/main.tsx +0 -10
  25. package/dist/templates/chrome-extension/wxt-src/entrypoints/popup/style.css +0 -21
  26. package/dist/templates/chrome-extension/wxt-src/lib/base44Client.ts.ejs +0 -5
  27. package/dist/templates/chrome-extension/wxt.config.ts +0 -7
@@ -1,186 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
- import { base44 } from '@/lib/base44Client';
3
- import { Button } from '@/components/Button';
4
- import { Input } from '@/components/Input';
5
- import { BookmarkCard } from '@/components/BookmarkCard';
6
- import { Bookmark, Plus, Search, Sparkles } from 'lucide-react';
7
-
8
- const BookmarkEntity = base44.entities.Bookmark;
9
-
10
- interface CurrentTab {
11
- url?: string;
12
- title?: string;
13
- favicon?: string;
14
- }
15
-
16
- export default function App() {
17
- const [bookmarks, setBookmarks] = useState<any[]>([]);
18
- const [searchQuery, setSearchQuery] = useState('');
19
- const [isLoading, setIsLoading] = useState(true);
20
- const [isSaving, setIsSaving] = useState(false);
21
- const [currentTab, setCurrentTab] = useState<CurrentTab>({});
22
- const [isAISearch, setIsAISearch] = useState(false);
23
-
24
- useEffect(() => {
25
- fetchBookmarks();
26
- getCurrentTab();
27
- }, []);
28
-
29
- const getCurrentTab = async () => {
30
- try {
31
- const response = await browser.runtime.sendMessage({ type: 'GET_CURRENT_TAB' });
32
- setCurrentTab(response);
33
- } catch (error) {
34
- console.error('Error getting current tab:', error);
35
- }
36
- };
37
-
38
- const fetchBookmarks = async () => {
39
- try {
40
- const data = await BookmarkEntity.list();
41
- setBookmarks(data);
42
- } catch (error) {
43
- console.error('Error fetching bookmarks:', error);
44
- } finally {
45
- setIsLoading(false);
46
- }
47
- };
48
-
49
- const saveCurrentPage = async () => {
50
- if (!currentTab.url || !currentTab.title) return;
51
-
52
- setIsSaving(true);
53
- try {
54
- await BookmarkEntity.create({
55
- url: currentTab.url,
56
- title: currentTab.title,
57
- favicon: currentTab.favicon || '',
58
- tags: [],
59
- });
60
- await fetchBookmarks();
61
- } catch (error) {
62
- console.error('Error saving bookmark:', error);
63
- } finally {
64
- setIsSaving(false);
65
- }
66
- };
67
-
68
- const deleteBookmark = async (id: string) => {
69
- try {
70
- await BookmarkEntity.delete(id);
71
- await fetchBookmarks();
72
- } catch (error) {
73
- console.error('Error deleting bookmark:', error);
74
- }
75
- };
76
-
77
- const handleSearch = async () => {
78
- if (!searchQuery.trim()) {
79
- fetchBookmarks();
80
- return;
81
- }
82
-
83
- if (isAISearch) {
84
- // Use AI agent for natural language search
85
- try {
86
- const agent = base44.agents.BookmarkSearchAgent;
87
- const response = await agent.run(searchQuery);
88
- // Parse agent response and filter bookmarks
89
- // This is a placeholder - actual implementation depends on agent response format
90
- console.log('AI Search result:', response);
91
- } catch (error) {
92
- console.error('Error with AI search:', error);
93
- }
94
- } else {
95
- // Simple text search
96
- const filtered = bookmarks.filter((bookmark) =>
97
- bookmark.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
98
- bookmark.url.toLowerCase().includes(searchQuery.toLowerCase())
99
- );
100
- setBookmarks(filtered);
101
- }
102
- };
103
-
104
- const filteredBookmarks = searchQuery
105
- ? bookmarks.filter((bookmark) =>
106
- bookmark.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
107
- bookmark.url.toLowerCase().includes(searchQuery.toLowerCase())
108
- )
109
- : bookmarks;
110
-
111
- return (
112
- <div className="min-h-screen bg-gradient-to-br from-slate-50 via-white to-blue-50/30">
113
- <div className="w-full h-full">
114
- {/* Header */}
115
- <div className="bg-white border-b border-slate-200 px-4 py-3">
116
- <div className="flex items-center justify-between mb-3">
117
- <h1 className="text-lg font-semibold text-slate-900 flex items-center gap-2">
118
- <Bookmark className="w-5 h-5 text-blue-600" />
119
- My Bookmarks
120
- </h1>
121
- <Button
122
- onClick={saveCurrentPage}
123
- disabled={isSaving || !currentTab.url}
124
- size="sm"
125
- className="bg-blue-600 hover:bg-blue-700"
126
- >
127
- <Plus className="w-4 h-4 mr-1" />
128
- Save Page
129
- </Button>
130
- </div>
131
-
132
- {/* Search Bar */}
133
- <div className="relative">
134
- <Input
135
- type="text"
136
- value={searchQuery}
137
- onChange={(e) => setSearchQuery(e.target.value)}
138
- onKeyDown={(e) => e.key === 'Enter' && handleSearch()}
139
- placeholder="Search bookmarks..."
140
- className="pl-9 pr-10"
141
- />
142
- <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" />
143
- <button
144
- onClick={() => setIsAISearch(!isAISearch)}
145
- className={`absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded transition-colors ${
146
- isAISearch ? 'text-purple-600 bg-purple-50' : 'text-slate-400 hover:text-slate-600'
147
- }`}
148
- title="Toggle AI Search"
149
- >
150
- <Sparkles className="w-4 h-4" />
151
- </button>
152
- </div>
153
- </div>
154
-
155
- {/* Bookmarks List */}
156
- <div className="p-4 space-y-2 max-h-[440px] overflow-y-auto">
157
- {isLoading ? (
158
- <div className="flex items-center justify-center py-12">
159
- <div className="w-6 h-6 border-2 border-slate-200 border-t-blue-600 rounded-full animate-spin" />
160
- </div>
161
- ) : filteredBookmarks.length === 0 ? (
162
- <div className="text-center py-12">
163
- <Bookmark className="w-12 h-12 text-slate-300 mx-auto mb-3" />
164
- <p className="text-slate-400 text-sm">
165
- {searchQuery ? 'No bookmarks found' : 'No bookmarks yet'}
166
- </p>
167
- {!searchQuery && (
168
- <p className="text-slate-400 text-xs mt-1">
169
- Click "Save Page" to bookmark this page
170
- </p>
171
- )}
172
- </div>
173
- ) : (
174
- filteredBookmarks.map((bookmark) => (
175
- <BookmarkCard
176
- key={bookmark.id}
177
- bookmark={bookmark}
178
- onDelete={() => deleteBookmark(bookmark.id)}
179
- />
180
- ))
181
- )}
182
- </div>
183
- </div>
184
- </div>
185
- );
186
- }
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Bookmarks</title>
7
- </head>
8
- <body>
9
- <div id="root"></div>
10
- <script type="module" src="./main.tsx"></script>
11
- </body>
12
- </html>
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import App from './App';
4
- import './style.css';
5
-
6
- ReactDOM.createRoot(document.getElementById('root')!).render(
7
- <React.StrictMode>
8
- <App />
9
- </React.StrictMode>
10
- );
@@ -1,21 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- body {
6
- margin: 0;
7
- padding: 0;
8
- min-width: 400px;
9
- max-width: 400px;
10
- min-height: 500px;
11
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
12
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
13
- sans-serif;
14
- -webkit-font-smoothing: antialiased;
15
- -moz-osx-font-smoothing: grayscale;
16
- }
17
-
18
- #root {
19
- width: 100%;
20
- height: 100%;
21
- }
@@ -1,5 +0,0 @@
1
- import { Base44 } from '@base44/sdk';
2
-
3
- export const base44 = new Base44({
4
- projectId: '<%= projectId %>',
5
- });
@@ -1,7 +0,0 @@
1
- import { defineConfig } from 'wxt';
2
-
3
- export default defineConfig({
4
- extensionApi: 'chrome',
5
- modules: ['@wxt-dev/module-react'],
6
- srcDir: 'wxt-src',
7
- });