your-ai-workflow-firebase-os 1.2.33 → 1.2.35

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 (142) hide show
  1. package/README.md +77 -51
  2. package/dist/ContactPopup-CMIeZiEq.cjs +9 -0
  3. package/dist/{ContactPopup-DSNsuxh7.js → ContactPopup-CeR4KV8_.js} +6338 -6274
  4. package/dist/FirebaseOS.d.ts +1 -0
  5. package/dist/{PhoneInputField-CThRwHdg.js → PhoneInputField-kA1QmUiI.js} +1 -1
  6. package/dist/index.d.ts +0 -1
  7. package/dist/lib/AuthContext.d.ts +6 -0
  8. package/dist/lib/ConfigContext.d.ts +1 -0
  9. package/dist/renderer.cjs.js +1 -1
  10. package/dist/renderer.es.js +1 -1
  11. package/dist/your-ai-workflow-firebase-os.cjs.js +291 -559
  12. package/dist/your-ai-workflow-firebase-os.css +1 -1
  13. package/dist/your-ai-workflow-firebase-os.es.js +6485 -7556
  14. package/package.json +11 -4
  15. package/scripts/postinstall.js +513 -219
  16. package/src/configs/forms/contactForm.config.ts +0 -1
  17. package/src/configs/forms/supportForm.config.ts +0 -1
  18. package/src/configs/theme.config.ts +11 -3
  19. package/src/index.css +1 -1
  20. package/src/microcomponents/registry.ts +7 -1
  21. package/src/pages/Home.tsx +42 -123
  22. package/dist/ContactPopup-Dkcz2L0f.cjs +0 -9
  23. package/dist/theme.config-B2y1axZf.js +0 -2
  24. package/dist/theme.config-B3k_BrAV.cjs +0 -1
  25. package/dist/theme.config-D05RQKVy.js +0 -68
  26. package/scripts/popoverCss.test.ts +0 -46
  27. package/src/App.css +0 -184
  28. package/src/App.tsx +0 -214
  29. package/src/FirebaseOS.tsx +0 -102
  30. package/src/assets/hero.png +0 -0
  31. package/src/assets/react.svg +0 -1
  32. package/src/assets/vite.svg +0 -1
  33. package/src/components/AdminNotifications.test.tsx +0 -98
  34. package/src/components/AdminNotifications.tsx +0 -194
  35. package/src/components/Button.test.tsx +0 -22
  36. package/src/components/Button.tsx +0 -53
  37. package/src/components/ConfirmModal.test.tsx +0 -98
  38. package/src/components/ConfirmModal.tsx +0 -73
  39. package/src/components/ContactPopup.test.tsx +0 -98
  40. package/src/components/ContactPopup.tsx +0 -465
  41. package/src/components/CustomSelect.test.tsx +0 -47
  42. package/src/components/CustomSelect.tsx +0 -95
  43. package/src/components/DashboardNav.test.tsx +0 -98
  44. package/src/components/DashboardNav.tsx +0 -324
  45. package/src/components/Input.test.tsx +0 -33
  46. package/src/components/Input.tsx +0 -61
  47. package/src/components/JsonEditor.tsx +0 -578
  48. package/src/components/Navbar.test.tsx +0 -98
  49. package/src/components/Navbar.tsx +0 -569
  50. package/src/components/PhoneInputField.tsx +0 -30
  51. package/src/components/popoverSurface.test.ts +0 -48
  52. package/src/configs/forms/index.ts +0 -27
  53. package/src/configs/pages/admin.config.ts +0 -29
  54. package/src/configs/pages/contact.config.ts +0 -6
  55. package/src/configs/pages/home.config.ts +0 -19
  56. package/src/configs/pages/mem.config.ts +0 -2
  57. package/src/configs/pages/menuOrders.config.ts +0 -11
  58. package/src/configs/pages/pub.config.ts +0 -11
  59. package/src/configs/pages/shared.config.ts +0 -29
  60. package/src/configs/pages/support.config.ts +0 -7
  61. package/src/configs/pages/tabOrders.config.ts +0 -33
  62. package/src/configs/pages/user.config.ts +0 -29
  63. package/src/configs/registryMerge.test.ts +0 -73
  64. package/src/index.ts +0 -40
  65. package/src/lib/AuthContext.test.tsx +0 -95
  66. package/src/lib/AuthContext.tsx +0 -212
  67. package/src/lib/ConfigContext.tsx +0 -53
  68. package/src/lib/ThemeContext.test.tsx +0 -98
  69. package/src/lib/ThemeContext.tsx +0 -307
  70. package/src/lib/firebase.ts +0 -101
  71. package/src/main.tsx +0 -38
  72. package/src/pages/Dashboard.test.tsx +0 -98
  73. package/src/pages/Dashboard.tsx +0 -60
  74. package/src/pages/DynamicPage.tsx +0 -431
  75. package/src/pages/FormsAdmin.test.tsx +0 -98
  76. package/src/pages/FormsAdmin.tsx +0 -579
  77. package/src/pages/Home.test.tsx +0 -98
  78. package/src/pages/Login.test.tsx +0 -98
  79. package/src/pages/Login.tsx +0 -132
  80. package/src/pages/PagesAdmin.test.tsx +0 -98
  81. package/src/pages/PagesAdmin.tsx +0 -1160
  82. package/src/pages/Profile.test.tsx +0 -98
  83. package/src/pages/Profile.tsx +0 -319
  84. package/src/pages/Register.test.tsx +0 -98
  85. package/src/pages/Register.tsx +0 -134
  86. package/src/pages/Requests.test.tsx +0 -95
  87. package/src/pages/Requests.tsx +0 -470
  88. package/src/pages/ResetPassword.test.tsx +0 -98
  89. package/src/pages/ResetPassword.tsx +0 -92
  90. package/src/pages/Settings.test.tsx +0 -98
  91. package/src/pages/Settings.tsx +0 -403
  92. package/src/pages/Setup.tsx +0 -451
  93. package/src/pages/StorageAdmin.test.tsx +0 -150
  94. package/src/pages/StorageAdmin.tsx +0 -772
  95. package/src/pages/Submissions.test.tsx +0 -95
  96. package/src/pages/Submissions.tsx +0 -420
  97. package/src/pages/Templates.test.tsx +0 -98
  98. package/src/pages/Templates.tsx +0 -103
  99. package/src/pages/ThemeAdmin.test.tsx +0 -144
  100. package/src/pages/ThemeAdmin.tsx +0 -1026
  101. package/src/pages/Users.test.tsx +0 -95
  102. package/src/pages/Users.tsx +0 -340
  103. package/src/pages/Verify.test.tsx +0 -98
  104. package/src/pages/Verify.tsx +0 -95
  105. package/src/prompts/aiRules.test.ts +0 -113
  106. package/src/prompts/index.ts +0 -14
  107. package/src/prompts/pages/publicPage.ts +0 -58
  108. package/src/prompts/prompts.test.ts +0 -73
  109. package/src/prompts/shared.ts +0 -56
  110. package/src/prompts/tabs/board/adminboard.ts +0 -36
  111. package/src/prompts/tabs/board/privateboard.ts +0 -36
  112. package/src/prompts/tabs/board/publicboard.ts +0 -35
  113. package/src/prompts/tabs/calendar/admincalendar.ts +0 -37
  114. package/src/prompts/tabs/calendar/privatecalendar.ts +0 -37
  115. package/src/prompts/tabs/calendar/publiccalendar.ts +0 -36
  116. package/src/prompts/tabs/crud/admin.ts +0 -61
  117. package/src/prompts/tabs/crud/private.ts +0 -61
  118. package/src/prompts/tabs/crud/shared.ts +0 -61
  119. package/src/prompts/tabs/table/admintable.ts +0 -36
  120. package/src/prompts/tabs/table/privatetable.ts +0 -36
  121. package/src/prompts/tabs/table/publictable.ts +0 -35
  122. package/src/renderer.ts +0 -1
  123. package/src/setupTests.ts +0 -1
  124. package/src/templates/AdminPageTemplate.tsx +0 -1134
  125. package/src/templates/PrivatePageTemplate.tsx +0 -1071
  126. package/src/templates/PublicPageTemplate.tsx +0 -92
  127. package/src/templates/SharedPageTemplate.tsx +0 -1053
  128. package/src/templates/TemplateBoard.test.tsx +0 -106
  129. package/src/templates/TemplateBoard.tsx +0 -717
  130. package/src/templates/TemplateCalendar.test.tsx +0 -106
  131. package/src/templates/TemplateCalendar.tsx +0 -889
  132. package/src/templates/TemplateConfirmation.test.tsx +0 -106
  133. package/src/templates/TemplateConfirmation.tsx +0 -145
  134. package/src/templates/TemplateInlineForm.test.tsx +0 -106
  135. package/src/templates/TemplateInlineForm.tsx +0 -129
  136. package/src/templates/TemplatePopupForm.test.tsx +0 -106
  137. package/src/templates/TemplatePopupForm.tsx +0 -174
  138. package/src/templates/TemplateTable.test.tsx +0 -106
  139. package/src/templates/TemplateTable.tsx +0 -720
  140. package/src/templates/boardRegressions.test.tsx +0 -129
  141. package/src/templates/calendarModal.test.tsx +0 -109
  142. /package/dist/{PhoneInputField-BW6qYKeg.cjs → PhoneInputField-CQ7ylxOC.cjs} +0 -0
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # 🔥 Firebase OS
1
+ # 🔥 Your AI Firebase
2
2
 
