@fayz-ai/admin 0.22.0 → 0.22.1

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/index.js CHANGED
@@ -2,11 +2,11 @@ export { ImportWizard } from './chunk-UMRN6427.js';
2
2
  export { getScheduleBlockConfig, setScheduleBlockConfig, subscribeScheduleBlockConfig } from './chunk-RKXZ7RUG.js';
3
3
  import { getFayzSupabaseClientOptional, getFayzSupabaseClient, WorkspaceChooserGate, WorkspaceSwitchingHost, createFayzSupabaseClient, createSupabaseOrgAdapter, createMockOrgAdapter, useWorkspaceSwitchingStore, resolveAppId } from './chunk-ZKOWNGZT.js';
4
4
  export { createFayzSupabaseClient, createMockOrgAdapter, createSupabaseOrgAdapter, getFayzSupabaseClient, getFayzSupabaseClientOptional } from './chunk-ZKOWNGZT.js';
5
- import { useLimitGuard, invalidateLimit, useAccessOptional, useUpgradeModalStore, guardLimit, useLimit, checkAccess, featureDisplayName, PlanFeatureItem, AccessProvider, CORE_LIMIT_DECLARATIONS, entityDerivedLimitDeclarations, getPlanEntitlements, resolvePlanCurrency } from './chunk-CRB4ZUFH.js';
6
- export { AccessProvider, UPGRADE_URL, agentDenial, checkAccess, getAccessSnapshot, guardLimit, invalidateLimit, isEntitledByPlan, resolveAccess, useAccess, useAccessOptional, useLimit, useLimitGuard, useModuleNavAccess, useUpgradeModalStore } from './chunk-CRB4ZUFH.js';
5
+ import { useLimitGuard, invalidateLimit, useAccessOptional, useUpgradeModalStore, guardLimit, useLimit, checkAccess, featureDisplayName, PlanFeatureItem, AccessProvider, CORE_LIMIT_DECLARATIONS, entityDerivedLimitDeclarations, getPlanEntitlements, resolvePlanCurrency } from './chunk-YBLLTHYP.js';
6
+ export { AccessProvider, UPGRADE_URL, agentDenial, checkAccess, getAccessSnapshot, guardLimit, invalidateLimit, isEntitledByPlan, resolveAccess, useAccess, useAccessOptional, useLimit, useLimitGuard, useModuleNavAccess, useUpgradeModalStore } from './chunk-YBLLTHYP.js';
7
7
  import { useTranslation as useTranslation$1 } from './chunk-YUHCC7JY.js';
8
- import { cn, useAdminPath, navigateTo, useBillingStore, normalizeAdminPath, resolvePlanBadge, routeScore, matchRoute, TrialWidget } from './chunk-SHHWE7R2.js';
9
- export { navigateTo as adminNavigateTo, useAdminPath, useBillingStore } from './chunk-SHHWE7R2.js';
8
+ import { cn, useAdminPath, navigateTo, useBillingStore, normalizeAdminPath, resolvePlanBadge, routeScore, matchRoute, TrialWidget } from './chunk-CTCK5JUQ.js';
9
+ export { navigateTo as adminNavigateTo, useAdminPath, useBillingStore } from './chunk-CTCK5JUQ.js';
10
10
  import { readOrgSnapshot, useTenantOptional, useOrgAdapter, useTenant, OrgProvider, useOrgAdapterOptional } from './chunk-NB6X5O5L.js';
11
11
  export { ORG_CACHE_TTL_MS, OrgProvider, clearOrgSnapshot, readOrgSnapshot, useOrgAdapter, useOrgAdapterOptional, useTenant, useTenantOptional } from './chunk-NB6X5O5L.js';
12
12
  import { usePermissionOptional, usePermissionsStore, PermissionsProvider } from './chunk-WJ3H3RJN.js';
@@ -13079,37 +13079,43 @@ function TasksFilterBar() {
13079
13079
  return void 0;
13080
13080
  }
13081
13081
  };
