your-ai-workflow-firebase-os 1.2.35 → 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.
package/README.md CHANGED
@@ -61,7 +61,13 @@ npm pack # in this repo
61
61
  npm install /path/to/your-ai-workflow-firebase-os-1.0.0.tgz # in your app
62
62
  ```
63
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`.
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.
65
71
 
66
72
  ---
67
73
 
@@ -45589,75 +45589,118 @@ var NW = t.forwardRef(({ className: e, variant: t = "primary", isLoading: n, chi
45589
45589
  NW.displayName = "Button";
45590
45590
  //#endregion
45591
45591
  //#region src/components/CustomSelect.tsx
45592
- function PW({ value: e, options: t, onChange: n, label: r, disabled: i, variant: a = "default" }) {
45593
- let [o, s] = v(!1), c = _(null);
45592
+ var PW = () => typeof document > "u" ? null : document.querySelector(".firebase-os") || document.body;
45593
+ function FW({ value: e, options: t, onChange: n, label: r, disabled: i, variant: a = "default", compact: o = !1, direction: s = "up", portal: c = !1, ariaLabel: l, className: u = "" }) {
45594
+ let [d, p] = v(!1), [m, g] = v(s === "down" ? "down" : "up"), [y, b] = v(null), x = _(null), S = _(null), C = _(null);
45594
45595
  f(() => {
45595
45596
  function e(e) {
45596
- c.current && !c.current.contains(e.target) && s(!1);
45597
+ let t = e.target;
45598
+ x.current?.contains(t) || C.current?.contains(t) || p(!1);
45597
45599
  }
45598
45600
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
45599
- }, []);
45600
- let l = t.find((t) => t.value === e) || t[0];
45601
+ }, []), h(() => {
45602
+ if (!d) return;
45603
+ let e = () => {
45604
+ let e = S.current;
45605
+ if (!e) return;
45606
+ let t = e.getBoundingClientRect();
45607
+ if (b({
45608
+ top: t.top,
45609
+ left: t.left,
45610
+ width: t.width,
45611
+ height: t.height
45612
+ }), s === "auto") {
45613
+ let e = (typeof window < "u" ? window.innerHeight : 0) - t.bottom;
45614
+ g(e < 260 && t.top > e ? "up" : "down");
45615
+ } else g(s);
45616
+ };
45617
+ return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
45618
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
45619
+ };
45620
+ }, [d, s]);
45621
+ let w = t.find((t) => t.value === e) || t[0], T = t.length > 1 && !i, ee = /* @__PURE__ */ D(rU.div, {
45622
+ ref: C,
45623
+ role: "listbox",
45624
+ "aria-label": l || r,
45625
+ initial: {
45626
+ opacity: 0,
45627
+ y: m === "up" ? 5 : -5,
45628
+ scale: .98
45629
+ },
45630
+ animate: {
45631
+ opacity: 1,
45632
+ y: 0,
45633
+ scale: 1
45634
+ },
45635
+ exit: {
45636
+ opacity: 0,
45637
+ y: m === "up" ? 5 : -5,
45638
+ scale: .98
45639
+ },
45640
+ transition: { duration: .15 },
45641
+ className: `z-[99999] glass-popover overflow-hidden ${c ? "fixed" : `absolute left-0 w-full ${m === "up" ? "bottom-[calc(100%+8px)]" : "top-[calc(100%+8px)]"}`}`,
45642
+ style: {
45643
+ borderRadius: "var(--input-radius, 0.75rem)",
45644
+ ...c && y ? {
45645
+ left: y.left,
45646
+ width: Math.max(y.width, o ? 180 : 0),
45647
+ ...m === "up" ? { bottom: (typeof window < "u" ? window.innerHeight : 0) - y.top + 8 } : { top: y.top + y.height + 8 }
45648
+ } : {}
45649
+ },
45650
+ children: /* @__PURE__ */ D("div", {
45651
+ className: "max-h-60 overflow-y-auto no-scrollbar p-1",
45652
+ children: t.map((t) => /* @__PURE__ */ O("div", {
45653
+ role: "option",
45654
+ "aria-selected": e === t.value,
45655
+ onClick: () => {
45656
+ n(t.value), p(!1);
45657
+ },
45658
+ className: `flex items-center justify-between gap-3 px-3 py-2.5 cursor-pointer transition-colors text-[13px] font-medium ${e === t.value ? "bg-accent/10 text-accent font-bold" : "text-foreground/80 hover:bg-foreground/5 hover:text-foreground"}`,
45659
+ style: { borderRadius: "calc(var(--input-radius, 0.75rem) - 0.25rem)" },
45660
+ children: [/* @__PURE__ */ D("span", {
45661
+ className: "truncate",
45662
+ children: t.label
45663
+ }), e === t.value && /* @__PURE__ */ D(Qo, { className: "w-3.5 h-3.5 shrink-0 text-accent" })]
45664
+ }, t.value))
45665
+ })
45666
+ }), te = c ? PW() : null, ne = /* @__PURE__ */ D(sV, { children: d && ee });
45601
45667
  return /* @__PURE__ */ O("div", {
45602
- className: `flex flex-col w-full relative ${i ? "opacity-50 pointer-events-none" : ""}`,
45603
- ref: c,
45668
+ className: `flex flex-col relative ${o ? "w-auto" : "w-full"} ${i ? "opacity-50 pointer-events-none" : ""} ${u}`,
45669
+ ref: x,
45604
45670
  children: [
45605
45671
  r && /* @__PURE__ */ D("label", {
45606
45672
  className: "text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1",
45607
45673
  children: r
45608
45674
  }),
45609
45675
  /* @__PURE__ */ O("div", {
45676
+ ref: S,
45677
+ role: "button",
45678
+ tabIndex: i ? -1 : 0,
45679
+ "aria-haspopup": "listbox",
45680
+ "aria-expanded": d,
45681
+ "aria-label": l || r,
45682
+ "aria-disabled": i || void 0,
45610
45683
  onClick: () => {
45611
- t.length > 1 && s(!o);
45684
+ T && p(!d);
45685
+ },
45686
+ onKeyDown: (e) => {
45687
+ T && ((e.key === "Enter" || e.key === " ") && (e.preventDefault(), p((e) => !e)), e.key === "Escape" && p(!1));
45612
45688
  },
45613
- className: `w-full text-[15px] text-foreground px-4 transition-all duration-300 flex items-center justify-between ${t.length <= 1 ? "cursor-default opacity-80" : "cursor-pointer"} ${a === "ghost" ? "h-10 hover:bg-foreground/5 bg-transparent" : `h-12 bg-foreground/[0.02] border transition-all duration-300 hover:border-foreground/30 glass-panel shadow-sm ${o ? "border-accent glow-focus" : "border-[var(--panel-border)]/50"}`}`,
45689
+ className: `text-foreground transition-all duration-300 flex items-center justify-between outline-none ${o ? "h-9 px-3 gap-2 text-[12.5px] font-semibold" : "w-full h-12 px-4 text-[15px]"} ${T ? "cursor-pointer" : "cursor-default"} ${a === "ghost" ? "hover:bg-foreground/5 bg-transparent" : `border glass-panel ${o ? "" : "shadow-sm"} ${d ? "border-accent glow-focus" : "border-[var(--panel-border)]"}`}`,
45614
45690
  style: { borderRadius: "var(--input-radius, 0.75rem)" },
45615
45691
  children: [/* @__PURE__ */ D("span", {
45616
45692
  className: "truncate",
45617
- children: l?.label
45618
- }), t.length > 1 && /* @__PURE__ */ D(as, { className: `w-4 h-4 text-foreground/50 transition-transform duration-300 ${o ? "rotate-180" : ""}` })]
45693
+ children: w?.label
45694
+ }), t.length > 1 && /* @__PURE__ */ D(as, { className: `w-4 h-4 text-foreground/50 shrink-0 transition-transform duration-300 ${d ? "rotate-180" : ""}` })]
45619
45695
  }),
45620
- /* @__PURE__ */ D(sV, { children: o && /* @__PURE__ */ D(rU.div, {
45621
- initial: {
45622
- opacity: 0,
45623
- y: 5,
45624
- scale: .98
45625
- },
45626
- animate: {
45627
- opacity: 1,
45628
- y: 0,
45629
- scale: 1
45630
- },
45631
- exit: {
45632
- opacity: 0,
45633
- y: 5,
45634
- scale: .98
45635
- },
45636
- transition: { duration: .15 },
45637
- className: "absolute z-[99999] bottom-[calc(100%+8px)] left-0 w-full border border-[var(--panel-border)] bg-background/95 shadow-[0_-15px_40px_rgba(0,0,0,0.5)] overflow-hidden ring-1 ring-[var(--panel-border)]/50 backdrop-blur-xl",
45638
- style: { borderRadius: "var(--input-radius, 0.75rem)" },
45639
- children: /* @__PURE__ */ D("div", {
45640
- className: "max-h-60 overflow-y-auto no-scrollbar p-1",
45641
- children: t.map((t) => /* @__PURE__ */ O("div", {
45642
- onClick: () => {
45643
- n(t.value), s(!1);
45644
- },
45645
- className: `flex items-center justify-between px-3 py-2.5 cursor-pointer transition-colors text-[13px] font-medium ${e === t.value ? "bg-accent/10 text-accent font-bold" : "text-foreground/80 hover:bg-foreground/5 hover:text-foreground"}`,
45646
- style: { borderRadius: "calc(var(--input-radius, 0.75rem) - 0.25rem)" },
45647
- children: [/* @__PURE__ */ D("span", {
45648
- className: "truncate",
45649
- children: t.label
45650
- }), e === t.value && /* @__PURE__ */ D(Qo, { className: "w-3.5 h-3.5 shrink-0 text-accent" })]
45651
- }, t.value))
45652
- })
45653
- }) })
45696
+ c && te ? ue(ne, te) : ne
45654
45697
  ]
45655
45698
  });