3
- **A complete, production-ready Firebase admin OS — packaged as a single React component.**
3
+ **A complete, production-ready Firebase app — packaged as a single React component.**
4
4
 
5
- Authentication, user management, role-based access control, file storage, dynamic pages, form builder, theme customisation, and more — all behind one import.
5
+ Authentication, user management, role-based access control, file storage, pages your AI assistant builds, a form builder, a theme engine and an inbox — all behind one import.
6
6
 
7
7
  ```tsx
8
- import { FirebaseOS } from 'firebase-os';
9
- import 'firebase-os/styles.css';
8
+ import { FirebaseOS } from 'your-ai-workflow-firebase-os';
9
+ import 'your-ai-workflow-firebase-os/styles.css';
10
10
 
11
11
  export default function App() {
12
12
  return <FirebaseOS />;
@@ -15,6 +15,10 @@ export default function App() {
15
15
 
16
16
  That's it. **One component. Zero configuration files.**
17
17
 
18
+ > The component, the package and the `.firebase-os` CSS scope keep their original
19
+ > names — renaming them would break every existing install. The product is called
20
+ > Your AI Firebase.
21
+
18
22
  ---
19
23
 
20
24
  ## ✨ What you get
@@ -22,15 +26,17 @@ That's it. **One component. Zero configuration files.**
22
26
  | Feature | Details |
23
27
  |:--------|:--------|
24
28
  | 🔐 **Authentication** | Email/password, email verification, password reset |
25
- | 👥 **User Management** | Admin panel, role assignment, inactive user blocking |
26
- | 🗂️ **Dynamic Pages** | Create pages from the admin panelno code needed |
27
- | 📋 **Templates** | Board (Kanban), Calendar, Table, Inline Form, Popup Form, Confirmation |
29
+ | 👥 **User Management** | Admin panel, three access levels (Free · Internal · Admin), inactive user blocking |
30
+ | 🗂️ **Pages** | Ask your AI assistant for a page for anyone, signed-in users, your team or admins only — and it appears in `/pages`, where you rename it, reorder it, hide it or change its web address |
31
+ | 📋 **Templates** | Board (Kanban), Calendar, Table, Drive, Inline Form, Popup Form, Confirmation |
28
32
  | 🎨 **Theme Engine** | Full dark/light mode, custom accent colours, fonts, corner radii, logo |
29
- | 📁 **File Storage** | Firebase Storage drive with folder structure |
30
- | 📬 **Form Builder** | Contact forms, support forms fully customisable |
31
- | ⚙️ **Settings** | All admin settings via UI no `.env` editing needed after setup |
33
+ | 📁 **File Storage** | An admin-only Assets screen for public images, plus a drive preset any page can be built on |
34
+ | 📬 **Forms** | Ask the AI for a form — it shows up in `/forms`, where the title, fields and button text are editable |
35
+ | 📥 **Inbox** | Every form entry in one list at `/inbox`, filtered "From anyone" or "From signed-in users" |
36
+ | 📖 **Guide** | A walkthrough at `/guide` with the sentences to paste into your assistant |
32
37
  | 📊 **Dashboard** | Personalised user dashboard |
33
- | 🧑‍💼 **Submissions & Requests** | Track form submissions and user requests |
38
+
39
+ Ordering, visibility, renaming and deleting all live on the Pages screen — there is no separate settings screen, no Submissions screen and no Requests screen.
34
40
 
35
41
  ---
36
42
 
@@ -46,56 +52,53 @@ npm install firebase react react-dom react-router-dom
46
52
 
47
53
  **From npm:**
48
54
  ```bash
