firebase-os 1.1.3 → 1.1.4
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 +3 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +10 -2
package/dist/firebase-os.cjs.js
CHANGED
|
@@ -615,7 +615,7 @@ VITE_ADMIN_EMAILS=your@email.com,other@email.com`;function EHn({code:e,label:t})
|
|
|
615
615
|
storageBucket: "myproject.firebasestorage.app",
|
|
616
616
|
messagingSenderId: "123456789012",
|
|
617
617
|
appId: "1:123456789012:web:abcdef123456"
|
|
618
|
-
};`})})]}),(0,y.jsxs)(Y9,{title:`Configure your .env file`,children:[(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`code`,{className:`text-accent font-bold text-[13px]`,children:`.env`}),` file in your source code root. Map the keys from your Firebase Web SDK to the `,(0,y.jsx)(`code`,{className:`bg-foreground/5 rounded px-2 py-0.5 font-mono text-[11px]`,children:`VITE_ FIREBASE_`}),` variables.`]}),(0,y.jsxs)(`p`,{className:`text-[13px] bg-accent/10 border border-accent/20 p-3 rounded-xl mt-2 text-foreground/80`,children:[(0,y.jsx)(`strong`,{children:`Important:`}),` Provide your own emails in `,(0,y.jsx)(`code`,{className:`bg-background/80 rounded px-1.5 py-0.5 font-mono text-[11px]`,children:`VITE_ADMIN_EMAILS`}),` separated by commas. These users will automatically get full admin privileges upon their first registration. No quotes or spaces!`]}),(0,y.jsx)(DHn,{code:THn})]}),(0,y.jsx)(Y9,{title:`Enable Authentication`,children:(0,y.jsxs)(`p`,{children:[`1. In Firebase console Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Security`}),` → `,(0,y.jsx)(`strong`,{children:`Authentication`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get Started`}),`. `,(0,y.jsx)(`br`,{}),`2. Click the `,(0,y.jsx)(`strong`,{children:`Sign-in method`}),` tab. `,(0,y.jsx)(`br`,{}),`3. Enable `,(0,y.jsx)(`strong`,{children:`Email/Password`}),` (no need to enable email links). `,(0,y.jsx)(`br`,{}),`4. Enable `,(0,y.jsx)(`strong`,{children:`Google`}),`. `,(0,y.jsx)(`br`,{}),`5. Enable `,(0,y.jsx)(`strong`,{children:`Anonymous`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Create Firestore Database`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Firestore`}),`. Click `,(0,y.jsx)(`strong`,{children:`Create database`}),`. `,(0,y.jsx)(`br`,{}),`2. Keep the default location and start in `,(0,y.jsx)(`strong`,{children:`Production mode`}),`. `,(0,y.jsx)(`br`,{}),`3. Go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste the rules below, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:CHn,label:`Copy Firestore Rules`})]}),(0,y.jsxs)(Y9,{title:`Configure Storage (Optional but Recommended)`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Storage`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get started`}),`. Start in production mode. `,(0,y.jsx)(`br`,{}),`2. Once created, copy the bucket URL (e.g. `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`your-project.firebasestorage.app`}),`) and paste it into `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`VITE_FIREBASE_STORAGE_BUCKET`}),` in your `,(0,y.jsx)(`code`,{className:`text-[13px] font-bold`,children:`.env`}),`. `,(0,y.jsx)(`br`,{}),`3. In Firebase Storage, go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste tracking rules, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:wHn,label:`Copy Storage Rules`}),(0,y.jsx)(`p`,{className:`text-[12px] mt-4 opacity-60 font-medium border-l-2 border-foreground/20 pl-3`,children:`Note: Storage rules require the Blaze pay-as-you-go plan, but there are large free tiers so you won't be charged for development usage.`})]})]})]})})]})}function kHn(){let{user:e}=B(),t=(e?.displayName||e?.email?.split(`@`)[0]||`there`).split(` `)[0],n=t.charAt(0).toUpperCase()+t.slice(1);return(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col`,children:[(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-8`,children:[(0,y.jsxs)(`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:[`Welcome back, `,n,`.`]}),(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`}),`/dashboard`]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 flex-1 min-h-[500px]`,children:[(0,y.jsx)(`div`,{className:`flex justify-start`,children:(0,y.jsx)(p9,{})}),(0,y.jsxs)(`div`,{className:`w-full flex-1 glass-panel rounded-3xl p-8 md:p-12 flex items-center justify-center relative overflow-hidden border border-[var(--panel-border)] shadow-2xl bg-[var(--panel-bg)]`,children:[(0,y.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 bg-accent/10 blur-[100px] rounded-full pointer-events-none`}),(0,y.jsx)(K,{mode:`wait`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3},className:`text-center z-10`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-3xl bg-accent/10 border border-accent/20 flex items-center justify-center text-accent mx-auto mb-6 shadow-inner`,children:(0,y.jsx)(Me,{className:`w-6 h-6`})}),(0,y.jsx)(`h2`,{className:`text-2xl font-extrabold text-foreground mb-2`,children:`No data added here yet`}),(0,y.jsx)(`p`,{className:`text-foreground/40 font-medium`,children:`Keep moving forward, your data will appear here.`})]})})]})]})]})}var X9=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center min-h-[60vh] z-10 animate-in fade-in duration-500`,children:[(0,y.jsx)(`div`,{className:`w-12 h-12 rounded-xl glass-panel border border-[var(--panel-border)] flex items-center justify-center mb-6 shadow-xl`,children:(0,y.jsx)(Me,{className:`w-6 h-6 text-accent animate-pulse`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 glass-panel px-5 py-2.5 rounded-full border border-[var(--panel-border)]`,children:[(0,y.jsx)(`div`,{className:`w-4 h-4 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold tracking-widest uppercase text-foreground/70`,children:`Connecting`})]})]});function Z9({children:e}){let{user:t,loading:n,userInactive:r,signOut:i,roleResolved:a}=B(),o=(0,b.useLocation)();return n||!a?(0,y.jsx)(X9,{}):t?r?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>i(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(o.pathname)}`})}function Q9({children:e}){let{user:t,loading:n,roleResolved:r}=B(),[i]=(0,b.useSearchParams)();return n||!r?(0,y.jsx)(X9,{}):t&&t.emailVerified?(0,y.jsx)(b.Navigate,{to:i.get(`from`)||`/dashboard`,replace:!0}):(0,y.jsx)(y.Fragment,{children:e})}function AHn({children:e}){let{user:t,loading:n,roleResolved:r}=B();return n||!r?(0,y.jsx)(X9,{}):t?t.emailVerified?(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/`})}function $9({children:e}){let{user:t,userRole:n,loading:r,userInactive:i,signOut:a,roleResolved:o}=B(),s=(0,b.useLocation)();return r||!o?(0,y.jsx)(X9,{}):t?i?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>a(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?n===`admin`?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(s.pathname)}`})}function jHn(){return(0,y.jsxs)(`div`,{className:`fixed top-0 left-0 w-full h-full pointer-events-none -z-0 overflow-hidden`,children:[(0,y.jsx)(q.div,{animate:{scale:[1,1.1,1],opacity:[.6,1,.6]},transition:{duration:12,repeat:1/0,ease:`easeInOut`},className:`absolute -top-[30%] md:-top-[400px] -right-[10%] md:-right-[200px] w-[500px] md:w-[800px] h-[500px] md:h-[800px] rounded-full bg-decorator-1 blur-[80px] md:blur-[120px]`}),(0,y.jsx)(q.div,{animate:{scale:[1,1.2,1],opacity:[.5,.9,.5]},transition:{duration:18,repeat:1/0,ease:`easeInOut`,delay:2},className:`absolute -bottom-[20%] md:-bottom-[300px] -left-[10%] md:-left-[100px] w-[400px] md:w-[600px] h-[400px] md:h-[600px] rounded-full bg-decorator-2 blur-[60px] md:blur-[100px]`})]})}function MHn(){return(0,y.jsx)(z,{children:(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{}),(0,y.jsxs)(b.Routes,{children:[(0,y.jsx)(b.Route,{path:`/`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Gse,{})})}),(0,y.jsx)(b.Route,{path:`/register`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Kse,{})})}),(0,y.jsx)(b.Route,{path:`/login`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(qse,{})})}),(0,y.jsx)(b.Route,{path:`/reset-password`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(bBn,{})})}),(0,y.jsx)(b.Route,{path:`/verify`,element:(0,y.jsx)(AHn,{children:(0,y.jsx)(Jse,{})})}),(0,y.jsx)(b.Route,{path:`/templates`,element:(0,y.jsx)(OBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/inline_form`,element:(0,y.jsx)(kBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/popup_form`,element:(0,y.jsx)(ABn,{})}),(0,y.jsx)(b.Route,{path:`/templates/confirmation`,element:(0,y.jsx)(jBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/board`,element:(0,y.jsx)(GBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/table`,element:(0,y.jsx)(XVn,{})}),(0,y.jsx)(b.Route,{path:`/templates/calendar`,element:(0,y.jsx)(QVn,{})}),(0,y.jsx)(b.Route,{path:`/users`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/users/:id`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/submissions`,element:(0,y.jsx)($9,{children:(0,y.jsx)(TBn,{})})}),(0,y.jsx)(b.Route,{path:`/requests`,element:(0,y.jsx)($9,{children:(0,y.jsx)(EBn,{})})}),(0,y.jsx)(b.Route,{path:`/drive/*`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(DBn,{})})}),(0,y.jsx)(b.Route,{path:`/theme`,element:(0,y.jsx)($9,{children:(0,y.jsx)(rHn,{})})}),(0,y.jsx)(b.Route,{path:`/pages/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(uHn,{})})}),(0,y.jsx)(b.Route,{path:`/forms/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(dHn,{})})}),(0,y.jsx)(b.Route,{path:`/settings`,element:(0,y.jsx)($9,{children:(0,y.jsx)(wBn,{})})}),(0,y.jsx)(b.Route,{path:`/profile`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(yBn,{})})}),(0,y.jsx)(b.Route,{path:`/dashboard`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(kHn,{})})}),(0,y.jsx)(b.Route,{path:`/setup`,element:(0,y.jsx)(OHn,{})}),(0,y.jsx)(b.Route,{path:`*`,element:(0,y.jsx)(gHn,{})})]}),(0,y.jsx)(jHn,{})]})})}function NHn(){return(0,y.jsx)(b.BrowserRouter,{children:(0,y.jsx)(PHn,{})})}function PHn(){let e=R();return e.firebaseConfig&&e.firebaseConfig.apiKey&&e.firebaseConfig.apiKey.trim()!==``&&e.firebaseConfig.projectId&&e.firebaseConfig.projectId.trim()!==``||SHn()?(0,y.jsx)(MHn,{}):(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{standalone:!0}),(0,y.jsx)(OHn,{standalone:!0}),(0,y.jsx)(jHn,{})]})}function FHn(e){return e.firebaseConfig&&E(e.firebaseConfig),(0,y.jsx)(L,{config:{firebaseConfig:e.firebaseConfig,adminEmails:e.adminEmails,basename:e.basename,onAuthChange:e.onAuthChange},children:(0,y.jsx)(F,{scopeSelector:`.firebase-os`,children:(0,y.jsxs)(`div`,{className:`firebase-os`,style:{position:`fixed`,inset:0,width:`100vw`,height:`100vh`,zIndex:9999,overflowY:`auto`,overflowX:`hidden`,textAlign:`left`,margin:0,padding:0},children:[(0,y.jsx)(`style`,{children:`
|
|
618
|
+
};`})})]}),(0,y.jsxs)(Y9,{title:`Configure your .env file`,children:[(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`code`,{className:`text-accent font-bold text-[13px]`,children:`.env`}),` file in your source code root. Map the keys from your Firebase Web SDK to the `,(0,y.jsx)(`code`,{className:`bg-foreground/5 rounded px-2 py-0.5 font-mono text-[11px]`,children:`VITE_ FIREBASE_`}),` variables.`]}),(0,y.jsxs)(`p`,{className:`text-[13px] bg-accent/10 border border-accent/20 p-3 rounded-xl mt-2 text-foreground/80`,children:[(0,y.jsx)(`strong`,{children:`Important:`}),` Provide your own emails in `,(0,y.jsx)(`code`,{className:`bg-background/80 rounded px-1.5 py-0.5 font-mono text-[11px]`,children:`VITE_ADMIN_EMAILS`}),` separated by commas. These users will automatically get full admin privileges upon their first registration. No quotes or spaces!`]}),(0,y.jsx)(DHn,{code:THn})]}),(0,y.jsx)(Y9,{title:`Enable Authentication`,children:(0,y.jsxs)(`p`,{children:[`1. In Firebase console Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Security`}),` → `,(0,y.jsx)(`strong`,{children:`Authentication`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get Started`}),`. `,(0,y.jsx)(`br`,{}),`2. Click the `,(0,y.jsx)(`strong`,{children:`Sign-in method`}),` tab. `,(0,y.jsx)(`br`,{}),`3. Enable `,(0,y.jsx)(`strong`,{children:`Email/Password`}),` (no need to enable email links). `,(0,y.jsx)(`br`,{}),`4. Enable `,(0,y.jsx)(`strong`,{children:`Google`}),`. `,(0,y.jsx)(`br`,{}),`5. Enable `,(0,y.jsx)(`strong`,{children:`Anonymous`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Create Firestore Database`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Firestore`}),`. Click `,(0,y.jsx)(`strong`,{children:`Create database`}),`. `,(0,y.jsx)(`br`,{}),`2. Keep the default location and start in `,(0,y.jsx)(`strong`,{children:`Production mode`}),`. `,(0,y.jsx)(`br`,{}),`3. Go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste the rules below, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:CHn,label:`Copy Firestore Rules`})]}),(0,y.jsxs)(Y9,{title:`Configure Storage (Optional but Recommended)`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Storage`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get started`}),`. Start in production mode. `,(0,y.jsx)(`br`,{}),`2. Once created, copy the bucket URL (e.g. `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`your-project.firebasestorage.app`}),`) and paste it into `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`VITE_FIREBASE_STORAGE_BUCKET`}),` in your `,(0,y.jsx)(`code`,{className:`text-[13px] font-bold`,children:`.env`}),`. `,(0,y.jsx)(`br`,{}),`3. In Firebase Storage, go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste tracking rules, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:wHn,label:`Copy Storage Rules`}),(0,y.jsx)(`p`,{className:`text-[12px] mt-4 opacity-60 font-medium border-l-2 border-foreground/20 pl-3`,children:`Note: Storage rules require the Blaze pay-as-you-go plan, but there are large free tiers so you won't be charged for development usage.`})]})]})]})})]})}function kHn(){let{user:e}=B(),t=(e?.displayName||e?.email?.split(`@`)[0]||`there`).split(` `)[0],n=t.charAt(0).toUpperCase()+t.slice(1);return(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col`,children:[(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-8`,children:[(0,y.jsxs)(`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:[`Welcome back, `,n,`.`]}),(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`}),`/dashboard`]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 flex-1 min-h-[500px]`,children:[(0,y.jsx)(`div`,{className:`flex justify-start`,children:(0,y.jsx)(p9,{})}),(0,y.jsxs)(`div`,{className:`w-full flex-1 glass-panel rounded-3xl p-8 md:p-12 flex items-center justify-center relative overflow-hidden border border-[var(--panel-border)] shadow-2xl bg-[var(--panel-bg)]`,children:[(0,y.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 bg-accent/10 blur-[100px] rounded-full pointer-events-none`}),(0,y.jsx)(K,{mode:`wait`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3},className:`text-center z-10`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-3xl bg-accent/10 border border-accent/20 flex items-center justify-center text-accent mx-auto mb-6 shadow-inner`,children:(0,y.jsx)(Me,{className:`w-6 h-6`})}),(0,y.jsx)(`h2`,{className:`text-2xl font-extrabold text-foreground mb-2`,children:`No data added here yet`}),(0,y.jsx)(`p`,{className:`text-foreground/40 font-medium`,children:`Keep moving forward, your data will appear here.`})]})})]})]})]})}var X9=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center min-h-[60vh] z-10 animate-in fade-in duration-500`,children:[(0,y.jsx)(`div`,{className:`w-12 h-12 rounded-xl glass-panel border border-[var(--panel-border)] flex items-center justify-center mb-6 shadow-xl`,children:(0,y.jsx)(Me,{className:`w-6 h-6 text-accent animate-pulse`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 glass-panel px-5 py-2.5 rounded-full border border-[var(--panel-border)]`,children:[(0,y.jsx)(`div`,{className:`w-4 h-4 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold tracking-widest uppercase text-foreground/70`,children:`Connecting`})]})]});function Z9({children:e}){let{user:t,loading:n,userInactive:r,signOut:i,roleResolved:a}=B(),o=(0,b.useLocation)();return n||!a?(0,y.jsx)(X9,{}):t?r?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>i(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(o.pathname)}`})}function Q9({children:e}){let{user:t,loading:n,roleResolved:r}=B(),[i]=(0,b.useSearchParams)();return n||!r?(0,y.jsx)(X9,{}):t&&t.emailVerified?(0,y.jsx)(b.Navigate,{to:i.get(`from`)||`/dashboard`,replace:!0}):(0,y.jsx)(y.Fragment,{children:e})}function AHn({children:e}){let{user:t,loading:n,roleResolved:r}=B();return n||!r?(0,y.jsx)(X9,{}):t?t.emailVerified?(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/`})}function $9({children:e}){let{user:t,userRole:n,loading:r,userInactive:i,signOut:a,roleResolved:o}=B(),s=(0,b.useLocation)();return r||!o?(0,y.jsx)(X9,{}):t?i?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>a(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?n===`admin`?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(s.pathname)}`})}function jHn(){return(0,y.jsxs)(`div`,{className:`fixed top-0 left-0 w-full h-full pointer-events-none -z-0 overflow-hidden`,children:[(0,y.jsx)(q.div,{animate:{scale:[1,1.1,1],opacity:[.6,1,.6]},transition:{duration:12,repeat:1/0,ease:`easeInOut`},className:`absolute -top-[30%] md:-top-[400px] -right-[10%] md:-right-[200px] w-[500px] md:w-[800px] h-[500px] md:h-[800px] rounded-full bg-decorator-1 blur-[80px] md:blur-[120px]`}),(0,y.jsx)(q.div,{animate:{scale:[1,1.2,1],opacity:[.5,.9,.5]},transition:{duration:18,repeat:1/0,ease:`easeInOut`,delay:2},className:`absolute -bottom-[20%] md:-bottom-[300px] -left-[10%] md:-left-[100px] w-[400px] md:w-[600px] h-[400px] md:h-[600px] rounded-full bg-decorator-2 blur-[60px] md:blur-[100px]`})]})}function MHn(){return(0,y.jsx)(z,{children:(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{}),(0,y.jsxs)(b.Routes,{children:[(0,y.jsx)(b.Route,{path:`/`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Gse,{})})}),(0,y.jsx)(b.Route,{path:`/register`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Kse,{})})}),(0,y.jsx)(b.Route,{path:`/login`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(qse,{})})}),(0,y.jsx)(b.Route,{path:`/reset-password`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(bBn,{})})}),(0,y.jsx)(b.Route,{path:`/verify`,element:(0,y.jsx)(AHn,{children:(0,y.jsx)(Jse,{})})}),(0,y.jsx)(b.Route,{path:`/templates`,element:(0,y.jsx)(OBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/inline_form`,element:(0,y.jsx)(kBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/popup_form`,element:(0,y.jsx)(ABn,{})}),(0,y.jsx)(b.Route,{path:`/templates/confirmation`,element:(0,y.jsx)(jBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/board`,element:(0,y.jsx)(GBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/table`,element:(0,y.jsx)(XVn,{})}),(0,y.jsx)(b.Route,{path:`/templates/calendar`,element:(0,y.jsx)(QVn,{})}),(0,y.jsx)(b.Route,{path:`/users`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/users/:id`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/submissions`,element:(0,y.jsx)($9,{children:(0,y.jsx)(TBn,{})})}),(0,y.jsx)(b.Route,{path:`/requests`,element:(0,y.jsx)($9,{children:(0,y.jsx)(EBn,{})})}),(0,y.jsx)(b.Route,{path:`/drive/*`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(DBn,{})})}),(0,y.jsx)(b.Route,{path:`/theme`,element:(0,y.jsx)($9,{children:(0,y.jsx)(rHn,{})})}),(0,y.jsx)(b.Route,{path:`/pages/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(uHn,{})})}),(0,y.jsx)(b.Route,{path:`/forms/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(dHn,{})})}),(0,y.jsx)(b.Route,{path:`/settings`,element:(0,y.jsx)($9,{children:(0,y.jsx)(wBn,{})})}),(0,y.jsx)(b.Route,{path:`/profile`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(yBn,{})})}),(0,y.jsx)(b.Route,{path:`/dashboard`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(kHn,{})})}),(0,y.jsx)(b.Route,{path:`/setup`,element:(0,y.jsx)(OHn,{})}),(0,y.jsx)(b.Route,{path:`*`,element:(0,y.jsx)(gHn,{})})]}),(0,y.jsx)(jHn,{})]})})}function NHn(){return(0,y.jsx)(b.BrowserRouter,{children:(0,y.jsx)(PHn,{})})}function PHn(){let e=R();return e.firebaseConfig&&e.firebaseConfig.apiKey&&e.firebaseConfig.apiKey.trim()!==``&&e.firebaseConfig.projectId&&e.firebaseConfig.projectId.trim()!==``||SHn()?(0,y.jsx)(MHn,{}):(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{standalone:!0}),(0,y.jsx)(OHn,{standalone:!0}),(0,y.jsx)(jHn,{})]})}function FHn(e){return e.firebaseConfig&&E(e.firebaseConfig),(0,y.jsx)(L,{config:{firebaseConfig:e.firebaseConfig,adminEmails:e.adminEmails,basename:e.basename,onAuthChange:e.onAuthChange},children:(0,y.jsx)(F,{scopeSelector:`.firebase-os`,children:(0,y.jsxs)(`div`,{className:`firebase-os`,style:{position:`fixed`,inset:0,width:`100vw`,height:`100vh`,zIndex:9999,overflowY:`auto`,overflowX:`hidden`,textAlign:`left`,margin:0,padding:0,background:`var(--bg-gradient)`,color:`var(--fg-color)`},children:[(0,y.jsx)(`style`,{children:`
|
|
619
619
|
/* Defensive Typography Reset: Specificity 0,0,0 */
|
|
620
620
|
/* This ensures we provide base styles without overriding ANY utility classes */
|
|
621
621
|
:where(.firebase-os) :where(h1, h2, h3, h4, h5, h6, p, span, li, label, a, td, th) {
|
package/dist/firebase-os.es.js
CHANGED
|
@@ -90413,7 +90413,9 @@ function RUn(e) {
|
|
|
90413
90413
|
overflowX: "hidden",
|
|
90414
90414
|
textAlign: "left",
|
|
90415
90415
|
margin: 0,
|
|
90416
|
-
padding: 0
|
|
90416
|
+
padding: 0,
|
|
90417
|
+
background: "var(--bg-gradient)",
|
|
90418
|
+
color: "var(--fg-color)"
|
|
90417
90419
|
},
|
|
90418
90420
|
children: [/* @__PURE__ */ B("style", { children: "\n /* Defensive Typography Reset: Specificity 0,0,0 */\n /* This ensures we provide base styles without overriding ANY utility classes */\n :where(.firebase-os) :where(h1, h2, h3, h4, h5, h6, p, span, li, label, a, td, th) {\n color: var(--fg-color);\n font-family: var(--font-family, 'Inter', system-ui, sans-serif);\n }\n :where(.firebase-os) :where(h1, h2, h3, h4, h5, h6, p) {\n margin: 0;\n }\n :where(.firebase-os) :where(code, pre) {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace !important;\n background: transparent;\n border: none;\n }\n " }), /* @__PURE__ */ B(IUn, {})]
|
|
90419
90421
|
})
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -81,10 +81,18 @@ createRoot(document.getElementById('root')!).render(
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// ── 3.
|
|
84
|
+
// ── 3. Reveal the CSS by copying it to the consumer's src directory ──────────
|
|
85
|
+
const sourceCssPath = path.join(__dirname, '..', 'dist', 'firebase-os.css');
|
|
86
|
+
const targetCssPath = path.join(srcDir, 'firebase-os.css');
|
|
87
|
+
if (fs.existsSync(sourceCssPath)) {
|
|
88
|
+
fs.copyFileSync(sourceCssPath, targetCssPath);
|
|
89
|
+
console.log(' ✓ Copied firebase-os.css to your src directory');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ── 4. Write App.tsx with FirebaseOS already wired up ───────────────────────
|
|
85
93
|
const appPath = path.join(srcDir, 'App.tsx');
|
|
86
94
|
const appContent = `import { FirebaseOS } from 'firebase-os';
|
|
87
|
-
import 'firebase-os
|
|
95
|
+
import './firebase-os.css';
|
|
88
96
|
|
|
89
97
|
// Vite injects these from your .env file at dev/build time.
|
|
90
98
|
// The library can't read them directly since it's pre-built,
|