13082
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 overflow-x-auto border-b px-3 py-2", children: [
13083
- FILTERS.map(({ key, labelKey }) => {
13084
- const active2 = activeFilter === key;
13085
- const count = getCount(key);
13086
- return /* @__PURE__ */ jsxs(
13082
+ return (
13083
+ // h-10: a MESMA altura da faixa de abas da página, do outro lado da tela
13084
+ // (PageTabs, em header-tabs.tsx). Com padding em vez
13085
+ // de altura, cada painel do assistente media uma coisa — 41px aqui, 49 nas
13086
+ // Notas — e a linha embaixo da faixa pulava ao trocar de aba.
13087
+ /* @__PURE__ */ jsxs("div", { className: "flex h-10 shrink-0 items-center gap-1 overflow-x-auto border-b px-3", children: [
13088
+ FILTERS.map(({ key, labelKey }) => {
13089
+ const active2 = activeFilter === key;
13090
+ const count = getCount(key);
13091
+ return /* @__PURE__ */ jsxs(
13092
+ "button",
13093
+ {
13094
+ type: "button",
13095
+ onClick: () => setFilter(key),
13096
+ className: `${CHIP} ${active2 ? CHIP_ON : CHIP_OFF}`,
13097
+ children: [
13098
+ t(labelKey),
13099
+ count != null && /* @__PURE__ */ jsx("span", { className: `text-[10px] ${active2 ? "text-primary-foreground/80" : "text-muted-foreground"}`, children: count })
13100
+ ]
13101
+ },
13102
+ key
13103
+ );
13104
+ }),
13105
+ currentUserId && /* @__PURE__ */ jsxs(
13087
13106
  "button",
13088
13107
  {
13089
13108
  type: "button",
13090
- onClick: () => setFilter(key),
13091
- className: `${CHIP} ${active2 ? CHIP_ON : CHIP_OFF}`,
13109
+ onClick: () => setMine(!mine),
13110
+ className: `${CHIP} ml-auto ${mine ? CHIP_ON : CHIP_OFF}`,
13092
13111
  children: [
13093
- t(labelKey),
13094
- count != null && /* @__PURE__ */ jsx("span", { className: `text-[10px] ${active2 ? "text-primary-foreground/80" : "text-muted-foreground"}`, children: count })
13112
+ /* @__PURE__ */ jsx(User, { className: "h-3 w-3" }),
13113
+ t("tasks.filter.mine")
13095
13114
  ]
13096
- },
13097
- key
13098
- );
13099
- }),
13100
- currentUserId && /* @__PURE__ */ jsxs(
13101
- "button",
13102
- {
13103
- type: "button",
13104
- onClick: () => setMine(!mine),
13105
- className: `${CHIP} ml-auto ${mine ? CHIP_ON : CHIP_OFF}`,
13106
- children: [
13107
- /* @__PURE__ */ jsx(User, { className: "h-3 w-3" }),
13108
- t("tasks.filter.mine")
13109
- ]
13110
- }
13111
- )
13112
- ] });
13115
+ }
13116
+ )
13117
+ ] })
13118
+ );
13113
13119
  }