49
- npm install firebase-os
55
+ npm install your-ai-workflow-firebase-os
50
56
  ```
51
57
 
52
58
  **From a local build (development):**
53
59
  ```bash
54
- npm pack # in the firebase-os repo
55
- npm install /path/to/firebase-os-1.0.0.tgz # in your app
60
+ npm pack # in this repo
61
+ npm install /path/to/your-ai-workflow-firebase-os-1.0.0.tgz # in your app
56
62
  ```
57
63
 
64
+ Installing runs a postinstall step that patches the consumer project: it clears Vite's default CSS, injects the library imports into `src/main.tsx` (additively — a customised entry point is never overwritten), creates `src/your-ai-workflow-firebase-os/` with the editable theme and configs, and writes `GEMINI.md` / `AGENTS.md`.
65
+
58
66
  ---
59
67
 
60
68
  ## 🚀 Quick Start
61
69
 
62
70
  ### Option A — Zero config (recommended)
63
71
 
64
- On first load, Firebase OS shows a **Setup Wizard** that guides you through pasting your Firebase project credentials. Nothing is stored on any server — keys are saved in your browser's `localStorage`.
72
+ On first load the app opens its **Setup screen**, which walks through connecting a Firebase project. Nothing is stored on any server — keys are saved in the browser's `localStorage`.
65
73
 
66
74
  ```tsx
