your-ai-workflow-firebase-os 1.2.34 → 1.2.36

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 (147) hide show
  1. package/README.md +83 -51
  2. package/dist/{ContactPopup-DSNsuxh7.js → ContactPopup-Bm3DZkEB.js} +6418 -6311
  3. package/dist/ContactPopup-DY0VLjCP.cjs +9 -0
  4. package/dist/FirebaseOS.d.ts +1 -0
  5. package/dist/{PhoneInputField-CThRwHdg.js → PhoneInputField-ChHip6t8.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/vite/index.d.ts +9 -0
  12. package/dist/vite.cjs.js +160 -0
  13. package/dist/vite.es.js +371 -0
  14. package/dist/your-ai-workflow-firebase-os.cjs.js +320 -559
  15. package/dist/your-ai-workflow-firebase-os.css +1 -1
  16. package/dist/your-ai-workflow-firebase-os.es.js +7294 -7541
  17. package/package.json +17 -4
  18. package/scripts/patchViteConfig.js +56 -0
  19. package/scripts/postinstall.js +610 -244
  20. package/src/configs/forms/contactForm.config.ts +0 -1
  21. package/src/configs/forms/supportForm.config.ts +0 -1
  22. package/src/configs/theme.config.ts +2 -2
  23. package/src/index.css +6 -1
  24. package/src/microcomponents/registry.ts +7 -1
  25. package/src/pages/Home.tsx +42 -123
  26. package/dist/ContactPopup-Dkcz2L0f.cjs +0 -9
  27. package/dist/theme.config-B2y1axZf.js +0 -2
  28. package/dist/theme.config-B3k_BrAV.cjs +0 -1
  29. package/dist/theme.config-D05RQKVy.js +0 -68
  30. package/scripts/logoProtection.test.ts +0 -70
  31. package/scripts/popoverCss.test.ts +0 -46
  32. package/src/App.css +0 -184
  33. package/src/App.tsx +0 -214
  34. package/src/FirebaseOS.tsx +0 -102
  35. package/src/assets/hero.png +0 -0
  36. package/src/assets/react.svg +0 -1
  37. package/src/assets/vite.svg +0 -1
  38. package/src/components/AdminNotifications.test.tsx +0 -98
  39. package/src/components/AdminNotifications.tsx +0 -194
  40. package/src/components/Button.test.tsx +0 -22
  41. package/src/components/Button.tsx +0 -53
  42. package/src/components/ConfirmModal.test.tsx +0 -98
  43. package/src/components/ConfirmModal.tsx +0 -73
  44. package/src/components/ContactPopup.test.tsx +0 -98
  45. package/src/components/ContactPopup.tsx +0 -465
  46. package/src/components/CustomSelect.test.tsx +0 -47
  47. package/src/components/CustomSelect.tsx +0 -95
  48. package/src/components/DashboardNav.test.tsx +0 -98
  49. package/src/components/DashboardNav.tsx +0 -324
  50. package/src/components/Input.test.tsx +0 -33
  51. package/src/components/Input.tsx +0 -61
  52. package/src/components/JsonEditor.tsx +0 -578
  53. package/src/components/Navbar.test.tsx +0 -98
  54. package/src/components/Navbar.tsx +0 -569
  55. package/src/components/PhoneInputField.tsx +0 -30
  56. package/src/components/popoverSurface.test.ts +0 -48
  57. package/src/configs/forms/index.ts +0 -27
  58. package/src/configs/pages/admin.config.ts +0 -29
  59. package/src/configs/pages/contact.config.ts +0 -6
  60. package/src/configs/pages/home.config.ts +0 -19
  61. package/src/configs/pages/mem.config.ts +0 -2
  62. package/src/configs/pages/menuOrders.config.ts +0 -11
  63. package/src/configs/pages/pub.config.ts +0 -11
  64. package/src/configs/pages/shared.config.ts +0 -29
  65. package/src/configs/pages/support.config.ts +0 -7
  66. package/src/configs/pages/tabOrders.config.ts +0 -33
  67. package/src/configs/pages/user.config.ts +0 -29
  68. package/src/configs/registryMerge.test.ts +0 -73
  69. package/src/index.ts +0 -40
  70. package/src/lib/AuthContext.test.tsx +0 -95
  71. package/src/lib/AuthContext.tsx +0 -212
  72. package/src/lib/ConfigContext.tsx +0 -53
  73. package/src/lib/ThemeContext.test.tsx +0 -98
  74. package/src/lib/ThemeContext.tsx +0 -307
  75. package/src/lib/firebase.ts +0 -101
  76. package/src/main.tsx +0 -38
  77. package/src/pages/Dashboard.test.tsx +0 -98
  78. package/src/pages/Dashboard.tsx +0 -60
  79. package/src/pages/DynamicPage.tsx +0 -431
  80. package/src/pages/FormsAdmin.test.tsx +0 -98
  81. package/src/pages/FormsAdmin.tsx +0 -579
  82. package/src/pages/Home.test.tsx +0 -98
  83. package/src/pages/Login.test.tsx +0 -98
  84. package/src/pages/Login.tsx +0 -132
  85. package/src/pages/PagesAdmin.test.tsx +0 -98
  86. package/src/pages/PagesAdmin.tsx +0 -1160
  87. package/src/pages/Profile.test.tsx +0 -98
  88. package/src/pages/Profile.tsx +0 -319
  89. package/src/pages/Register.test.tsx +0 -98
  90. package/src/pages/Register.tsx +0 -134
  91. package/src/pages/Requests.test.tsx +0 -95
  92. package/src/pages/Requests.tsx +0 -470
  93. package/src/pages/ResetPassword.test.tsx +0 -98
  94. package/src/pages/ResetPassword.tsx +0 -92
  95. package/src/pages/Settings.test.tsx +0 -98
  96. package/src/pages/Settings.tsx +0 -403
  97. package/src/pages/Setup.tsx +0 -451
  98. package/src/pages/StorageAdmin.test.tsx +0 -150
  99. package/src/pages/StorageAdmin.tsx +0 -772
  100. package/src/pages/Submissions.test.tsx +0 -95
  101. package/src/pages/Submissions.tsx +0 -420
  102. package/src/pages/Templates.test.tsx +0 -98
  103. package/src/pages/Templates.tsx +0 -103
  104. package/src/pages/ThemeAdmin.test.tsx +0 -144
  105. package/src/pages/ThemeAdmin.tsx +0 -1026
  106. package/src/pages/Users.test.tsx +0 -95
  107. package/src/pages/Users.tsx +0 -340
  108. package/src/pages/Verify.test.tsx +0 -98
  109. package/src/pages/Verify.tsx +0 -95
  110. package/src/prompts/aiRules.test.ts +0 -113
  111. package/src/prompts/index.ts +0 -14
  112. package/src/prompts/pages/publicPage.ts +0 -58
  113. package/src/prompts/prompts.test.ts +0 -73
  114. package/src/prompts/shared.ts +0 -57
  115. package/src/prompts/tabs/board/adminboard.ts +0 -36
  116. package/src/prompts/tabs/board/privateboard.ts +0 -36
  117. package/src/prompts/tabs/board/publicboard.ts +0 -35
  118. package/src/prompts/tabs/calendar/admincalendar.ts +0 -37
  119. package/src/prompts/tabs/calendar/privatecalendar.ts +0 -37
  120. package/src/prompts/tabs/calendar/publiccalendar.ts +0 -36
  121. package/src/prompts/tabs/crud/admin.ts +0 -61
  122. package/src/prompts/tabs/crud/private.ts +0 -61
  123. package/src/prompts/tabs/crud/shared.ts +0 -61
  124. package/src/prompts/tabs/table/admintable.ts +0 -36
  125. package/src/prompts/tabs/table/privatetable.ts +0 -36
  126. package/src/prompts/tabs/table/publictable.ts +0 -35
  127. package/src/renderer.ts +0 -1
  128. package/src/setupTests.ts +0 -1
  129. package/src/templates/AdminPageTemplate.tsx +0 -1134
  130. package/src/templates/PrivatePageTemplate.tsx +0 -1071
  131. package/src/templates/PublicPageTemplate.tsx +0 -92
  132. package/src/templates/SharedPageTemplate.tsx +0 -1053
  133. package/src/templates/TemplateBoard.test.tsx +0 -106
  134. package/src/templates/TemplateBoard.tsx +0 -717
  135. package/src/templates/TemplateCalendar.test.tsx +0 -106
  136. package/src/templates/TemplateCalendar.tsx +0 -889
  137. package/src/templates/TemplateConfirmation.test.tsx +0 -106
  138. package/src/templates/TemplateConfirmation.tsx +0 -145
  139. package/src/templates/TemplateInlineForm.test.tsx +0 -106
  140. package/src/templates/TemplateInlineForm.tsx +0 -129
  141. package/src/templates/TemplatePopupForm.test.tsx +0 -106
  142. package/src/templates/TemplatePopupForm.tsx +0 -174
  143. package/src/templates/TemplateTable.test.tsx +0 -106
  144. package/src/templates/TemplateTable.tsx +0 -720
  145. package/src/templates/boardRegressions.test.tsx +0 -129
  146. package/src/templates/calendarModal.test.tsx +0 -109
  147. /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,59 @@ 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, writes `src/main.tsx` and `src/App.tsx` (both are owned by the library — see below), adds `yourAiFirebase()` from `your-ai-workflow-firebase-os/vite` and Tailwind to `vite.config.ts`, creates `src/your-ai-workflow-firebase-os/` with the editable theme and configs, and writes `GEMINI.md` / `AGENTS.md`.
65
+
66
+ ### What the build enforces
67
+
68
+ The package ships a Vite plugin, `yourAiFirebase()`, that puts the project's structure out of the assistant's reach. `src/App.tsx` and `src/main.tsx` are owned files: the plugin serves its own canonical source for both and rewrites them on disk whenever they differ, so an edit there has no effect. Pages, forms and content files are discovered from `src/your-ai-workflow-firebase-os/configs/` and `microcomponents/` through a virtual module, so a deleted registry import can no longer make a page vanish. And every discovered file is validated before the build: a config file with the wrong name, a `route` that is not one string starting with `/`, an address used twice, a `*Tab.config.ts` without a valid `pageType`, a missing `*Config` export, a `systemName` that does not match the file, or a content file with no default export fails the build with one sentence that names the fix. A hand-written `<form>` in a content file only warns — its entries would never reach the Inbox.
69
+
70
+ Manual-first recipe: the owner adds the page on `/pages` (or the form on `/forms`) and then asks the assistant for the content, which is a single `microcomponents/<PascalCaseName>Content.tsx` file — no config file, no second address.
71
+
58
72
  ---
59
73
 
60
74
  ## 🚀 Quick Start
61
75
 
62
76
  ### Option A — Zero config (recommended)
63
77
 
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`.
78
+ 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
79
 
66
80
  ```tsx
67
81
  // App.tsx
68
- import { FirebaseOS } from 'firebase-os';
69
- import 'firebase-os/styles.css';
82
+ import { FirebaseOS } from 'your-ai-workflow-firebase-os';
83
+ import 'your-ai-workflow-firebase-os/styles.css';
70
84
 
71
85
  export default function App() {
72
86
  return <FirebaseOS />;
73
87
  }
74
88
  ```
75
89
 
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
90
  ### Option B — Pre-configured (CI/CD, teams)
82
91
 
83
- Skip the wizard entirely by passing your Firebase config as props:
92
+ Skip the setup screen entirely by passing the Firebase config as props:
84
93
 
85
94
  ```tsx
86
- import { FirebaseOS } from 'firebase-os';
87
- import 'firebase-os/styles.css';
95
+ import { FirebaseOS } from 'your-ai-workflow-firebase-os';
96
+ import 'your-ai-workflow-firebase-os/styles.css';
88
97
 
89
98
  export default function App() {
90
99
  return (
91
100
  <FirebaseOS
92
101
  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,
102
+ apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
103
+ authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
104
+ projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
105
+ storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
106
+ messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
107
+ appId: import.meta.env.VITE_FIREBASE_APP_ID,
99
108
  }}
100
109
  adminEmails={['you@yourcompany.com']}
101
110
  />
@@ -110,8 +119,8 @@ export default function App() {
110
119
  ```typescript
111
120
  interface FirebaseOSProps {
112
121
  /**
113
- * Pass Firebase config directly to skip the Setup Wizard.
114
- * If omitted, the wizard runs on first load and saves config to localStorage.
122
+ * Pass Firebase config directly to skip the Setup screen.
123
+ * If omitted, setup runs on first load and saves config to localStorage.
115
124
  */
116
125
  firebaseConfig?: {
117
126
  apiKey: string;
@@ -123,24 +132,36 @@ interface FirebaseOSProps {
123
132
  };
124
133
 
125
134
  /**
126
- * Email addresses that are automatically assigned the 'admin' role
127
- * on their first login. Replaces the VITE_ADMIN_EMAILS env var.
135
+ * Email addresses that are automatically assigned the 'admin' role once
136
+ * they have verified their email. Replaces the VITE_ADMIN_EMAILS env var.
137
+ * The same addresses have to be in the Firestore rules you pasted during
138
+ * setup — /setup writes them in for you — since the rules, not the client,
139
+ * are what actually grant the role.
128
140
  */
129
141
  adminEmails?: string[];
130
142
 
131
- /**
132
- * Custom router basename (e.g. "/app" if your app lives at a subdirectory).
133
- */
143
+ /** Theme defaults from your own theme.config.ts. */
144
+ themeConfig?: any;
145
+
146
+ /** Auto-discovered page content files, keyed by page id. */
147
+ microcomponents?: Record<string, React.ComponentType<any>>;
148
+
149
+ /** Local overrides for built-in components — `{ Home }` is the usual one. */
150
+ components?: { Home?: React.ComponentType<any> };
151
+
152
+ /** Default form configs shipped with your project. */
153
+ defaultConfigs?: { contactForm?: any; supportForm?: any };
154
+
155
+ /** Custom router basename (e.g. "/app" if your app lives at a subdirectory). */
134
156
  basename?: string;
135
157
 
136
- /**
137
- * Callback fired whenever the Firebase auth state changes.
138
- * Useful for integrating with your own auth layer.
139
- */
158
+ /** Callback fired whenever the Firebase auth state changes. */
140
159
  onAuthChange?: (user: any) => void;
141
160
  }
142
161
  ```
143
162
 
163
+ The postinstall step writes an `App.tsx` that already passes `themeConfig`, `microcomponents`, `components` and `defaultConfigs` for you.
164
+
144
165
  ---
145
166
 
146
167
  ## 🪝 Advanced: Hooks
@@ -148,7 +169,7 @@ interface FirebaseOSProps {
148
169
  For advanced integrations, two hooks are exported from the library:
149
170
 
150
171
  ```tsx
151
- import { useAuth, useTheme } from 'firebase-os';
172
+ import { useAuth, useTheme } from 'your-ai-workflow-firebase-os';
152
173
 
153
174
  // Access auth state anywhere inside <FirebaseOS />
154
175
  function MyWidget() {
@@ -170,6 +191,8 @@ function MyWidget() {
170
191
  4. Copy the `firebaseConfig` object
171
192
  5. Enable **Authentication** (Email/Password), **Firestore**, and **Storage** in your project
172
193
 
194
+ 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.
195
+
173
196
  ---
174
197
 
175
198
  ## 🎨 Theming
@@ -180,9 +203,17 @@ All CSS is scoped to `.firebase-os` — the library's styles **do not leak** int
180
203
 
181
204
  ---
182
205
 
206
+ ## 🤖 Working with the AI
207
+
208
+ 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.
209
+
210
+ **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.
211
+
212
+ 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.
213
+
183
214
  ## 📐 CSS Isolation
184
215
 
185
- Firebase OS uses a `.firebase-os` container div for all its CSS variable scope. This means:
216
+ The library uses a `.firebase-os` container div for all its CSS variable scope. This means:
186
217
 
187
218
  - ✅ Library's theme variables stay inside `.firebase-os`
188
219
  - ✅ Your own `:root` variables are untouched
@@ -198,7 +229,7 @@ Firebase OS uses a `.firebase-os` container div for all its CSS variable scope.
198
229
  - **Files** — your own Firebase Storage
199
230
  - **Theme / page config** — your own Firestore (`sys_configs` collection)
200
231
 
201
- You own all your data. Firebase OS is just the UI layer.
232
+ You own all your data. Your AI Firebase is just the UI layer.
202
233
 
203
234
  ---
204
235
 
@@ -214,17 +245,18 @@ src/
214
245
  │ ├── AuthContext ← Auth lifecycle (internal)
215
246
  │ ├── ThemeContext ← CSS variable injection (internal)
216
247
  │ └── 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)
248
+ ├── pages/ ← Page components (internal)
249
+ ├── templates/ ← Template components (internal)
250
+ ├── components/ ← Shared UI, incl. components/fields (internal)
251
+ ├── configs/ ← Default configurations (internal)
252
+ └── contract/ ← Tests pinning the generated GEMINI.md contract
221
253
  ```
222
254
 
223
255
  ### Scripts
224
256
 
225
257
  ```bash
226
258
  npm run dev # Run standalone app (for development)
227
- npm run test # Run test suite (47 tests)
259
+ npm run test # Run the test suite
228
260
  npm run build:lib # Build the distributable library
229
261
  npm pack # Create .tgz for local testing
230
262
  ```