45656
45699
  }
45657
45700
  //#endregion
45658
45701
  //#region src/components/ContactPopup.tsx
45659
- var FW = t.lazy(() => import("./PhoneInputField-kA1QmUiI.js").then((e) => e.n));
45660
- function IW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
45702
+ var IW = t.lazy(() => import("./PhoneInputField-ChHip6t8.js").then((e) => e.n));
45703
+ function LW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
45661
45704
  let [i, o] = v({}), [s, c] = v("idle"), [l, u] = v(""), d = _(null), [p, m] = v(n || null), [h, g] = v(!n), C = le(), w = Pe(), T = (e) => {
45662
45705
  let t = (typeof window < "u" ? window.__FBOS_FORMS__ : null) || {};
45663
45706
  return w?.defaultConfigs?.[e] || w?.defaultConfigs?.[`${e}Form`] || t[e] || (e === "contact" ? _e : e === "support" ? ye : null);
@@ -45854,7 +45897,7 @@ function IW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
45854
45897
  return n && !r ? 1 : !n && r ? -1 : 0;
45855
45898
  }).map((e, t) => e.type === "tel" ? /* @__PURE__ */ D(a, {
45856
45899
  fallback: /* @__PURE__ */ D("div", { className: "h-12 w-full glass-panel animate-pulse rounded-xl" }),
45857
- children: /* @__PURE__ */ D(FW, {
45900
+ children: /* @__PURE__ */ D(IW, {
45858
45901
  field: e,
45859
45902
  value: i[e.name] || "",
45860
45903
  onChange: (t) => o({
@@ -45880,7 +45923,7 @@ function IW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
45880
45923
  })]
45881
45924
  }, t) : e.type === "select" ? /* @__PURE__ */ D("div", {
45882
45925
  className: "w-full",
45883
- children: /* @__PURE__ */ D(PW, {
45926
+ children: /* @__PURE__ */ D(FW, {
45884
45927
  label: e.label,
45885
45928
  value: i[e.name] || "",
45886
45929
  options: [{
@@ -46036,4 +46079,4 @@ function IW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
46036
46079
  }), document.body);
46037
46080
  }
46038
46081
  //#endregion
46039
- export { Mf as $, cx as A, Ut as At, n_ as B, ye as Bt, Zw as C, Yr as Ct, pC as D, gn as Dt, KC as E, bn as Et, X_ as F, Se as Ft, Dg as G, Qg as H, _e as Ht, Y_ as I, Ce as It, hg as J, Eg as K, N as L, Ee as Lt, gy as M, ze as Mt, Bv as N, Ne as Nt, TS as O, qt as Ot, uv as P, Pe as Pt, Vf as Q, x_ as R, we as Rt, _T as S, $a as St, zw as T, wn as Tt, Zg as U, ge as Ut, $g as V, ve as Vt, Xg as W, j as Wt, gh as X, fg as Y, Bm as Z, zk as _, ls as _t, aU as a, ed as at, cO as b, Yo as bt, yM as c, xl as ct, aj as d, sc as dt, $d as et, WA as f, nc as ft, qk as g, us as gt, sA as h, ds as ht, jW as i, bd as it, Jy as j, Re as jt, Vx as k, Wt as kt, nM as l, hl as lt, SA as m, ws as mt, PW as n, Md as nt, rU as o, xu as ot, HA as p, Ps as pt, vg as q, NW as r, Td as rt, sV as s, Jl as st, IW as t, Nd as tt, eM as u, Yc as ut, Rk as v, as as vt, Hw as w, Ln as wt, cE as x, no as xt, TO as y, Qo as yt, y_ as z, be as zt };
46082
+ export { $d as $, Vx as A, ze as At, n_ as B, _e as Bt, _T as C, wn as Ct, KC as D, Wt as Dt, zw as E, qt as Et, X_ as F, Ee as Ft, Eg as G, Zg as H, j as Ht, Y_ as I, we as It, fg as J, vg as K, N as L, be as Lt, Jy as M, Pe as Mt, Bv as N, Se as Nt, pC as O, Ut as Ot, uv as P, Ce as Pt, Mf as Q, x_ as R, ye as Rt, cE as S, Ln as St, Hw as T, gn as Tt, Xg as U, $g as V, ge as Vt, Dg as W, Bm as X, gh as Y, Vf as Z, qk as _, Qo as _t, aU as a, Jl as at, TO as b, $a as bt, yM as c, Yc as ct, eM as d, Ps as dt, Nd as et, aj as f, ws as ft, sA as g, as as gt, SA as h, ls as ht, jW as i, xu as it, cx as j, Ne as jt, TS as k, Re as kt, vM as l, sc as lt, HA as m, us as mt, FW as n, bd as nt, rU as o, xl as ot, WA as p, ds as pt, hg as q, NW as r, ed as rt, sV as s, hl as st, LW as t, Md as tt, nM as u, nc as ut, zk as v, Yo as vt, Zw as w, bn as wt, cO as x, Yr as xt, Rk as y, no as yt, y_ as z, ve as zt };