67
75
  // App.tsx
68
- import { FirebaseOS } from 'firebase-os';
69
- import 'firebase-os/styles.css';
76
+ import { FirebaseOS } from 'your-ai-workflow-firebase-os';
77
+ import 'your-ai-workflow-firebase-os/styles.css';
70
78
 
71
79
  export default function App() {
72
80
  return <FirebaseOS />;
73
81
  }
74
82
  ```
75
83
 
76
- 1. Run your app
77
- 2. The Setup Wizard opens automatically
78
- 3. Paste your Firebase config (from the Firebase Console)
79
- 4. Done — the full OS loads
80
-
81
84
  ### Option B — Pre-configured (CI/CD, teams)
82
85
 
83
- Skip the wizard entirely by passing your Firebase config as props:
86
+ Skip the setup screen entirely by passing the Firebase config as props:
84
87
 
85
88
  ```tsx
86
- import { FirebaseOS } from 'firebase-os';
87
- import 'firebase-os/styles.css';
89
+ import { FirebaseOS } from 'your-ai-workflow-firebase-os';
90
+ import 'your-ai-workflow-firebase-os/styles.css';
88
91
 
89
92
  export default function App() {
90
93
  return (
91
94
  <FirebaseOS
92
95
  firebaseConfig={{
93
- apiKey: import.meta.env.VITE_API_KEY,
94
- authDomain: import.meta.env.VITE_AUTH_DOMAIN,
95
- projectId: import.meta.env.VITE_PROJECT_ID,
96
- storageBucket: import.meta.env.VITE_STORAGE_BUCKET,
97
- messagingSenderId: import.meta.env.VITE_MESSAGING_SENDER_ID,
98
- appId: import.meta.env.VITE_APP_ID,
96
+ apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
97
+ authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
98
+ projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
99
+ storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
100
+ messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
101
+ appId: import.meta.env.VITE_FIREBASE_APP_ID,
99
102
  }}
100
103
  adminEmails={['you@yourcompany.com']}
101
104
  />
@@ -110,8 +113,8 @@ export default function App() {
110
113
  ```typescript
111
114
  interface FirebaseOSProps {
112
115
  /**
113
- * Pass Firebase config directly to skip the Setup Wizard.
114
- * If omitted, the wizard runs on first load and saves config to localStorage.
116
+ * Pass Firebase config directly to skip the Setup screen.
117
+ * If omitted, setup runs on first load and saves config to localStorage.
115
118
  */
116
119
  firebaseConfig?: {
117
120
  apiKey: string;
@@ -123,24 +126,36 @@ interface FirebaseOSProps {
123
126
  };
124
127
 
125
128
  /**
126
- * Email addresses that are automatically assigned the 'admin' role
127
- * on their first login. Replaces the VITE_ADMIN_EMAILS env var.
129
+ * Email addresses that are automatically assigned the 'admin' role once
130
+ * they have verified their email. Replaces the VITE_ADMIN_EMAILS env var.
131
+ * The same addresses have to be in the Firestore rules you pasted during
132
+ * setup — /setup writes them in for you — since the rules, not the client,
133
+ * are what actually grant the role.
128
134
  */
129
135
  adminEmails?: string[];
130
136
 
131
- /**
132
- * Custom router basename (e.g. "/app" if your app lives at a subdirectory).
133
- */
137
+ /** Theme defaults from your own theme.config.ts. */
138
+ themeConfig?: any;
139
+
140
+ /** Auto-discovered page content files, keyed by page id. */
141
+ microcomponents?: Record<string, React.ComponentType<any>>;
142
+
143
+ /** Local overrides for built-in components — `{ Home }` is the usual one. */
144
+ components?: { Home?: React.ComponentType<any> };
145
+
146
+ /** Default form configs shipped with your project. */
147
+ defaultConfigs?: { contactForm?: any; supportForm?: any };
148
+
149
+ /** Custom router basename (e.g. "/app" if your app lives at a subdirectory). */
134
150
  basename?: string;
135
151
 
136
- /**
137
- * Callback fired whenever the Firebase auth state changes.
138
- * Useful for integrating with your own auth layer.
139
- */
152
+ /** Callback fired whenever the Firebase auth state changes. */
140
153
  onAuthChange?: (user: any) => void;
141
154
  }
142
155
  ```
143
156
 
157
+ The postinstall step writes an `App.tsx` that already passes `themeConfig`, `microcomponents`, `components` and `defaultConfigs` for you.
158
+
144
159
  ---
145
160
 
146
161
  ## 🪝 Advanced: Hooks
@@ -148,7 +163,7 @@ interface FirebaseOSProps {
148
163
  For advanced integrations, two hooks are exported from the library:
149
164
 
150
165
  ```tsx
151
- import { useAuth, useTheme } from 'firebase-os';
166
+ import { useAuth, useTheme } from 'your-ai-workflow-firebase-os';
152
167
 
153
168
  // Access auth state anywhere inside <FirebaseOS />
154
169
  function MyWidget() {
@@ -170,6 +185,8 @@ function MyWidget() {
170
185
  4. Copy the `firebaseConfig` object
171
186
  5. Enable **Authentication** (Email/Password), **Firestore**, and **Storage** in your project
172
187
 
188
+ The Setup screen in the app walks through all of this and generates the security rules to paste, so nobody has to work it out from here.
189
+
173
190
  ---
174
191
 
175
192
  ## 🎨 Theming
@@ -180,9 +197,17 @@ All CSS is scoped to `.firebase-os` — the library's styles **do not leak** int
180
197
 
181
198
  ---
182
199
 
200
+ ## 🤖 Working with the AI
201
+
202
+ Your AI Firebase is built to be driven from an AI chat (Google AI Studio, Cursor, Claude Code…). On install it writes **`GEMINI.md` / `AGENTS.md`** into the project: what the assistant may build, which words to use with the owner, and what it must never touch.
203
+
204
+ **That file is the contract, and it is the only copy.** It is generated by [`scripts/postinstall.js`](scripts/postinstall.js) — read it there, and change it there. This README deliberately does not restate it, so the two can never disagree.
205
+
206
+ The short version for a person evaluating the library: you ask for a page or a form in plain language, the assistant writes it, and it appears on the `/pages` or `/forms` screen where the basics — name, web address, icon, linked form, order, visibility — are yours to edit. Everything else is the assistant's job; ask it in chat.
207
+
183
208
  ## 📐 CSS Isolation
184
209
 
185
- Firebase OS uses a `.firebase-os` container div for all its CSS variable scope. This means:
210
+ The library uses a `.firebase-os` container div for all its CSS variable scope. This means:
186
211
 
187
212
  - ✅ Library's theme variables stay inside `.firebase-os`
188
213
  - ✅ Your own `:root` variables are untouched
@@ -198,7 +223,7 @@ Firebase OS uses a `.firebase-os` container div for all its CSS variable scope.
198
223
  - **Files** — your own Firebase Storage
199
224
  - **Theme / page config** — your own Firestore (`sys_configs` collection)
200
225
 
201
- You own all your data. Firebase OS is just the UI layer.
226
+ You own all your data. Your AI Firebase is just the UI layer.
202
227
 
203
228
  ---
204
229
 
@@ -214,17 +239,18 @@ src/
214
239
  │ ├── AuthContext ← Auth lifecycle (internal)
215
240
  │ ├── ThemeContext ← CSS variable injection (internal)
216
241
  │ └── ConfigContext ← Library props → internal bridge
217
- ├── pages/ ← 17 page components (internal)
218
- ├── templates/ ← 8 template components (internal)
219
- ├── components/ ← Shared UI (internal)
220
- └── configs/ ← Default configurations (internal)
242
+ ├── pages/ ← Page components (internal)
243
+ ├── templates/ ← Template components (internal)
244
+ ├── components/ ← Shared UI, incl. components/fields (internal)
245
+ ├── configs/ ← Default configurations (internal)
246
+ └── contract/ ← Tests pinning the generated GEMINI.md contract
221
247
  ```
222
248
 
223
249
  ### Scripts
224
250
 
225
251
  ```bash
226
252
  npm run dev # Run standalone app (for development)
227
- npm run test # Run test suite (47 tests)
253
+ npm run test # Run the test suite
228
254
  npm run build:lib # Build the distributable library
229
255
  npm pack # Create .tgz for local testing
230
256
  ```