firebase-os 1.1.8 → 1.2.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/dist/firebase-os.cjs.js +1 -1
- package/dist/firebase-os.es.js +2 -2
- package/package.json +2 -2
- package/scripts/postinstall.js +11 -5
- package/src/App.tsx +2 -2
- package/src/pages/Setup.tsx +2 -2
package/dist/firebase-os.cjs.js
CHANGED
|
@@ -608,7 +608,7 @@ VITE_FIREBASE_APP_ID=1:123456789012:web:abcdef123456
|
|
|
608
608
|
VITE_ADMIN_EMAILS=your@email.com,other@email.com`;function EHn({code:e,label:t}){let[n,r]=m.default.useState(!1);return(0,y.jsxs)(q.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},className:`inline-flex items-center gap-2 px-4 py-2 mt-2 rounded-xl text-[13px] font-bold tracking-wide transition-all ${n?`bg-emerald-500/10 text-emerald-500 border border-emerald-500/20`:`btn-secondary shadow-sm`}`,children:[n?(0,y.jsx)(be,{className:`w-4 h-4`}):(0,y.jsx)(je,{className:`w-4 h-4`}),n?`Copied to Clipboard!`:t]})}function DHn({code:e}){let[t,n]=m.default.useState(!1);return(0,y.jsxs)(`div`,{className:`my-5 glass-panel border border-[var(--panel-border)] rounded-2xl overflow-hidden shadow-inner bg-background`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 border-b border-[var(--panel-border)]/50 bg-foreground/[0.02]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(it,{className:`w-3.5 h-3.5 text-foreground/30`}),(0,y.jsx)(`span`,{className:`text-[11px] font-bold uppercase tracking-widest text-foreground/30`,children:`.env`})]}),(0,y.jsxs)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},className:`text-[11px] font-bold uppercase tracking-wider flex items-center gap-1.5 transition-colors ${t?`text-emerald-500`:`text-accent hover:text-accent-deep`}`,children:[t?(0,y.jsx)(be,{className:`w-3.5 h-3.5`}):(0,y.jsx)(je,{className:`w-3.5 h-3.5`}),t?`Copied`:`Copy`]})]}),(0,y.jsx)(`pre`,{className:`p-4 md:p-5 overflow-x-auto text-[13px] leading-[1.8] font-mono styled-scrollbars`,children:(0,y.jsx)(`code`,{children:e.split(`
|
|
609
609
|
`).map((e,t)=>{let n=e.indexOf(`=`);if(n===-1)return(0,y.jsxs)(`span`,{className:`text-foreground/30`,children:[e,`
|
|
610
610
|
`]},t);let r=e.substring(0,n),i=e.substring(n+1);return(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`span`,{className:`text-accent`,children:r}),(0,y.jsx)(`span`,{className:`text-foreground/30`,children:`=`}),(0,y.jsx)(`span`,{className:`text-foreground/60`,children:i}),`
|
|
611
|
-
`]},t)})})})]})}function Y9({title:e,children:t}){return(0,y.jsxs)(`div`,{className:`flex flex-col relative pb-10 mb-10 border-b border-[var(--panel-border)]/50 last:border-0 last:pb-0 last:mb-0`,children:[(0,y.jsx)(`div`,{className:`flex items-center gap-3 mb-4`,children:(0,y.jsx)(`h3`,{className:`text-[17px] md:text-[19px] font-extrabold text-foreground tracking-tight`,children:e})}),(0,y.jsx)(`div`,{className:`text-[14px] md:text-[15px] text-foreground/70 leading-relaxed space-y-4`,children:t})]})}function OHn({standalone:e}){let[t,n]=(0,m.useState)(()=>{let e=localStorage.getItem(`theme-mode`);return e===`light`?!1:e===`dark`?!0:window.matchMedia(`(prefers-color-scheme: dark)`).matches}),[r,i]=(0,m.useState)(null),[a,o]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{e&&document.documentElement.setAttribute(`data-theme`,t?`dark`:`light`)},[t,e]),(0,m.useEffect)(()=>{if(e&&d.t.faviconUrl){let e=document.querySelector(`link[rel*='icon']`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=d.t.faviconUrl}},[e]),(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col min-h-screen`,children:[(0,y.jsx)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6 flex items-center justify-between`,children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:`Setup`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/setup`]})]})}),(0,y.jsx)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden bg-background flex flex-col`,children:[(0,y.jsxs)(`div`,{className:`
|
|
611
|
+
`]},t)})})})]})}function Y9({title:e,children:t}){return(0,y.jsxs)(`div`,{className:`flex flex-col relative pb-10 mb-10 border-b border-[var(--panel-border)]/50 last:border-0 last:pb-0 last:mb-0`,children:[(0,y.jsx)(`div`,{className:`flex items-center gap-3 mb-4`,children:(0,y.jsx)(`h3`,{className:`text-[17px] md:text-[19px] font-extrabold text-foreground tracking-tight`,children:e})}),(0,y.jsx)(`div`,{className:`text-[14px] md:text-[15px] text-foreground/70 leading-relaxed space-y-4`,children:t})]})}function OHn({standalone:e}){let[t,n]=(0,m.useState)(()=>{let e=localStorage.getItem(`theme-mode`);return e===`light`?!1:e===`dark`?!0:window.matchMedia(`(prefers-color-scheme: dark)`).matches}),[r,i]=(0,m.useState)(null),[a,o]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{e&&document.documentElement.setAttribute(`data-theme`,t?`dark`:`light`)},[t,e]),(0,m.useEffect)(()=>{if(e&&d.t.faviconUrl){let e=document.querySelector(`link[rel*='icon']`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=d.t.faviconUrl}},[e]),(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col min-h-screen`,children:[(0,y.jsx)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6 flex items-center justify-between`,children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:`Setup`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/setup`]})]})}),(0,y.jsx)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden bg-background flex flex-col`,children:[(0,y.jsxs)(`div`,{className:`mb-8 pb-6 border-b border-[var(--panel-border)]/50 relative z-10`,children:[(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-xl font-extrabold text-foreground tracking-tight`,children:`Firebase Configuration`}),(0,y.jsx)(`p`,{className:`text-[14px] font-medium text-foreground/50 mt-2 leading-relaxed`,children:`Follow these steps to connect your Firebase project. Takes about 5 minutes.`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,y.jsx)(q.a,{whileHover:{scale:1.05},whileTap:{scale:.95},href:`mailto:antonina@youraiworkflow.co`,title:`Email Support`,className:`w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-300 cursor-pointer btn-secondary`,children:(0,y.jsx)(Xe,{className:`w-4 h-4`})}),(0,y.jsx)(q.a,{whileHover:{scale:1.05},whileTap:{scale:.95},href:`https://wa.me/34632407883`,target:`_blank`,rel:`noopener noreferrer`,title:`WhatsApp Support`,className:`w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-300 cursor-pointer btn-secondary`,children:(0,y.jsx)(ain,{className:`w-4 h-4 text-foreground/80`})}),(0,y.jsxs)(q.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>{o(!0),i(null),setTimeout(()=>{let e=xHn();i({missing:e.missing,empty:e.empty,missingAdminEmails:e.missingAdminEmails}),e.allSet&&setTimeout(()=>{window.location.href=`/`},1800),o(!1)},800)},disabled:a,className:`h-10 px-4 flex items-center justify-center gap-2 rounded-xl transition-all duration-300 cursor-pointer btn-primary shadow-lg disabled:opacity-50 disabled:cursor-not-allowed ml-2`,title:`Verify Configuration`,children:[a?(0,y.jsx)(W,{className:`w-4 h-4 animate-spin`}):(0,y.jsx)(Ajt,{className:`w-4 h-4`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold hidden sm:block`,children:`Verify Setup`})]})]})]}),r&&r.missing.length>0&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex flex-col gap-2 mt-2 bg-red-500/5 border border-red-500/10 p-4 rounded-2xl`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[13px]`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-red-500/10 border border-red-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Te,{className:`w-4 h-4 text-red-500`})}),(0,y.jsx)(`span`,{className:`font-bold text-foreground/70`,children:r.empty&&r.empty.length>0?(0,y.jsxs)(y.Fragment,{children:[`These values are `,(0,y.jsx)(`span`,{className:`text-red-500`,children:`empty`}),` — fill them in your `,(0,y.jsx)(`code`,{className:`text-accent text-[12px]`,children:`.env`}),` file and restart the dev server`]}):(0,y.jsxs)(y.Fragment,{children:[`Missing values — update `,(0,y.jsx)(`code`,{className:`text-accent text-[12px]`,children:`.env`}),` and restart dev server`]})})]}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5 ml-10`,children:r.missing.map(e=>(0,y.jsx)(`span`,{className:`px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider rounded-lg bg-red-500/10 border border-red-500/20 text-red-500`,children:e},e))})]}),r&&r.missing.length===0&&r.missingAdminEmails&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex items-center gap-2.5 mt-2 bg-yellow-500/5 border border-yellow-500/10 p-4 rounded-2xl`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-yellow-500/10 border border-yellow-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Te,{className:`w-4 h-4 text-yellow-500`})}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold text-yellow-500`,children:`Warning: No Admin Emails configured. App is operational. Redirecting…`})]}),r&&r.missing.length===0&&!r.missingAdminEmails&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex items-center gap-2.5 mt-2 bg-emerald-500/5 border border-emerald-500/10 p-4 rounded-2xl`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Ee,{className:`w-4 h-4 text-emerald-500`})}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold text-emerald-500`,children:`All configured — redirecting…`})]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col relative z-10 p-6 md:p-8 bg-foreground/[0.015] rounded-3xl border border-[var(--panel-border)]/50 mt-4`,children:[(0,y.jsx)(Y9,{title:`Create a Firebase Project`,children:(0,y.jsxs)(`p`,{children:[`1. Navigate to`,` `,(0,y.jsx)(`a`,{href:`https://console.firebase.google.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent underline underline-offset-2 font-semibold hover:text-accent-deep transition-colors`,children:`console.firebase.google.com`}),` `,`and click `,(0,y.jsx)(`strong`,{children:`Add Project`}),`. `,(0,y.jsx)(`br`,{}),`2. Enter a project name and click `,(0,y.jsx)(`strong`,{children:`Continue`}),`. `,(0,y.jsx)(`br`,{}),`3. You can disable Google Analytics or leave it enabled. Click `,(0,y.jsx)(`strong`,{children:`Create Project`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Add a Web App`,children:[(0,y.jsxs)(`p`,{children:[`1. On your Firebase project dashboard, click the `,(0,y.jsx)(`strong`,{children:`</> Web`}),` icon (next to iOS and Android icons). `,(0,y.jsx)(`br`,{}),`2. Give your app a simple nickname (e.g., `,(0,y.jsx)(`span`,{className:`text-accent`,children:`MyApp`}),`). You don't need to check "Firebase Hosting". `,(0,y.jsx)(`br`,{}),`3. Click `,(0,y.jsx)(`strong`,{children:`Register App`}),`. `,(0,y.jsx)(`br`,{}),`4. Firebase will show you an SDK script block containing an object with keys like `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-2 py-0.5`,children:`apiKey`}),`, `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-2 py-0.5`,children:`authDomain`}),`, etc. Keep this tab open.`]}),(0,y.jsx)(`pre`,{className:`mt-4 p-4 md:p-5 overflow-x-auto text-[13px] leading-[1.8] font-mono styled-scrollbars glass-panel border border-[var(--panel-border)] rounded-2xl bg-background shadow-inner text-foreground/60`,children:(0,y.jsx)(`code`,{children:`const firebaseConfig = {
|
|
612
612
|
apiKey: "AIzaSy...",
|
|
613
613
|
authDomain: "myproject.firebaseapp.com",
|
|
614
614
|
projectId: "myproject",
|
package/dist/firebase-os.es.js
CHANGED
|
@@ -89754,10 +89754,10 @@ function jUn({ standalone: t }) {
|
|
|
89754
89754
|
transition: { delay: .1 },
|
|
89755
89755
|
className: "glass-panel border border-[var(--panel-border)] rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden bg-background flex flex-col",
|
|
89756
89756
|
children: [/* @__PURE__ */ V("div", {
|
|
89757
|
-
className: "
|
|
89757
|
+
className: "mb-8 pb-6 border-b border-[var(--panel-border)]/50 relative z-10",
|
|
89758
89758
|
children: [
|
|
89759
89759
|
/* @__PURE__ */ V("div", {
|
|
89760
|
-
className: "flex
|
|
89760
|
+
className: "flex items-start justify-between gap-4",
|
|
89761
89761
|
children: [/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("h2", {
|
|
89762
89762
|
className: "text-xl font-extrabold text-foreground tracking-tight",
|
|
89763
89763
|
children: "Firebase Configuration"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-os",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A complete Firebase-powered admin OS — one React component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/firebase-os.cjs.js",
|
|
@@ -78,4 +78,4 @@
|
|
|
78
78
|
"react-router-dom": ">=6",
|
|
79
79
|
"firebase": ">=10"
|
|
80
80
|
}
|
|
81
|
-
}
|
|
81
|
+
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -60,14 +60,20 @@ for (const file of cssFiles) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// ── 2.
|
|
63
|
+
// ── 2. Rewrite main.tsx — import library + theme CSS at the entry point ─────
|
|
64
64
|
const mainPath = path.join(srcDir, 'main.tsx');
|
|
65
65
|
if (fs.existsSync(mainPath)) {
|
|
66
66
|
const mainContent = fs.readFileSync(mainPath, 'utf8');
|
|
67
|
-
//
|
|
68
|
-
if (mainContent.includes("import './index.css'") || mainContent.includes('import "./index.css"')) {
|
|
67
|
+
// Rewrite if it has the default Vite CSS import OR if it doesn't have our library CSS
|
|
68
|
+
if (mainContent.includes("import './index.css'") || mainContent.includes('import "./index.css"') || !mainContent.includes('firebase-os')) {
|
|
69
69
|
const clean = `import { StrictMode } from 'react'
|
|
70
70
|
import { createRoot } from 'react-dom/client'
|
|
71
|
+
|
|
72
|
+
// Firebase OS — compiled library styles (Tailwind utilities, components, layouts)
|
|
73
|
+
import 'firebase-os/styles.css'
|
|
74
|
+
// Firebase OS — local theme overrides (CSS variables, data-theme, custom styles)
|
|
75
|
+
import './firebase-os/theme.css'
|
|
76
|
+
|
|
71
77
|
import App from './App.tsx'
|
|
72
78
|
|
|
73
79
|
createRoot(document.getElementById('root')!).render(
|
|
@@ -77,7 +83,7 @@ createRoot(document.getElementById('root')!).render(
|
|
|
77
83
|
)
|
|
78
84
|
`;
|
|
79
85
|
fs.writeFileSync(mainPath, clean);
|
|
80
|
-
console.log(' ✓ Patched main.tsx
|
|
86
|
+
console.log(' ✓ Patched main.tsx with Firebase OS styles');
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
|
|
@@ -120,9 +126,9 @@ if (fs.existsSync(sourceHomePath)) {
|
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
// ── 4. Write App.tsx with Hybrid Overrides Wired Up ───────────────────────
|
|
129
|
+
// Note: CSS imports are in main.tsx (entry point) for correct load ordering.
|
|
123
130
|
const appPath = path.join(srcDir, 'App.tsx');
|
|
124
131
|
const appContent = `import { FirebaseOS } from 'firebase-os';
|
|
125
|
-
import './firebase-os/theme.css';
|
|
126
132
|
|
|
127
133
|
// Local Hybrid Overrides
|
|
128
134
|
import { Home } from './firebase-os/Home';
|
package/src/App.tsx
CHANGED
|
@@ -160,8 +160,8 @@ function AuthenticatedApp() {
|
|
|
160
160
|
<Route path="/profile" element={<PrivateRoute><Profile /></PrivateRoute>} />
|
|
161
161
|
<Route path="/dashboard" element={<PrivateRoute><Dashboard /></PrivateRoute>} />
|
|
162
162
|
|
|
163
|
-
{/* Setup
|
|
164
|
-
<Route path="/setup" element={<
|
|
163
|
+
{/* Setup (accessible even after completion for reference) */}
|
|
164
|
+
<Route path="/setup" element={<Setup />} />
|
|
165
165
|
|
|
166
166
|
{/* Dynamic Content Routing */}
|
|
167
167
|
<Route path="*" element={<DynamicPage />} />
|
package/src/pages/Setup.tsx
CHANGED
|
@@ -233,8 +233,8 @@ export function Setup({ standalone }: SetupProps) {
|
|
|
233
233
|
className="glass-panel border border-[var(--panel-border)] rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden bg-background flex flex-col"
|
|
234
234
|
>
|
|
235
235
|
{/* Panel header with support buttons */}
|
|
236
|
-
<div className="
|
|
237
|
-
<div className="flex
|
|
236
|
+
<div className="mb-8 pb-6 border-b border-[var(--panel-border)]/50 relative z-10">
|
|
237
|
+
<div className="flex items-start justify-between gap-4">
|
|
238
238
|
<div>
|
|
239
239
|
<h2 className="text-xl font-extrabold text-foreground tracking-tight">Firebase Configuration</h2>
|
|
240
240
|
<p className="text-[14px] font-medium text-foreground/50 mt-2 leading-relaxed">
|