13114
13120
  function TaskQuickAdd({ parentId }) {
13115
13121
  const t = useTranslation();
@@ -16086,7 +16092,7 @@ function NotebookPanel() {
16086
16092
  (a, b) => a.page.pinned !== b.page.pinned ? a.page.pinned ? -1 : 1 : b.page.updatedAt.localeCompare(a.page.updatedAt)
16087
16093
  );
16088
16094
  return /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 flex-col", children: [
16089
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-border/40 px-3 py-2", children: [
16095
+ /* @__PURE__ */ jsxs("div", { className: "flex h-10 shrink-0 items-center gap-2 border-b border-border/40 px-3", children: [
16090
16096
  /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
16091
16097
  /* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60" }),
16092
16098
  /* @__PURE__ */ jsx(
@@ -19477,18 +19483,33 @@ function RightRail({ frame = true, attached = true }) {
19477
19483
  // radius utilities do not survive a responsive variant in this build —
19478
19484
  // the class emits nothing and the card comes out square. Verified.
19479
19485
  //
19480
- // Framed + attached: this closes the right edge the content card
19481
- // opened (see `railOpen` in AppShell), so the two read as ONE card and
19482
- // the left edge is the only seam between them. Detached, it is its own
19483
- // card and rounds on all four. Radius matches the content card either way.
19486
+ // Emoldurado, é cartão. Encostado, arredonda em três cantos: o
19487
+ // esquerdo de CIMA acompanha o do conteúdo, que agora nasce logo abaixo
19488
+ // da faixa escura do cabeçalho, e o de BAIXO fica reto — é ali que ele
19489
+ // encosta na página, e um canto redondo no pé abriria uma fresta entre
19490
+ // as duas colunas justamente onde elas se tocam. Solto, arredonda nos
19491
+ // quatro.
19484
19492
  //
19485
19493
  // The seam is 2px where the card border is 1px: at `--border` (89%
19486
19494
  // lightness) a hairline between two panes of the same surface is not a
19487
19495
  // division anyone can see.
19488
- frame ? attached ? "md:rounded-r-xl md:border md:border-l-2 md:border-border" : "md:rounded-xl md:border md:border-border" : "md:border-l-2 md:border-border"
19496
+ frame ? attached ? "md:rounded-xl md:rounded-bl-none md:border md:border-l-2 md:border-border" : "md:rounded-xl md:border md:border-border" : "md:border-l-2 md:border-border"
19489
19497
  ),
19490
19498
  children: [
19491
- /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-14 shrink-0 items-center gap-2 border-b border-border px-3", children: [
19499
+ /* @__PURE__ */ jsxs("div", { className: cn(
19500
+ "relative flex min-h-14 shrink-0 items-center gap-2 border-b border-border px-3",
19501
+ // Altura TRAVADA na moldura, não mínima, e 48 e não 56: o que tem de
19502
+ // bater é a LINHA DE BAIXO desta faixa com a da barra da shell, que é
19503
+ // onde o cartão do conteúdo começa. A barra da shell mede 56px a
19504
+ // partir do topo da janela; este cartão começa 8px abaixo dele (a folga
19505
+ // da moldura, `md:py-2` no aside), então 48 + 8 = 56. Com `min-h` — e
19506
+ // são duas subárvores diferentes — bastava um controle mais alto aqui
19507
+ // dentro para esta linha descer sozinha.
19508
+ // `md:min-h-0` junto: sem ele o `min-h-14` acima vence o `h-12` — uma
19509
+ // altura mínima de 56 ganha de uma altura fixa de 48 — e a faixa voltava
19510
+ // a medir 56, oito pixels abaixo da barra da shell.
19511
+ frame && "md:h-12 md:min-h-0"
19512
+ ), children: [
19492
19513
  /* @__PURE__ */ jsx(
19493
19514
  "div",
19494
19515
  {
@@ -29550,7 +29571,7 @@ var CommandPalette = React113.lazy(
29550
29571
  () => import('./CommandPalette-GQ6SPITD.js').then((m) => ({ default: m.CommandPalette }))
29551
29572
  );
29552
29573
  var SubscriptionPage = React113.lazy(
29553
- () => import('./SubscriptionPage-KYMUCZRW.js').then((m) => ({ default: m.SubscriptionPage }))
29574
+ () => import('./SubscriptionPage-Y23PH6US.js').then((m) => ({ default: m.SubscriptionPage }))
29554
29575
  );
29555
29576
  function orgInitials(name) {
29556
29577
  const words2 = name.trim().split(/\s+/).filter(Boolean);
@@ -30333,8 +30354,11 @@ function AdminShellInner({ appName, layout = "sidebar", logo, markLogo, pages =
30333
30354
  const hit = candidates.find(
30334
30355
  (n) => n.route === "/" ? path === "/" || path === "" : path === n.route || path.startsWith(n.route + "/") || path.startsWith(n.route)
30335
30356
  );
30336
- return hit?.label ?? candidates.find((n) => n.route === "/")?.label ?? "";
30337
- }, [navigation, path, tr, match, settingsTabDef]);
30357
+ if (hit) return hit.label;
30358
+ const hiddenHit = pages.filter((pg) => pg.nav === false && pg.label && pg.path).sort((a, b) => b.path.length - a.path.length).find((pg) => pg.path === path || path.startsWith(pg.path + "/"));
30359
+ if (hiddenHit?.label) return hiddenHit.label;
30360
+ return candidates.find((n) => n.route === "/")?.label ?? "";
30361
+ }, [navigation, pages, path, tr, match, settingsTabDef]);
30338
30362
  const parentBack = React113.useMemo(() => {
30339
30363
  if (settingsTabDef) {
30340
30364
  const first = allSettingsTabs[0]?.id;
@@ -30365,6 +30389,30 @@ function AdminShellInner({ appName, layout = "sidebar", logo, markLogo, pages =
30365
30389
  ]
30366
30390
  }
30367
30391
  );
30392
+ const [railQuery, setRailQuery] = React113.useState("");
30393
+ const railBase = moduleRail?.base ?? null;
30394
+ React113.useEffect(() => {
30395
+ setRailQuery("");
30396
+ }, [railBase]);
30397
+ const railSearch = (placeholder) => /* @__PURE__ */ jsxs("div", { className: "relative px-0.5 pt-1", children: [
30398
+ /* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-sidebar-foreground/40" }),
30399
+ /* @__PURE__ */ jsx(
30400
+ "input",
30401
+ {
30402
+ type: "search",
30403
+ value: railQuery,
30404
+ onChange: (e) => setRailQuery(e.target.value),
30405
+ placeholder,
30406
+ "aria-label": placeholder,
30407
+ className: "h-8 w-full rounded-button border border-sidebar-border/60 bg-sidebar-accent/30 pl-8 pr-2 text-[13px] text-sidebar-foreground outline-none transition-colors placeholder:text-sidebar-foreground/40 focus:border-sidebar-ring focus:bg-sidebar-accent/50"
30408
+ }
30409
+ )
30410
+ ] });
30411
+ const filterRail = (entries2) => {
30412
+ const q = railQuery.trim().toLowerCase();
30413
+ if (!q) return entries2;
30414
+ return entries2.filter((e) => String(e.label ?? "").toLowerCase().includes(q));
30415
+ };
30368
30416
  const contextualRail = inSettings ? {
30369
30417
  key: "settings",
30370
30418
  navigation: settingsNavigation,
@@ -30375,9 +30423,12 @@ function AdminShellInner({ appName, layout = "sidebar", logo, markLogo, pages =
30375
30423
  top: backLink(tr("settings.backToHome", "Back to home"), homeRoute)
30376
30424
  } : moduleRail ? {
30377
30425
  key: moduleRail.base,
30378
- navigation: moduleRail.entries,
30426
+ navigation: filterRail(moduleRail.entries),
30379
30427
  sectionLabels: { main: moduleRail.label },
30380
- top: backLink(moduleRail.backLabel ?? tr("settings.backToHome", "Back to home"), moduleRail.backTo ?? homeRoute)
30428
+ top: /* @__PURE__ */ jsxs(Fragment, { children: [
30429
+ backLink(moduleRail.backLabel ?? tr("settings.backToHome", "Back to home"), moduleRail.backTo ?? homeRoute),
30430
+ moduleRail.searchPlaceholder ? railSearch(moduleRail.searchPlaceholder) : null
30431
+ ] })
30381
30432
  } : null;
30382
30433
  return /* @__PURE__ */ jsxs(ModuleLayoutProvider, { variant: moduleVariant, children: [
30383
30434
  /* @__PURE__ */ jsxs(
@@ -33623,14 +33674,12 @@ var kindWord = (v) => v ? ORDER_KIND_LABELS[v] ?? v : void 0;
33623
33674
  var channelWord = (v) => v ? ORDER_CHANNEL_LABELS[v] ?? v : void 0;
33624
33675
  function OrderRailSkeleton() {
33625
33676
  return /* @__PURE__ */ jsxs("div", { className: "flex min-h-full flex-col", "aria-hidden": true, children: [
33626
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5 px-4 py-3", children: [
33627
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-20 rounded-full" }),
33628
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 rounded-full" }),
33629
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 rounded-full" })
33630
- ] }),
33631
- /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
33677
+ /* @__PURE__ */ jsxs("div", { className: "flex h-10 items-center justify-between gap-3 px-4", children: [
33632
33678
  /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-40" }),
33633
- /* @__PURE__ */ jsx(Skeleton, { className: "mt-1.5 h-3 w-28" })
33679
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
33680
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 rounded-full" }),
33681
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 rounded-full" })
33682
+ ] })
33634
33683
  ] }),
33635
33684
  /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
33636
33685
  /* @__PURE__ */ jsx(Skeleton, { className: "h-2.5 w-14" }),
@@ -33707,14 +33756,13 @@ function OrderDetailRail({
33707
33756
  loading && /* @__PURE__ */ jsx(OrderRailSkeleton, {}),
33708
33757
  error && /* @__PURE__ */ jsx("p", { className: "px-4 py-3 text-sm text-destructive", children: error }),
33709
33758
  order && /* @__PURE__ */ jsxs(Fragment, { children: [
33710
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5 px-4 py-3", children: [
33711
- (statusLabel2?.(order) ?? statusWord(order.status)) && /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: statusLabel2?.(order) ?? statusWord(order.status) }),
33712
- (kindLabel?.(order) ?? kindWord(order.kind)) && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: kindLabel?.(order) ?? kindWord(order.kind) }),
33713
- (channelLabel?.(order) ?? channelWord(order.channel)) && (channelLabel?.(order) ?? channelWord(order.channel)) !== (kindLabel?.(order) ?? kindWord(order.kind)) && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: channelLabel?.(order) ?? channelWord(order.channel) })
33714
- ] }),
33715
- (order.partyName || order.createdAt) && /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
33716
- order.partyName && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: order.partyName }),
33717
- order.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: new Date(order.createdAt).toLocaleString("pt-BR") })
33759
+ /* @__PURE__ */ jsxs("div", { className: "flex h-10 shrink-0 items-center justify-between gap-3 px-4", children: [
33760
+ /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: order.partyName || "Consumidor n\xE3o identificado" }),
33761
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
33762
+ (statusLabel2?.(order) ?? statusWord(order.status)) && /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: statusLabel2?.(order) ?? statusWord(order.status) }),
33763
+ (kindLabel?.(order) ?? kindWord(order.kind)) && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: kindLabel?.(order) ?? kindWord(order.kind) }),
33764
+ (channelLabel?.(order) ?? channelWord(order.channel)) && (channelLabel?.(order) ?? channelWord(order.channel)) !== (kindLabel?.(order) ?? kindWord(order.kind)) && /* @__PURE__ */ jsx(Badge, { variant: "outline", children: channelLabel?.(order) ?? channelWord(order.channel) })
33765
+ ] })
33718
33766
  ] }),
33719
33767
  /* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
33720
33768
  /* @__PURE__ */ jsxs("p", { className: "pb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60", children: [
@@ -33766,6 +33814,10 @@ function OrderDetailRail({
33766
33814
  }
33767
33815
  ),
33768
33816
  verbs.filter((a) => a.variant === "destructive").map((action) => /* @__PURE__ */ jsx(RailAction, { action, running, onRun: run }, action.id))
33817
+ ] }),
33818
+ order.createdAt && /* @__PURE__ */ jsxs("p", { className: "border-t border-border/40 px-4 py-1.5 text-[10px] text-muted-foreground/60", children: [
33819
+ "Criado em ",
33820
+ new Date(order.createdAt).toLocaleString("pt-BR")
33769
33821
  ] })
33770
33822
  ] })
33771
33823
  ] }),