@rebasepro/cms 0.33.2 → 0.34.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.
Files changed (52) hide show
  1. package/dist/components/BrandLogo.d.ts +16 -0
  2. package/dist/components/BrandLogo.js +34 -0
  3. package/dist/components/BrandLogo.js.map +1 -0
  4. package/dist/components/CollectionViewBinding/BoardCardBinding.js +3 -3
  5. package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -1
  6. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +2 -2
  7. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -1
  8. package/dist/components/CollectionViewBinding/EntityCardBinding.js +3 -3
  9. package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -1
  10. package/dist/components/CollectionViewBinding/SlotValue.js +2 -2
  11. package/dist/components/CollectionViewBinding/SlotValue.js.map +1 -1
  12. package/dist/components/DefaultAppBar.d.ts +3 -1
  13. package/dist/components/DefaultAppBar.js +11 -6
  14. package/dist/components/DefaultAppBar.js.map +1 -1
  15. package/dist/components/DefaultDrawer.d.ts +5 -2
  16. package/dist/components/DefaultDrawer.js +9 -6
  17. package/dist/components/DefaultDrawer.js.map +1 -1
  18. package/dist/components/EntityIdentityBar.js +1 -1
  19. package/dist/components/EntityIdentityBar.js.map +1 -1
  20. package/dist/components/PropertyKeyHint.js +1 -1
  21. package/dist/components/PropertyKeyHint.js.map +1 -1
  22. package/dist/components/RebaseAuthGate.d.ts +5 -1
  23. package/dist/components/RebaseAuthGate.js +6 -2
  24. package/dist/components/RebaseAuthGate.js.map +1 -1
  25. package/dist/components/RebaseLayout.d.ts +2 -0
  26. package/dist/components/RebaseLayout.js +4 -2
  27. package/dist/components/RebaseLayout.js.map +1 -1
  28. package/dist/components/RebaseShell.d.ts +6 -1
  29. package/dist/components/RebaseShell.js +21 -16
  30. package/dist/components/RebaseShell.js.map +1 -1
  31. package/dist/components/RelationSelector.js +1 -1
  32. package/dist/components/RelationSelector.js.map +1 -1
  33. package/dist/components/app/Drawer.d.ts +2 -1
  34. package/dist/components/app/Drawer.js +2 -1
  35. package/dist/components/app/Drawer.js.map +1 -1
  36. package/dist/components/app/Scaffold.d.ts +5 -0
  37. package/dist/components/app/Scaffold.js +5 -3
  38. package/dist/components/app/Scaffold.js.map +1 -1
  39. package/dist/components/app/useApp.d.ts +1 -0
  40. package/dist/components/app/useApp.js.map +1 -1
  41. package/dist/editor/components/SlashCommandMenu.js +1 -1
  42. package/dist/editor/components/SlashCommandMenu.js.map +1 -1
  43. package/dist/editor/selectors/link-selector.js +1 -1
  44. package/dist/editor/selectors/link-selector.js.map +1 -1
  45. package/dist/editor/selectors/text-buttons.js +1 -1
  46. package/dist/editor/selectors/text-buttons.js.map +1 -1
  47. package/dist/form/field_bindings/VectorFieldBinding.js +1 -1
  48. package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -1
  49. package/dist/hooks/navigation/compose_collections.d.ts +3 -2
  50. package/dist/hooks/navigation/compose_collections.js +27 -3
  51. package/dist/hooks/navigation/compose_collections.js.map +1 -1
  52. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"SlotValue.js","names":[],"sources":["../../../src/components/CollectionViewBinding/SlotValue.tsx"],"sourcesContent":["import React from \"react\";\nimport type { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { PropertyPreview } from \"../../preview\";\nimport { StorageThumbnail } from \"../../preview/components/StorageThumbnail\";\nimport { UrlComponentPreview } from \"../../preview/components/UrlComponentPreview\";\nimport { Chip } from \"@rebasepro/ui\";\nimport type { PreviewSlot } from \"./usePreviewSlots\";\n\nexport interface SlotValueProps {\n slot: PreviewSlot | undefined;\n size: PreviewSize;\n /**\n * Relations and references render as one line of linked text rather than as\n * a card. Defaults to true: a slot is a line in a row or a card, and a\n * relation that renders its own bordered card there — with its own id line\n * and its own side-panel button — is a card inside a card.\n *\n * Pass `false` only for a slot with room for one, which in practice is\n * none of them.\n */\n textOnly?: boolean;\n /** Images only: fill the container rather than fitting inside it. */\n fill?: boolean;\n}\n\n/**\n * One display slot, rendered.\n *\n * A slot's value arrives one of two ways and they cannot be rendered the same:\n *\n * - **From a property** — render it with that property's own preview, so an\n * enum status keeps its colour, a date keeps its format and a storage path\n * becomes a thumbnail. This is why a declared path beats a resolver whenever\n * the value is actually on the record.\n * - **From a resolver** — there is no property, because the value was computed\n * or fetched. All that can be said about it is that it is text.\n *\n * The branch lives here, once, rather than at each of the fourteen places the\n * list row, the card and the board card render a slot. That count is the reason:\n * the last time a rule like this was inlined per call site, it drifted into\n * seven versions.\n */\nexport function SlotValue({ slot, size, textOnly = true, fill }: SlotValueProps) {\n\n if (!slot || slot.value === undefined || slot.value === null) return null;\n\n if (!slot.property || !slot.propertyKey) {\n // A computed image is still an image. \"There is no property, so all that\n // can be said about it is that it is text\" holds for a title and fails\n // here: `display.image` accepts \"a storage path or a URL … so a resolver\n // may return either\", and both used to be printed as their own string\n // inside the image frame.\n if (slot.role === \"image\" && typeof slot.value === \"string\" && slot.value.trim()) {\n return <ComputedImage value={slot.value.trim()} size={size} fill={fill}/>;\n }\n\n // Computed. Arrays (a `tags` resolver) join rather than rendering as\n // \"[object Object]\" via String().\n const text = Array.isArray(slot.value)\n ? slot.value.map(item => String(item)).join(\", \")\n : String(slot.value);\n return <>{text}</>;\n }\n\n return <PropertyPreview\n propertyKey={slot.propertyKey}\n value={slot.value}\n property={slot.property}\n size={size}\n textOnly={textOnly}\n fill={fill}/>;\n}\n\n/**\n * The `tags` slot, as chips beside the status.\n *\n * Honours both arms the same way the rest of the file does. A declared **path**\n * goes through {@link SlotValue}, so an array of enum values keeps its own\n * colours — that is the stated advantage of naming a property. A **resolver**\n * returns bare strings with no property to render them as, so they become plain\n * chips; a single string is accepted as one tag, which the role's type documents.\n *\n * Lives here rather than in the list, the card and the board card because that is\n * three copies of the same decision, and this file exists to hold exactly one.\n */\nexport function TagChips({ slot, max = 4 }: { slot: PreviewSlot, max?: number }) {\n\n if (slot.property && slot.propertyKey) {\n return <SlotValue slot={slot} size=\"small\"/>;\n }\n\n const values = (Array.isArray(slot.value) ? slot.value : [slot.value])\n .filter(item => item !== undefined && item !== null && String(item).trim() !== \"\")\n .map(item => String(item));\n\n if (values.length === 0) return null;\n\n const shown = values.slice(0, max);\n const hidden = values.length - shown.length;\n\n return <>\n {shown.map(value => (\n <Chip key={value}\n size=\"smallest\"\n className=\"!text-[10px] !leading-tight !py-0 shrink-0 max-w-[100px] truncate\">\n {value}\n </Chip>\n ))}\n {hidden > 0 && (\n <span className=\"text-[10px] text-surface-400 dark:text-surface-500 shrink-0\">+{hidden}</span>\n )}\n </>;\n}\n\n/**\n * Whether a computed image string can be fetched as-is, or has to be resolved\n * through storage first.\n *\n * Exported because it is the whole decision: rendering either branch needs a\n * provider (a storage source, a DOM), and the thing worth pinning is which\n * branch a given string takes. `//host/x` is protocol-relative and equally\n * fetchable; `data:` and `blob:` are already the bytes.\n */\nexport function isFetchableImageUrl(value: string): boolean {\n return /^(https?:)?\\/\\//i.test(value) || /^(data|blob):/i.test(value);\n}\n\n/**\n * A string a resolver returned for the `image` role, rendered as a picture.\n *\n * Two things can arrive here and they need different handling, which is the whole\n * reason a property-path image is preferable: a storage property knows which\n * backend holds it, and a bare string does not.\n *\n * - An **absolute URL** is already fetchable. Rendering it through the storage\n * layer would ask a bucket to sign a path that was never in it.\n * - Anything else is read as a **storage path** on the default source, which is\n * the only source a value with no property can be attributed to. A resolver\n * pointing at a named source should name the property instead.\n */\nfunction ComputedImage({ value, size, fill }: { value: string, size: PreviewSize, fill?: boolean }) {\n const isAbsolute = isFetchableImageUrl(value);\n\n if (isAbsolute) {\n return <UrlComponentPreview previewType=\"image\"\n url={value}\n size={size}\n fill={fill}\n hint={value}/>;\n }\n\n return <StorageThumbnail storagePathOrDownloadUrl={value}\n storeUrl={false}\n size={size}\n fill={fill}/>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,UAAU,E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N,qBAAC,QAAD;EAAM,WAAU;YAAhB,CAA8E,KAAE,MAAa;GAEnG,EAAA,CAAA;AACN;;;;;;;;;;AAWA,SAAgB,oBAAoB,OAAwB;CACxD,OAAO,mBAAmB,KAAK,KAAK,KAAK,iBAAiB,KAAK,KAAK;AACxE;;;;;;;;;;;;;;AAeA,SAAS,cAAc,EAAE,OAAO,MAAM,QAA8D;CAGhG,IAFmB,oBAAoB,KAEnC,GACA,OAAO,oBAAC,qBAAD;EAAqB,aAAY;EACpC,KAAK;EACC;EACA;EACN,MAAM;CAAO,CAAA;CAGrB,OAAO,oBAAC,kBAAD;EAAkB,0BAA0B;EAC/C,UAAU;EACJ;EACA;CAAM,CAAA;AACpB"}
1
+ {"version":3,"file":"SlotValue.js","names":[],"sources":["../../../src/components/CollectionViewBinding/SlotValue.tsx"],"sourcesContent":["import React from \"react\";\nimport type { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { PropertyPreview } from \"../../preview\";\nimport { StorageThumbnail } from \"../../preview/components/StorageThumbnail\";\nimport { UrlComponentPreview } from \"../../preview/components/UrlComponentPreview\";\nimport { Chip } from \"@rebasepro/ui\";\nimport type { PreviewSlot } from \"./usePreviewSlots\";\n\nexport interface SlotValueProps {\n slot: PreviewSlot | undefined;\n size: PreviewSize;\n /**\n * Relations and references render as one line of linked text rather than as\n * a card. Defaults to true: a slot is a line in a row or a card, and a\n * relation that renders its own bordered card there — with its own id line\n * and its own side-panel button — is a card inside a card.\n *\n * Pass `false` only for a slot with room for one, which in practice is\n * none of them.\n */\n textOnly?: boolean;\n /** Images only: fill the container rather than fitting inside it. */\n fill?: boolean;\n}\n\n/**\n * One display slot, rendered.\n *\n * A slot's value arrives one of two ways and they cannot be rendered the same:\n *\n * - **From a property** — render it with that property's own preview, so an\n * enum status keeps its colour, a date keeps its format and a storage path\n * becomes a thumbnail. This is why a declared path beats a resolver whenever\n * the value is actually on the record.\n * - **From a resolver** — there is no property, because the value was computed\n * or fetched. All that can be said about it is that it is text.\n *\n * The branch lives here, once, rather than at each of the fourteen places the\n * list row, the card and the board card render a slot. That count is the reason:\n * the last time a rule like this was inlined per call site, it drifted into\n * seven versions.\n */\nexport function SlotValue({ slot, size, textOnly = true, fill }: SlotValueProps) {\n\n if (!slot || slot.value === undefined || slot.value === null) return null;\n\n if (!slot.property || !slot.propertyKey) {\n // A computed image is still an image. \"There is no property, so all that\n // can be said about it is that it is text\" holds for a title and fails\n // here: `display.image` accepts \"a storage path or a URL … so a resolver\n // may return either\", and both used to be printed as their own string\n // inside the image frame.\n if (slot.role === \"image\" && typeof slot.value === \"string\" && slot.value.trim()) {\n return <ComputedImage value={slot.value.trim()} size={size} fill={fill}/>;\n }\n\n // Computed. Arrays (a `tags` resolver) join rather than rendering as\n // \"[object Object]\" via String().\n const text = Array.isArray(slot.value)\n ? slot.value.map(item => String(item)).join(\", \")\n : String(slot.value);\n return <>{text}</>;\n }\n\n return <PropertyPreview\n propertyKey={slot.propertyKey}\n value={slot.value}\n property={slot.property}\n size={size}\n textOnly={textOnly}\n fill={fill}/>;\n}\n\n/**\n * The `tags` slot, as chips beside the status.\n *\n * Honours both arms the same way the rest of the file does. A declared **path**\n * goes through {@link SlotValue}, so an array of enum values keeps its own\n * colours — that is the stated advantage of naming a property. A **resolver**\n * returns bare strings with no property to render them as, so they become plain\n * chips; a single string is accepted as one tag, which the role's type documents.\n *\n * Lives here rather than in the list, the card and the board card because that is\n * three copies of the same decision, and this file exists to hold exactly one.\n */\nexport function TagChips({ slot, max = 4 }: { slot: PreviewSlot, max?: number }) {\n\n if (slot.property && slot.propertyKey) {\n return <SlotValue slot={slot} size=\"small\"/>;\n }\n\n const values = (Array.isArray(slot.value) ? slot.value : [slot.value])\n .filter(item => item !== undefined && item !== null && String(item).trim() !== \"\")\n .map(item => String(item));\n\n if (values.length === 0) return null;\n\n const shown = values.slice(0, max);\n const hidden = values.length - shown.length;\n\n return <>\n {shown.map(value => (\n <Chip key={value}\n size=\"smallest\"\n className=\"!text-xs !leading-tight !py-0 shrink-0 max-w-[100px] truncate\">\n {value}\n </Chip>\n ))}\n {hidden > 0 && (\n <span className=\"text-xs text-surface-400 dark:text-surface-500 shrink-0\">+{hidden}</span>\n )}\n </>;\n}\n\n/**\n * Whether a computed image string can be fetched as-is, or has to be resolved\n * through storage first.\n *\n * Exported because it is the whole decision: rendering either branch needs a\n * provider (a storage source, a DOM), and the thing worth pinning is which\n * branch a given string takes. `//host/x` is protocol-relative and equally\n * fetchable; `data:` and `blob:` are already the bytes.\n */\nexport function isFetchableImageUrl(value: string): boolean {\n return /^(https?:)?\\/\\//i.test(value) || /^(data|blob):/i.test(value);\n}\n\n/**\n * A string a resolver returned for the `image` role, rendered as a picture.\n *\n * Two things can arrive here and they need different handling, which is the whole\n * reason a property-path image is preferable: a storage property knows which\n * backend holds it, and a bare string does not.\n *\n * - An **absolute URL** is already fetchable. Rendering it through the storage\n * layer would ask a bucket to sign a path that was never in it.\n * - Anything else is read as a **storage path** on the default source, which is\n * the only source a value with no property can be attributed to. A resolver\n * pointing at a named source should name the property instead.\n */\nfunction ComputedImage({ value, size, fill }: { value: string, size: PreviewSize, fill?: boolean }) {\n const isAbsolute = isFetchableImageUrl(value);\n\n if (isAbsolute) {\n return <UrlComponentPreview previewType=\"image\"\n url={value}\n size={size}\n fill={fill}\n hint={value}/>;\n }\n\n return <StorageThumbnail storagePathOrDownloadUrl={value}\n storeUrl={false}\n size={size}\n fill={fill}/>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,UAAU,EAAE,MAAM,MAAM,WAAW,MAAM,QAAwB;CAE7E,IAAI,CAAC,QAAQ,KAAK,UAAU,KAAA,KAAa,KAAK,UAAU,MAAM,OAAO;CAErE,IAAI,CAAC,KAAK,YAAY,CAAC,KAAK,aAAa;EAMrC,IAAI,KAAK,SAAS,WAAW,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,GAC3E,OAAO,oBAAC,eAAD;GAAe,OAAO,KA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ACA,OAAO,oBAAC,qBAAD;EAAqB,aAAY;EACpC,KAAK;EACC;EACA;EACN,MAAM;CAAO,CAAA;CAGrB,OAAO,oBAAC,kBAAD;EAAkB,0BAA0B;EAC/C,UAAU;EACJ;EACA;CAAM,CAAA;AACpB"}
@@ -35,6 +35,8 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
35
35
  className?: string;
36
36
  style?: React.CSSProperties;
37
37
  logo?: string;
38
+ /** The logo for the dark theme. Falls back to `logo`. */
39
+ logoDark?: string;
38
40
  user?: User;
39
41
  } & ADDITIONAL_PROPS;
40
42
  /**
@@ -43,4 +45,4 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
43
45
  *
44
46
 
45
47
  */
46
- export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, includeLanguageToggle, includeUserMenu, className, style, user: userProp, logo: logoProp }: DefaultAppBarProps) => React.JSX.Element;
48
+ export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, includeLanguageToggle, includeUserMenu, className, style, user: userProp, logo: logoProp, logoDark: logoDarkProp }: DefaultAppBarProps) => React.JSX.Element;
@@ -13,9 +13,10 @@ import { Link, useNavigate } from "react-router";
13
13
  *
14
14
 
15
15
  */
16
- var DefaultAppBar = function DefaultAppBar({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle = true, includeLanguageToggle = true, includeUserMenu = true, className, style, user: userProp, logo: logoProp }) {
17
- const { hasDrawer, drawerOpen, logo: appLogo } = useApp();
16
+ var DefaultAppBar = function DefaultAppBar({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle = true, includeLanguageToggle = true, includeUserMenu = true, className, style, user: userProp, logo: logoProp, logoDark: logoDarkProp }) {
17
+ const { hasDrawer, drawerOpen, logo: appLogo, logoDark: appLogoDark } = useApp();
18
18
  const logo = logoProp ?? appLogo;
19
+ const logoDark = logoProp ? logoDarkProp : logoDarkProp ?? appLogoDark;
19
20
  const navigation = useUrlController();
20
21
  const breadcrumbs = useBreadcrumbsController();
21
22
  const authController = useAuthController();
@@ -58,11 +59,15 @@ var DefaultAppBar = function DefaultAppBar({ title, endAdornment, startAdornment
58
59
  to: navigation?.basePath ?? "/",
59
60
  children: /* @__PURE__ */ jsxs("div", {
60
61
  className: "flex flex-row gap-4",
61
- children: [!hasDrawer && (logo ? /* @__PURE__ */ jsx("img", {
62
+ children: [!hasDrawer && (logo ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("img", {
62
63
  src: logo,
63
64
  alt: "Logo",
64
- className: cls("w-[32px] h-[32px] object-contain")
65
- }) : /* @__PURE__ */ jsx(RebaseLogo, {
65
+ className: cls("w-[32px] h-[32px] object-contain", logoDark && "dark:hidden")
66
+ }), logoDark && /* @__PURE__ */ jsx("img", {
67
+ src: logoDark,
68
+ alt: "Logo",
69
+ className: "w-[32px] h-[32px] object-contain hidden dark:block"
70
+ })] }) : /* @__PURE__ */ jsx(RebaseLogo, {
66
71
  width: "32px",
67
72
  height: "32px"
68
73
  })), typeof title === "string" ? /* @__PURE__ */ jsx(Typography, {
@@ -73,7 +78,7 @@ var DefaultAppBar = function DefaultAppBar({ title, endAdornment, startAdornment
73
78
  })
74
79
  })
75
80
  }),
76
- /* @__PURE__ */ jsx("div", {
81
+ breadcrumbs.breadcrumbs.length > 0 && /* @__PURE__ */ jsx("div", {
77
82
  className: "mr-8 hidden lg:block",
78
83
  children: /* @__PURE__ */ jsx("nav", {
79
84
  "aria-label": "Breadcrumb",
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultAppBar.js","names":[],"sources":["../../src/components/DefaultAppBar.tsx"],"sourcesContent":["\nimport React from \"react\";\n\nimport { Link, useNavigate } from \"react-router\";\nimport { RebaseLogo, LanguageToggle, RlsSimulatorBar } from \"@rebasepro/app\";\nimport { ErrorBoundary, iconSize } from \"@rebasepro/ui\";\nimport {\n Avatar,\n cls,\n IconButton,\n LogOutIcon,\n Menu,\n MenuItem,\n MoonIcon,\n SettingsIcon,\n Skeleton,\n SunIcon,\n SunMoonIcon,\n Typography\n} from \"@rebasepro/ui\";\nimport { useAuthController, useLargeLayout, useModeController, useAdminModeController, useTranslation, useRebaseContext, useSlot } from \"@rebasepro/app\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { User } from \"@rebasepro/types\";\nimport { useApp } from \"./app/useApp\";\nimport { useBreadcrumbsController } from \"../hooks/useBreadcrumbsController\";\nimport { UserSettingsView } from \"@rebasepro/app\";\n\nexport type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {\n\n /**\n * The content of the app bar, usually a title or logo. This includes a link to the home page.\n */\n title?: React.ReactNode;\n\n /**\n * A component that gets rendered on the upper side to the end of the main toolbar\n */\n endAdornment?: React.ReactNode;\n\n /**\n * A component that gets rendered on the upper side to the start of the main toolbar\n */\n startAdornment?: React.ReactNode;\n\n dropDownActions?: React.ReactNode;\n\n /**\n * Whether to render the dark/light/system mode toggle in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeModeToggle?: boolean;\n\n /**\n * Whether to render the language switcher in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeLanguageToggle?: boolean;\n\n /**\n * Whether to render the user avatar / menu in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeUserMenu?: boolean;\n\n className?: string;\n\n style?: React.CSSProperties;\n\n logo?: string;\n\n user?: User;\n} & ADDITIONAL_PROPS;\n\n/**\n * This component renders the main app bar of Rebase.\n * You will likely not need to use this component directly.\n *\n\n */\nexport const DefaultAppBar = function DefaultAppBar({\n title,\n endAdornment,\n startAdornment,\n dropDownActions,\n includeModeToggle = true,\n includeLanguageToggle = true,\n includeUserMenu = true,\n className,\n style,\n user: userProp,\n logo: logoProp\n}: DefaultAppBarProps) {\n\n const {\n hasDrawer,\n drawerOpen,\n logo: appLogo\n } = useApp();\n\n const logo = logoProp ?? appLogo;\n\n const navigation = useUrlController();\n\n const breadcrumbs = useBreadcrumbsController();\n\n const authController = useAuthController();\n const adminModeController = useAdminModeController();\n const {\n mode,\n setMode\n } = useModeController();\n\n const navigate = useNavigate();\n\n const largeLayout = useLargeLayout();\n\n const user = userProp ?? authController.user;\n const { t } = useTranslation();\n\n // The two shell slots. Both take the context and nothing else, which is why\n // they are told apart by *where* they render rather than by their props: a\n // cross-collection search belongs beside the breadcrumbs, where a search\n // box goes, and a toolbar action belongs with the other actions at the end.\n const rebaseContext = useRebaseContext();\n const slotProps = React.useMemo(() => ({ context: rebaseContext }), [rebaseContext]);\n const globalSearch = useSlot(\"global.search\", slotProps);\n const shellToolbar = useSlot(\"shell.toolbar\", slotProps);\n\n let avatarComponent: React.ReactElement | null;\n\n if (user) {\n const initial = user?.displayName\n ? user.displayName[0].toUpperCase()\n : (user?.email ? user.email[0].toUpperCase() : \"A\");\n avatarComponent = <Avatar src={user.photoURL ?? undefined}>\n {initial}\n </Avatar>;\n } else if (user === undefined || authController.initialLoading) {\n avatarComponent = <div className={\"p-1 flex justify-center\"}>\n <Skeleton className={\"w-10 h-10 rounded-full\"}/>\n </div>;\n } else {\n avatarComponent = null;\n }\n\n\n return (\n <div\n style={style}\n role=\"banner\"\n className={cls(\"w-full h-14 transition-all ease-in duration-75 absolute top-0 max-w-full overflow-x-auto no-scrollbar\",\n \"flex flex-row gap-2 px-4 items-center\",\n \"backdrop-blur-sm bg-surface-frame/90\",\n {\n \"pl-[19rem]\": drawerOpen && largeLayout,\n \"pl-24\": hasDrawer && !(drawerOpen && largeLayout),\n \"z-10\": largeLayout,\n \"duration-100\": drawerOpen && largeLayout\n },\n className)}>\n\n {navigation && (!hasDrawer || title) && <div className=\"mr-2 hidden lg:block\">\n <Link\n className=\"visited:text-inherit dark:visited:text-inherit block\"\n to={navigation?.basePath ?? \"/\"}\n >\n <div className={\"flex flex-row gap-4\"}>\n {!hasDrawer && (logo\n ? <img src={logo}\n alt=\"Logo\"\n className={cls(\"w-[32px] h-[32px] object-contain\")}/>\n : <RebaseLogo width={\"32px\"} height={\"32px\"}/>)}\n\n {typeof title === \"string\"\n ? <Typography variant=\"subtitle1\"\n noWrap>\n {title}\n </Typography>\n : title}\n </div>\n </Link>\n </div>}\n\n <div className=\"mr-8 hidden lg:block\">\n <nav aria-label=\"Breadcrumb\">\n <div className={\"flex flex-row gap-2 items-center\"}>\n {breadcrumbs.breadcrumbs.map((breadcrumb, index) => {\n return <React.Fragment key={breadcrumb.url + \"_\" + index}>\n {index > 0 && (\n <Typography variant={\"caption\"} color={\"secondary\"}>\n /\n </Typography>\n )}\n <Link\n key={index}\n className=\"visited:text-inherit dark:visited:text-inherit block\"\n to={breadcrumb.url}\n >\n <div className=\"flex flex-row items-center gap-2 whitespace-nowrap\">\n <Typography variant={\"body2\"}>\n {breadcrumb.title}\n </Typography>\n </div>\n </Link>\n </React.Fragment>;\n })}\n </div>\n </nav>\n </div>\n {startAdornment}\n\n {globalSearch}\n\n <div className={\"grow\"}/>\n\n {endAdornment &&\n <ErrorBoundary>\n {endAdornment}\n </ErrorBoundary>}\n\n {shellToolbar}\n\n {/* On a large layout the drawer is always on screen and carries\n this control; one per screen. */}\n {!(hasDrawer && largeLayout) && <RlsSimulatorBar/>}\n\n {includeLanguageToggle && <LanguageToggle/>}\n\n {includeModeToggle &&\n <Menu\n trigger={<IconButton\n aria-label=\"Toggle theme\"\n>\n {mode === \"dark\"\n ? <MoonIcon size={iconSize.small}/>\n : <SunIcon size={iconSize.small}/>}\n </IconButton>}>\n <MenuItem onClick={() => setMode(\"dark\")}><MoonIcon size={iconSize.smallest}/> {t(\"dark_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"light\")}><SunIcon size={iconSize.smallest}/> {t(\"light_mode\")} </MenuItem>\n <MenuItem onClick={() => setMode(\"system\")}> <SunMoonIcon\n size={iconSize.smallest}/>{t(\"system_mode\")}</MenuItem>\n </Menu>}\n\n\n {includeUserMenu &&\n <Menu trigger={<div aria-label=\"User menu\" role=\"button\">{avatarComponent}</div>}>\n {user && <div className={\"px-4 py-2 mb-2\"}>\n {user.displayName && <Typography variant={\"body1\"} color={\"secondary\"}>\n {user.displayName}\n </Typography>}\n {user.email && <Typography variant={\"body2\"} color={\"secondary\"}>\n {user.email}\n </Typography>}\n </div>}\n\n {dropDownActions}\n\n {!dropDownActions && <>\n <MenuItem onClick={() => navigate(\"/settings\")}>\n <SettingsIcon/>\n {t(\"account_settings\")}\n </MenuItem>\n <MenuItem onClick={async () => {\n await authController.signOut();\n // replace current route with home\n navigate(\"/\");\n }}>\n <LogOutIcon/>\n {t(\"log_out\")}\n </MenuItem>\n </>}\n\n </Menu>}\n\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkFA,IAAa,gBAAgB,SAAS,cAAc,EAChD,OACA,cACA,gBACA,iBACA,oBAAoB,MACpB,wBAAwB,MACxB,kBAAkB,MAClB,WACA,OACA,MAAM,UACN,MAAM,YACa;CAEnB,MAAM,EACF,WACA,YACA,MAAM,YACN,OAAO;CAEX,MAAM,OAAO,YAAY;CAEzB,MAAM,aAAa,iBAAiB;CAEpC,MAAM,cAAc,yBAAyB;CAE7C,MAAM,iBAAiB,kBAAkB;CACb,uBAAuB;CACnD,MAAM,EACF,MACA,YACA,kBAAkB;CAEtB,MAAM,WAAW,YAAY;CAE7B,MAAM,cAAc,eAAe;CAEnC,MAAM,OAAO,YAAY,eAAe;CACxC,MAAM,EAAE,MAAM,eAAe;CAM7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,YAAY,MAAM,eAAe,EAAE,SAAS,cAAc,IAAI,CAAC,aAAa,CAAC;CACnF,MAAM,eAAe,QAAQ,iBAAiB,SAAS;CACvD,MAAM,eAAe,QAAQ,iBAAiB,SAAS;CAEvD,IAAI;CAEJ,IAAI,MAAM;EACN,MAAM,UAAU,MAAM,cAChB,KAAK,YAAY,EAAE,CAAC,YAAY,IAC/B,MAAM,QAAQ,KAAK,MAAM,EAAE,CAAC,YAAY,IAAI;EACnD,kBAAkB,oBAAC,QAAD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qBAAA,UAAA,EAAA,UAAA,CACjB,qBAAC,UAAD;MAAU,eAAe,SAAS,WAAW;gBAA7C,CACI,oBAAC,cAAD,CAAc,CAAA,GACb,EAAE,kBAAkB,CACf;SACV,qBAAC,UAAD;MAAU,SAAS,YAAY;OAC3B,MAAM,eAAe,QAAQ;OAE7B,SAAS,GAAG;MAChB;gBAJA,CAKI,oBAAC,YAAD,CAAY,CAAA,GACX,EAAE,SAAS,CACN;OACZ,EAAA,CAAA;IAEA;;EAET;;AAEb"}
1
+ {"version":3,"file":"DefaultAppBar.js","names":[],"sources":["../../src/components/DefaultAppBar.tsx"],"sourcesContent":["\nimport React from \"react\";\n\nimport { Link, useNavigate } from \"react-router\";\nimport { RebaseLogo, LanguageToggle, RlsSimulatorBar } from \"@rebasepro/app\";\nimport { ErrorBoundary, iconSize } from \"@rebasepro/ui\";\nimport {\n Avatar,\n cls,\n IconButton,\n LogOutIcon,\n Menu,\n MenuItem,\n MoonIcon,\n SettingsIcon,\n Skeleton,\n SunIcon,\n SunMoonIcon,\n Typography\n} from \"@rebasepro/ui\";\nimport { useAuthController, useLargeLayout, useModeController, useAdminModeController, useTranslation, useRebaseContext, useSlot } from \"@rebasepro/app\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { User } from \"@rebasepro/types\";\nimport { useApp } from \"./app/useApp\";\nimport { useBreadcrumbsController } from \"../hooks/useBreadcrumbsController\";\nimport { UserSettingsView } from \"@rebasepro/app\";\n\nexport type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {\n\n /**\n * The content of the app bar, usually a title or logo. This includes a link to the home page.\n */\n title?: React.ReactNode;\n\n /**\n * A component that gets rendered on the upper side to the end of the main toolbar\n */\n endAdornment?: React.ReactNode;\n\n /**\n * A component that gets rendered on the upper side to the start of the main toolbar\n */\n startAdornment?: React.ReactNode;\n\n dropDownActions?: React.ReactNode;\n\n /**\n * Whether to render the dark/light/system mode toggle in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeModeToggle?: boolean;\n\n /**\n * Whether to render the language switcher in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeLanguageToggle?: boolean;\n\n /**\n * Whether to render the user avatar / menu in the app bar.\n * Set to `false` when the drawer owns this action.\n * @default true\n */\n includeUserMenu?: boolean;\n\n className?: string;\n\n style?: React.CSSProperties;\n\n logo?: string;\n\n /** The logo for the dark theme. Falls back to `logo`. */\n logoDark?: string;\n\n user?: User;\n} & ADDITIONAL_PROPS;\n\n/**\n * This component renders the main app bar of Rebase.\n * You will likely not need to use this component directly.\n *\n\n */\nexport const DefaultAppBar = function DefaultAppBar({\n title,\n endAdornment,\n startAdornment,\n dropDownActions,\n includeModeToggle = true,\n includeLanguageToggle = true,\n includeUserMenu = true,\n className,\n style,\n user: userProp,\n logo: logoProp,\n logoDark: logoDarkProp\n}: DefaultAppBarProps) {\n\n const {\n hasDrawer,\n drawerOpen,\n logo: appLogo,\n logoDark: appLogoDark\n } = useApp();\n\n const logo = logoProp ?? appLogo;\n const logoDark = logoProp ? logoDarkProp : (logoDarkProp ?? appLogoDark);\n\n const navigation = useUrlController();\n\n const breadcrumbs = useBreadcrumbsController();\n\n const authController = useAuthController();\n const adminModeController = useAdminModeController();\n const {\n mode,\n setMode\n } = useModeController();\n\n const navigate = useNavigate();\n\n const largeLayout = useLargeLayout();\n\n const user = userProp ?? authController.user;\n const { t } = useTranslation();\n\n // The two shell slots. Both take the context and nothing else, which is why\n // they are told apart by *where* they render rather than by their props: a\n // cross-collection search belongs beside the breadcrumbs, where a search\n // box goes, and a toolbar action belongs with the other actions at the end.\n const rebaseContext = useRebaseContext();\n const slotProps = React.useMemo(() => ({ context: rebaseContext }), [rebaseContext]);\n const globalSearch = useSlot(\"global.search\", slotProps);\n const shellToolbar = useSlot(\"shell.toolbar\", slotProps);\n\n let avatarComponent: React.ReactElement | null;\n\n if (user) {\n const initial = user?.displayName\n ? user.displayName[0].toUpperCase()\n : (user?.email ? user.email[0].toUpperCase() : \"A\");\n avatarComponent = <Avatar src={user.photoURL ?? undefined}>\n {initial}\n </Avatar>;\n } else if (user === undefined || authController.initialLoading) {\n avatarComponent = <div className={\"p-1 flex justify-center\"}>\n <Skeleton className={\"w-10 h-10 rounded-full\"}/>\n </div>;\n } else {\n avatarComponent = null;\n }\n\n\n return (\n <div\n style={style}\n role=\"banner\"\n className={cls(\"w-full h-14 transition-all ease-in duration-75 absolute top-0 max-w-full overflow-x-auto no-scrollbar\",\n \"flex flex-row gap-2 px-4 items-center\",\n \"backdrop-blur-sm bg-surface-frame/90\",\n {\n \"pl-[19rem]\": drawerOpen && largeLayout,\n \"pl-24\": hasDrawer && !(drawerOpen && largeLayout),\n \"z-10\": largeLayout,\n \"duration-100\": drawerOpen && largeLayout\n },\n className)}>\n\n {navigation && (!hasDrawer || title) && <div className=\"mr-2 hidden lg:block\">\n <Link\n className=\"visited:text-inherit dark:visited:text-inherit block\"\n to={navigation?.basePath ?? \"/\"}\n >\n <div className={\"flex flex-row gap-4\"}>\n {!hasDrawer && (logo\n // Written out rather than shared with the drawer: this\n // part stays copyable with package imports only. With\n // `logoDark`, the `dark` class on <html> picks the image.\n ? <>\n <img src={logo}\n alt=\"Logo\"\n className={cls(\"w-[32px] h-[32px] object-contain\", logoDark && \"dark:hidden\")}/>\n {logoDark && <img src={logoDark}\n alt=\"Logo\"\n className=\"w-[32px] h-[32px] object-contain hidden dark:block\"/>}\n </>\n : <RebaseLogo width={\"32px\"} height={\"32px\"}/>)}\n\n {typeof title === \"string\"\n ? <Typography variant=\"subtitle1\"\n noWrap>\n {title}\n </Typography>\n : title}\n </div>\n </Link>\n </div>}\n\n {/* Only when there are breadcrumbs. Rendered empty it still took\n its `mr-8` and a flex gap, pushing whatever the app put in\n `startAdornment` 40px right of where a title starts. */}\n {breadcrumbs.breadcrumbs.length > 0 && <div className=\"mr-8 hidden lg:block\">\n <nav aria-label=\"Breadcrumb\">\n <div className={\"flex flex-row gap-2 items-center\"}>\n {breadcrumbs.breadcrumbs.map((breadcrumb, index) => {\n return <React.Fragment key={breadcrumb.url + \"_\" + index}>\n {index > 0 && (\n <Typography variant={\"caption\"} color={\"secondary\"}>\n /\n </Typography>\n )}\n <Link\n key={index}\n className=\"visited:text-inherit dark:visited:text-inherit block\"\n to={breadcrumb.url}\n >\n <div className=\"flex flex-row items-center gap-2 whitespace-nowrap\">\n <Typography variant={\"body2\"}>\n {breadcrumb.title}\n </Typography>\n </div>\n </Link>\n </React.Fragment>;\n })}\n </div>\n </nav>\n </div>}\n {startAdornment}\n\n {globalSearch}\n\n <div className={\"grow\"}/>\n\n {endAdornment &&\n <ErrorBoundary>\n {endAdornment}\n </ErrorBoundary>}\n\n {shellToolbar}\n\n {/* On a large layout the drawer is always on screen and carries\n this control; one per screen. */}\n {!(hasDrawer && largeLayout) && <RlsSimulatorBar/>}\n\n {includeLanguageToggle && <LanguageToggle/>}\n\n {includeModeToggle &&\n <Menu\n trigger={<IconButton\n aria-label=\"Toggle theme\"\n>\n {mode === \"dark\"\n ? <MoonIcon size={iconSize.small}/>\n : <SunIcon size={iconSize.small}/>}\n </IconButton>}>\n <MenuItem onClick={() => setMode(\"dark\")}><MoonIcon size={iconSize.smallest}/> {t(\"dark_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"light\")}><SunIcon size={iconSize.smallest}/> {t(\"light_mode\")} </MenuItem>\n <MenuItem onClick={() => setMode(\"system\")}> <SunMoonIcon\n size={iconSize.smallest}/>{t(\"system_mode\")}</MenuItem>\n </Menu>}\n\n\n {includeUserMenu &&\n <Menu trigger={<div aria-label=\"User menu\" role=\"button\">{avatarComponent}</div>}>\n {user && <div className={\"px-4 py-2 mb-2\"}>\n {user.displayName && <Typography variant={\"body1\"} color={\"secondary\"}>\n {user.displayName}\n </Typography>}\n {user.email && <Typography variant={\"body2\"} color={\"secondary\"}>\n {user.email}\n </Typography>}\n </div>}\n\n {dropDownActions}\n\n {!dropDownActions && <>\n <MenuItem onClick={() => navigate(\"/settings\")}>\n <SettingsIcon/>\n {t(\"account_settings\")}\n </MenuItem>\n <MenuItem onClick={async () => {\n await authController.signOut();\n // replace current route with home\n navigate(\"/\");\n }}>\n <LogOutIcon/>\n {t(\"log_out\")}\n </MenuItem>\n </>}\n\n </Menu>}\n\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqFA,IAAa,gBAAgB,SAAS,cAAc,EAChD,OACA,cACA,gBACA,iBACA,oBAAoB,MACpB,wBAAwB,MACxB,kBAAkB,MAClB,WACA,OACA,MAAM,UACN,MAAM,UACN,UAAU,gBACS;CAEnB,MAAM,EACF,WACA,YACA,MAAM,SACN,UAAU,gBACV,OAAO;CAEX,MAAM,OAAO,YAAY;CACzB,MAAM,WAAW,WAAW,eAAgB,gBAAgB;CAE5D,MAAM,aAAa,iBAAiB;CAEpC,MAAM,cAAc,yBAAyB;CAE7C,MAAM,iBAAiB,kBAAkB;CACb,uBAAuB;CACnD,MAAM,EACF,MACA,YACA,kBAAkB;CAEtB,MAAM,WAAW,YAAY;CAE7B,MAAM,cAAc,eAAe;CAEnC,MAAM,OAAO,YAAY,eAAe;CACxC,MAAM,EAAE,MAAM,eAAe;CAM7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,YAAY,MAAM,eAAe,EAAE,SAAS,cAAc,IAAI,CAAC,aAAa,CAAC;CACnF,MAAM,eAAe,QAAQ,iBAAiB,SAAS;CACvD,MAAM,eAAe,QAAQ,iBAAiB,SAAS;CAEvD,IAAI;CAEJ,IAAI,MAAM;EACN,MAAM,UAAU,MAAM,cAChB,KAAK,YAAY,EAAE,CAAC,YAAY,IAC/B,MAAM,QAAQ,KAAK,MAAM,EAAE,CAAC,YAAY,IAAI;EACnD,kBAAkB,oBAAC,QAAD;GAAQ,KAAK,KAAK,YAAY,KAAA;aAC3C;EACG,CAAA;CACZ,OAAO,IAAI,SAAS,KAAA,KAAa,eAAe,gBAC5C,kBAAkB,oBAAC,OAAD;EAAK,WAAW;YAC9B,oBAAC,UAAD,E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AmB,qBAAA,UAAA,EAAA,UAAA,CACjB,qBAAC,UAAD;MAAU,eAAe,SAAS,WAAW;gBAA7C,CACI,oBAAC,cAAD,CAAc,CAAA,GACb,EAAE,kBAAkB,CACf;SACV,qBAAC,UAAD;MAAU,SAAS,YAAY;OAC3B,MAAM,eAAe,QAAQ;OAE7B,SAAS,GAAG;MAChB;gBAJA,CAKI,oBAAC,YAAD,CAAY,CAAA,GACX,EAAE,SAAS,CACN;OACZ,EAAA,CAAA;IAEA;;EAET;;AAEb"}
@@ -13,9 +13,11 @@ import React from "react";
13
13
  *
14
14
  * @group Core
15
15
  */
16
- export declare function DefaultDrawer({ title, logo, logoDestination, children, footerActions, className, style }: {
16
+ export declare function DefaultDrawer({ title, logo, logoDark, logoDestination, children, footerActions, className, style }: {
17
17
  title?: React.ReactNode;
18
18
  logo?: string;
19
+ /** The logo for the dark theme. Falls back to `logo`. */
20
+ logoDark?: string;
19
21
  logoDestination?: string;
20
22
  /**
21
23
  * Custom navigation content for the drawer.
@@ -34,8 +36,9 @@ export declare function DefaultDrawer({ title, logo, logoDestination, children,
34
36
  className?: string;
35
37
  style?: React.CSSProperties;
36
38
  }): React.JSX.Element;
37
- export declare function DrawerLogo({ logo, title, logoDestination, drawerOpen, drawerHovered }: {
39
+ export declare function DrawerLogo({ logo, logoDark, title, logoDestination, drawerOpen, drawerHovered }: {
38
40
  logo?: string;
41
+ logoDark?: string;
39
42
  title?: React.ReactNode;
40
43
  logoDestination?: string;
41
44
  drawerOpen: boolean;
@@ -3,6 +3,7 @@ import { useUrlController } from "../hooks/navigation/contexts/UrlContext.js";
3
3
  import { useApp } from "./app/useApp.js";
4
4
  import { DrawerExpansionContext, useDrawerExpansion } from "./drawer_expansion.js";
5
5
  import { DrawerNavigationGroup } from "./DrawerNavigationGroup.js";
6
+ import { BrandLogo } from "./BrandLogo.js";
6
7
  import React, { useCallback, useMemo } from "react";
7
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
9
  import { Avatar, ChevronsLeftIcon, ChevronsRightIcon, IconButton, LogOutIcon, Menu, MenuItem, MoonIcon, SettingsIcon, Skeleton, SunIcon, SunMoonIcon, ToggleButtonGroup, Tooltip, Typography, cls, iconSize } from "@rebasepro/ui";
@@ -24,9 +25,10 @@ import { Link, useNavigate } from "react-router";
24
25
  *
25
26
  * @group Core
26
27
  */
27
- function DefaultDrawer({ title, logo, logoDestination, children, footerActions, className, style }) {
28
- const { drawerHovered, drawerOpen, openDrawer, closeDrawer, logo: appLogo } = useApp();
28
+ function DefaultDrawer({ title, logo, logoDark, logoDestination, children, footerActions, className, style }) {
29
+ const { drawerHovered, drawerOpen, openDrawer, closeDrawer, logo: appLogo, logoDark: appLogoDark } = useApp();
29
30
  const resolvedLogo = logo ?? appLogo;
31
+ const resolvedLogoDark = logo ? logoDark : logoDark ?? appLogoDark;
30
32
  const scrollRef = React.useRef(null);
31
33
  const [scrolled, setScrolled] = React.useState(false);
32
34
  const expanded = drawerOpen || drawerHovered;
@@ -43,6 +45,7 @@ function DefaultDrawer({ title, logo, logoDestination, children, footerActions,
43
45
  children: [
44
46
  /* @__PURE__ */ jsx(DrawerLogo, {
45
47
  logo: resolvedLogo,
48
+ logoDark: resolvedLogoDark,
46
49
  title,
47
50
  logoDestination,
48
51
  drawerOpen,
@@ -149,7 +152,7 @@ function AdminNavigationContent() {
149
152
  footerSlot
150
153
  ] });
151
154
  }
152
- function DrawerLogo({ logo, title, logoDestination = "/", drawerOpen, drawerHovered }) {
155
+ function DrawerLogo({ logo, logoDark, title, logoDestination = "/", drawerOpen, drawerHovered }) {
153
156
  const showFullContent = drawerOpen || drawerHovered;
154
157
  const { t } = useTranslation();
155
158
  return /* @__PURE__ */ jsxs("div", {
@@ -158,9 +161,9 @@ function DrawerLogo({ logo, title, logoDestination = "/", drawerOpen, drawerHove
158
161
  className: "shrink-0 flex items-center justify-center w-[56px] h-[40px]",
159
162
  to: logoDestination,
160
163
  "aria-label": t("home", { defaultValue: "Home" }),
161
- children: logo ? /* @__PURE__ */ jsx("img", {
162
- src: logo,
163
- alt: "Logo",
164
+ children: logo ? /* @__PURE__ */ jsx(BrandLogo, {
165
+ logo,
166
+ logoDark,
164
167
  className: "w-[28px] h-[28px] object-contain"
165
168
  }) : /* @__PURE__ */ jsx(RebaseLogo, {
166
169
  width: "28px",
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultDrawer.js","names":[],"sources":["../../src/components/DefaultDrawer.tsx"],"sourcesContent":["import type { NavigationEntry, NavigationResult } from \"@rebasepro/cms-types\";\nimport React, { useCallback, useMemo } from \"react\";\n\nimport { useCollapsedGroups, buildCollapsedDefaults, useLargeLayout, useAdminModeController, useAuthController, useModeController, useTranslation, useSlot, useRebaseContext, useAnalyticsController, useRebaseRegistry, useComponentOverride } from \"@rebasepro/app\";\nimport type { AdminModeController } from \"@rebasepro/app\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { useNavigationStateController } from \"../hooks/navigation/contexts/NavigationStateContext\";\n\n\nimport { Link, useNavigate } from \"react-router\";\nimport { AnalyticsEvent, studioSchemaToolEnabled } from \"@rebasepro/cms-types\";\nimport {\n Avatar,\n ChevronsLeftIcon,\n ChevronsRightIcon,\n cls,\n iconSize,\n IconButton,\n LanguagesIcon,\n LogOutIcon,\n Menu,\n MenuItem,\n MoonIcon,\n Separator,\n SettingsIcon,\n Skeleton,\n SunIcon,\n SunMoonIcon,\n ToggleButtonGroup,\n Tooltip,\n Typography\n} from \"@rebasepro/ui\";\nimport { DrawerNavigationGroup } from \"./DrawerNavigationGroup\";\nimport { DrawerExpansionContext, useDrawerExpansion } from \"./drawer_expansion\";\nimport { LanguageToggle, RebaseLogo, RlsSimulatorBar, useCanSimulateAccess } from \"@rebasepro/app\";\nimport { useApp } from \"./app/useApp\";\n\n/**\n * Default drawer used in the admin.\n *\n * When no `children` are provided, renders the full admin navigation\n * (collection groups, mode switch, plugin slots).\n *\n * When `children` **are** provided, renders the shared drawer shell\n * (logo, scrollable area, footer actions, collapse toggle) with the\n * custom content injected in the scrollable area. This lets consumers\n * like the SaaS dashboard reuse the identical structural layout while\n * supplying their own navigation items.\n *\n * @group Core\n */\nexport function DefaultDrawer({\n title,\n logo,\n logoDestination,\n children,\n footerActions,\n className,\n style\n}: {\n title?: React.ReactNode;\n logo?: string;\n logoDestination?: string;\n /**\n * Custom navigation content for the drawer.\n * When provided, replaces the default admin navigation (collection groups,\n * mode switch, slots). The shared shell (logo, scroll area, footer\n * actions, collapse toggle) is still rendered around it.\n */\n children?: React.ReactNode;\n /**\n * Custom content for the drawer footer actions area (language, theme, user menu).\n * - `undefined` — renders the default `DrawerFooterActions`.\n * - `null` — renders nothing (hides the footer actions).\n * - `ReactNode` — renders the provided custom content.\n */\n footerActions?: React.ReactNode | null;\n className?: string;\n style?: React.CSSProperties;\n}) {\n\n const {\n drawerHovered,\n drawerOpen,\n openDrawer,\n closeDrawer,\n logo: appLogo\n } = useApp();\n\n const resolvedLogo = logo ?? appLogo;\n\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const [scrolled, setScrolled] = React.useState(false);\n\n // Open, pinned or floating under the pointer. The rows read it from the\n // `data-expanded` attribute (through CSS) and the expansion store, not as a\n // prop, so the rail opening under the pointer re-renders none of them.\n const expanded = drawerOpen || drawerHovered;\n const expansion = useDrawerExpansion(expanded);\n\n const handleScroll = () => {\n if (scrollRef.current) {\n setScrolled(scrollRef.current.scrollTop > 0);\n }\n };\n\n return (\n <div role=\"navigation\" aria-label=\"Main navigation\"\n data-expanded={expanded}\n className={cls(\"group/drawer flex flex-col h-full relative grow w-full\", className)} style={style}>\n\n <DrawerLogo\n logo={resolvedLogo}\n title={title}\n logoDestination={logoDestination}\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n />\n\n <div\n ref={scrollRef}\n onScroll={handleScroll}\n className={\"flex-grow min-h-0 overflow-y-auto overflow-x-hidden no-scrollbar px-2\"}\n style={{\n maskImage: scrolled\n ? \"linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 20px), transparent 100%)\"\n : \"linear-gradient(to bottom, black 0, black calc(100% - 20px), transparent 100%)\"\n }}>\n <DrawerExpansionContext.Provider value={expansion}>\n {children ?? <AdminNavigationContent />}\n </DrawerExpansionContext.Provider>\n </div>\n\n {footerActions !== null && (\n footerActions !== undefined\n ? footerActions\n : <DrawerFooterActions\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n />\n )}\n\n <DrawerToggle\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n openDrawer={openDrawer}\n closeDrawer={closeDrawer}\n />\n </div>\n );\n}\n\n/**\n * Default admin navigation content — rendered inside DefaultDrawer when no\n * custom `children` are provided. Contains the mode switch, navigation\n * groups, and header / footer plugin slots.\n */\nfunction AdminNavigationContent() {\n\n const {\n drawerHovered,\n drawerOpen,\n closeDrawer,\n closeHover\n } = useApp();\n\n const analyticsController = useAnalyticsController();\n const navigationState = useNavigationStateController();\n const context = useRebaseContext();\n\n const largeLayout = useLargeLayout();\n const adminModeController = useAdminModeController();\n const registry = useRebaseRegistry();\n const ResolvedDrawerNavigationGroup = useComponentOverride(\"Shell.DrawerNavigationGroup\", DrawerNavigationGroup);\n\n const allNavigationEntries = navigationState.topLevelNavigation?.navigationEntries ?? [];\n\n // Build a set of Studio-only dev view slugs so we can distinguish them from\n // admin custom views added via <RebaseCMS views={...}> or plugins.\n const studioViewSlugs = useMemo(() => {\n const slugs = new Set<string>();\n (registry.studioConfig?.devViews ?? []).forEach(v => slugs.add(v.slug));\n // The schema view is also a Studio dev view (auto-injected when collectionEditor is enabled)\n if (studioSchemaToolEnabled(registry)) slugs.add(\"schema\");\n return slugs;\n }, [registry]);\n\n // Studio mode shows Studio dev views + admin entries (Users/Roles).\n // Content mode shows collections, admin custom views, and admin entries — but not Studio dev views.\n const filteredEntries = adminModeController.mode === \"studio\"\n ? allNavigationEntries.filter(e => (e.type === \"view\" && studioViewSlugs.has(e.slug)) || e.type === \"admin\")\n : allNavigationEntries.filter(e => e.type !== \"view\" || !studioViewSlugs.has(e.slug));\n\n // Derive groups from the filtered entries, preserving the order from topLevelNavigation.groups\n const entryGroups = new Set(filteredEntries.map(e => e.group).filter(Boolean));\n const orderedGroups = navigationState.topLevelNavigation?.groups ?? [];\n const groupsToRender = [\n ...orderedGroups.filter(g => entryGroups.has(g)),\n ...[...entryGroups].filter(g => !orderedGroups.includes(g))\n ];\n\n // Group header icons, declared on `navigationGroupMappings`. Keyed by name\n // because that is what a navigation entry's `group` holds.\n const groupIcons = useMemo(() => {\n const icons = new Map<string, string>();\n (registry.cmsConfig?.navigationGroupMappings ?? []).forEach(mapping => {\n if (mapping.icon) icons.set(mapping.name, mapping.icon);\n });\n return icons;\n }, [registry.cmsConfig?.navigationGroupMappings]);\n\n // Collapsible groups state - using \"drawer\" namespace for independent state from home page\n const collapsedDefaults = useMemo(\n () => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, \"drawer\"),\n [registry.cmsConfig?.navigationGroupMappings]\n );\n const { isGroupCollapsed, toggleGroupCollapsed } = useCollapsedGroups(groupsToRender, \"drawer\", collapsedDefaults);\n\n const headerSlot = useSlot(\"navigation.header\", { drawerOpen,\ndrawerHovered,\ncontext });\n const footerSlot = useSlot(\"navigation.footer\", { drawerOpen,\ndrawerHovered,\ncontext });\n\n // The same handler across a hover: every row is handed it.\n const onItemClick = useCallback((view: NavigationEntry) => {\n const eventName: AnalyticsEvent = view.type === \"collection\"\n ? \"drawer_navigate_to_collection\"\n : (view.type === \"view\" ? \"drawer_navigate_to_view\" : \"unmapped_event\");\n analyticsController.onAnalyticsEvent?.(eventName, { url: view.url });\n if (!largeLayout) {\n closeDrawer();\n } else if (!drawerOpen) {\n closeHover();\n }\n }, [analyticsController, largeLayout, drawerOpen, closeDrawer, closeHover]);\n\n if (!navigationState.topLevelNavigation)\n return null;\n\n const drawerVisuallyOpen = drawerOpen || drawerHovered;\n\n return (\n <>\n {registry.studioConfig && (\n <DrawerModeSwitch\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n />\n )}\n\n {headerSlot}\n\n {groupsToRender.map((group) => {\n const entriesInGroup = filteredEntries.filter(e => e.group === group);\n return (\n <ResolvedDrawerNavigationGroup\n key={`drawer_group_${group}`}\n group={group}\n entries={entriesInGroup}\n collapsed={isGroupCollapsed(group)}\n onToggleCollapsed={() => toggleGroupCollapsed(group)}\n drawerOpen={drawerVisuallyOpen}\n onItemClick={onItemClick}\n icon={groupIcons.get(group)}\n />\n );\n })}\n\n {footerSlot}\n </>\n );\n}\n\nexport function DrawerLogo({\n logo,\n title,\n logoDestination = \"/\",\n drawerOpen,\n drawerHovered\n}: {\n logo?: string;\n title?: React.ReactNode;\n logoDestination?: string;\n drawerOpen: boolean;\n drawerHovered: boolean;\n}) {\n\n const showFullContent = drawerOpen || drawerHovered;\n const { t } = useTranslation();\n\n return (\n <div className=\"flex flex-row items-center shrink-0 pt-4 pb-0 px-2\">\n {/* Logo — always visible */}\n {/* Named explicitly because neither branch below carries text: the\n stock `RebaseLogo` is a bare <svg> with no <title>, and a custom\n `logo` only ever gets the generic alt \"Logo\", which names the image\n rather than saying where the link goes. The title link beside it is\n no help either — it renders only when a `title` is set. */}\n <Link\n className=\"shrink-0 flex items-center justify-center w-[56px] h-[40px]\"\n to={logoDestination}\n aria-label={t(\"home\", { defaultValue: \"Home\" })}\n >\n {logo\n ? <img src={logo} alt=\"Logo\" className=\"w-[28px] h-[28px] object-contain\"/>\n : <RebaseLogo width=\"28px\" height=\"28px\"/>\n }\n </Link>\n\n {/* Title (fades in when expanded or hovered) */}\n <div\n className={cls(\n \"flex flex-row items-center overflow-hidden transition-all duration-200 ease-in-out\",\n showFullContent ? \"opacity-100 w-full ml-1\" : \"opacity-0 w-0 ml-0\"\n )}\n >\n {title && (\n <Link\n className=\"visited:text-inherit dark:visited:text-inherit block truncate\"\n to={logoDestination}\n >\n {typeof title === \"string\"\n ? <Typography variant=\"subtitle1\" noWrap className=\"truncate\">{title}</Typography>\n : title\n }\n </Link>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Toggle button at the bottom of the drawer.\n * Uses double-chevron icons to indicate collapse/expand direction.\n */\nexport function DrawerToggle({\n drawerOpen,\n drawerHovered,\n openDrawer,\n closeDrawer\n}: {\n drawerOpen: boolean;\n drawerHovered: boolean;\n openDrawer: () => void;\n closeDrawer: () => void;\n}) {\n const isExpanded = drawerOpen;\n const isHovered = drawerHovered && !drawerOpen;\n const showFullContent = isExpanded || isHovered;\n\n const [wantsTooltip, setWantsTooltip] = React.useState(false);\n // See {@link DrawerNavigationItem}: a masked tooltip never hears the pointer\n // leave, so the stale state is dropped as the mask goes on.\n if (showFullContent && wantsTooltip) setWantsTooltip(false);\n\n const { t } = useTranslation();\n\n return (\n <div className=\"shrink-0 mt-auto px-4 pt-0.5 pb-2\">\n <Tooltip\n title={isExpanded ? t(\"collapse\") : t(\"expand\")}\n // The row spells out \"Collapse\"/\"Expand\" itself whenever it is wide\n // enough to show the label — expanded, or floating open under the\n // pointer. A tooltip repeating that word is noise; it earns its\n // place only on a bare rail, where the chevron stands alone.\n //\n // Masked, not withheld: see {@link DrawerNavigationItem} for why\n // this stays controlled in both states.\n open={!showFullContent && wantsTooltip}\n onOpenChange={setWantsTooltip}\n side=\"right\"\n sideOffset={12}\n asChild={true}\n >\n <button\n type=\"button\"\n className={cls(\n \"flex flex-row items-center rounded-lg cursor-pointer w-full\",\n \"hover:bg-surface-hover\",\n \"transition-colors duration-150\",\n \"py-2\"\n )}\n aria-expanded={isExpanded}\n aria-label={isExpanded ? t(\"collapse\") : t(\"expand\")}\n onClick={() => isExpanded ? closeDrawer() : openDrawer()}\n >\n {/* 44px in both states, on the same grid as the rows above and\n for the same reason: the rail floats open under the pointer,\n and a slot that changed width with it walked the chevron\n sideways on hover. See the note in DrawerNavigationItem. */}\n <div className=\"shrink-0 flex items-center justify-center w-[44px] h-[24px] text-surface-500 dark:text-surface-400\">\n {isExpanded\n ? <ChevronsLeftIcon size={iconSize.small}/>\n : <ChevronsRightIcon size={iconSize.small}/>\n }\n </div>\n <div className={cls(\n \"overflow-hidden transition-all duration-200 ease-in-out\",\n showFullContent ? \"opacity-100 w-auto\" : \"opacity-0 w-0\"\n )}>\n <Typography\n variant=\"body2\"\n className=\"text-surface-500 dark:text-surface-400 select-none whitespace-nowrap\"\n >\n {isExpanded ? t(\"collapse\") : t(\"expand\")}\n </Typography>\n </div>\n </button>\n </Tooltip>\n </div>\n );\n}\n\n/**\n * Segmented Content / Studio switch rendered inside the drawer.\n * Animates in/out with the drawer open state via opacity + max-height.\n */\nfunction DrawerModeSwitch({\n drawerOpen,\n drawerHovered\n}: {\n drawerOpen: boolean;\n drawerHovered: boolean;\n}) {\n const adminModeController = useAdminModeController();\n const urlController = useUrlController();\n const navigate = useNavigate();\n const { t } = useTranslation();\n const showSwitch = drawerOpen || drawerHovered;\n\n return (\n <div\n // Hidden by opacity so it can fade with the rail; `inert` takes it\n // out of the tab order and the accessibility tree while it is.\n inert={!showSwitch}\n className={cls(\n \"shrink-0 overflow-hidden transition-all duration-200 ease-in-out px-3 h-8 mt-2 mb-0\",\n showSwitch ? \"opacity-100\" : \"opacity-0 pointer-events-none\"\n )}\n >\n <ToggleButtonGroup<AdminModeController[\"mode\"]>\n fullWidth\n aria-label={t(\"panel_mode\")}\n value={adminModeController.mode}\n onValueChange={(mode) => {\n adminModeController.setMode(mode);\n if (mode === \"cms\") navigate(urlController.basePath ?? \"/\");\n else navigate(urlController.basePath === \"/\" ? \"/s\" : `${urlController.basePath ?? \"\"}/s`);\n }}\n options={[\n { value: \"cms\", label: \"CMS\" },\n { value: \"studio\", label: \"Studio\" }\n ]}\n />\n </div>\n );\n}\n\n/**\n * Footer actions rendered at the bottom of the drawer, above the collapse/expand toggle.\n * Replaces the app bar icons (language, theme, user avatar) with a drawer-native layout\n * that adapts between collapsed (icons only) and expanded (full labels + user bar) states.\n *\n * @group Core\n */\nexport function DrawerFooterActions({\n drawerOpen,\n drawerHovered,\n /**\n * Custom content to render inside the user dropdown menu.\n * When provided, these items are appended after the user info header\n * and before the default Sign Out item.\n */\n dropDownActions,\n /**\n * Override the user object displayed in the footer.\n * When omitted, falls back to `authController.user`.\n */\n user: userProp\n}: {\n drawerOpen: boolean;\n drawerHovered: boolean;\n dropDownActions?: React.ReactNode;\n user?: import(\"@rebasepro/types\").User;\n}) {\n const authController = useAuthController();\n const {\n mode,\n setMode\n } = useModeController();\n const navigate = useNavigate();\n const { t } = useTranslation();\n\n const user = userProp ?? authController.user;\n const showFullContent = drawerOpen || drawerHovered;\n const isFloating = drawerHovered && !drawerOpen;\n const portalRef = React.useRef<HTMLDivElement>(null);\n const canSimulateAccess = useCanSimulateAccess();\n\n // User avatar\n let avatarComponent: React.ReactElement | null;\n if (user) {\n const initial = user?.displayName\n ? user.displayName[0].toUpperCase()\n : (user?.email ? user.email[0].toUpperCase() : \"A\");\n avatarComponent = <Avatar src={user.photoURL ?? undefined} className=\"w-8 h-8 text-xs\">\n {initial}\n </Avatar>;\n } else if (user === undefined || authController.initialLoading) {\n avatarComponent = <Skeleton className=\"w-8 h-8 rounded-full\"/>;\n } else {\n avatarComponent = null;\n }\n\n return (\n <div className=\"shrink-0 pt-2 pb-0\" ref={portalRef}>\n {/* The RLS simulator: an icon on the collapsed rail, the pill when expanded. */}\n {canSimulateAccess && (\n <div className=\"flex items-center px-[16px] py-1\">\n {/* The avatar's 44px column, so the icon lines up with it. */}\n <div className={cls(\"flex\", { \"w-[44px] justify-center\": !showFullContent })}>\n <RlsSimulatorBar\n compact={!showFullContent}\n side=\"right\"\n align=\"end\"\n portalContainer={portalRef.current}/>\n </div>\n </div>\n )}\n {avatarComponent && (\n <div className=\"flex items-center px-[16px] py-1\">\n <Menu\n trigger={\n <div\n className={cls(\n // Same 44px grid, and fixed across both states for\n // the same reason — see DrawerNavigationItem.\n \"shrink-0 flex items-center justify-center w-[44px] cursor-pointer\",\n \"rounded-md py-1\",\n \"hover:bg-surface-hover\",\n \"transition-colors duration-150\"\n )}\n role=\"button\"\n tabIndex={0}\n aria-label={t(\"user_menu\", { defaultValue: \"User menu\" })}\n >\n {avatarComponent}\n </div>\n }\n side=\"top\"\n align=\"start\"\n >\n {user && <div className=\"px-4 py-2 mb-1\">\n {user.displayName && <Typography variant=\"body1\" color=\"secondary\">\n {user.displayName}\n </Typography>}\n {user.email && <Typography variant=\"body2\" color=\"secondary\">\n {user.email}\n </Typography>}\n </div>}\n\n {dropDownActions}\n\n {!dropDownActions && <>\n <MenuItem onClick={() => navigate(\"/settings\")}>\n <SettingsIcon/>\n {t(\"account_settings\")}\n </MenuItem>\n <MenuItem onClick={async () => {\n await authController.signOut();\n navigate(\"/\");\n }}>\n <LogOutIcon/>\n {t(\"log_out\")}\n </MenuItem>\n </>}\n </Menu>\n\n {/* Language + Theme — only when expanded */}\n {showFullContent && (\n <div className=\"flex items-center gap-0\">\n <LanguageToggle/>\n <Menu\n trigger={\n <IconButton\n aria-label={t(\"toggle_theme\", { defaultValue: \"Toggle theme\" })}\n className=\"text-surface-500 dark:text-surface-400\"\n >\n {mode === \"dark\"\n ? <MoonIcon size={iconSize.small}/>\n : mode === \"light\"\n ? <SunIcon size={iconSize.small}/>\n : <SunMoonIcon size={iconSize.small}/>}\n </IconButton>\n }\n portalContainer={portalRef.current}\n side=\"top\"\n >\n <MenuItem onClick={() => setMode(\"dark\")}><MoonIcon size={iconSize.smallest}/> {t(\"dark_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"light\")}><SunIcon size={iconSize.smallest}/> {t(\"light_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"system\")}><SunMoonIcon size={iconSize.smallest}/> {t(\"system_mode\")}</MenuItem>\n </Menu>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgB,cAAc,EAC1B,OACA,MACA,iBACA,UACA,eACA,WACA,SAqBD;CAEC,MAAM,EACF,eACA,YACA,YACA,aACA,MAAM,YACN,OAAO;CAE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oBAAC,aAAD,EAAa,MAAM,SAAS,MAAO,CAAA;KACrC,CAAA;KAEhB,iBAAiB,UAAU;KAC3B,MAAK;eAdT;MAgBI,qBAAC,UAAD;OAAU,eAAe,QAAQ,MAAM;iBAAvC;QAA0C,oBAAC,UAAD,EAAU,MAAM,SAAS,SAAU,CAAA;QAAC;QAAE,EAAE,WAAW;OAAY;;MACzG,qBAAC,UAAD;OAAU,eAAe,QAAQ,OAAO;iBAAxC;QAA2C,oBAAC,SAAD,EAAS,MAAM,SAAS,SAAU,CAAA;QAAC;QAAE,EAAE,YAAY;OAAY;;MAC1G,qBAAC,UAAD;OAAU,eAAe,QAAQ,QAAQ;iBAAzC;QAA4C,oBAAC,aAAD,EAAa,MAAM,SAAS,SAAU,CAAA;QAAC;QAAE,EAAE,aAAa;OAAY;;KAC9G;MACL;KAER;IAER;;AAEb"}
1
+ {"version":3,"file":"DefaultDrawer.js","names":[],"sources":["../../src/components/DefaultDrawer.tsx"],"sourcesContent":["import type { NavigationEntry, NavigationResult } from \"@rebasepro/cms-types\";\nimport React, { useCallback, useMemo } from \"react\";\n\nimport { useCollapsedGroups, buildCollapsedDefaults, useLargeLayout, useAdminModeController, useAuthController, useModeController, useTranslation, useSlot, useRebaseContext, useAnalyticsController, useRebaseRegistry, useComponentOverride } from \"@rebasepro/app\";\nimport type { AdminModeController } from \"@rebasepro/app\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { useNavigationStateController } from \"../hooks/navigation/contexts/NavigationStateContext\";\n\n\nimport { Link, useNavigate } from \"react-router\";\nimport { AnalyticsEvent, studioSchemaToolEnabled } from \"@rebasepro/cms-types\";\nimport {\n Avatar,\n ChevronsLeftIcon,\n ChevronsRightIcon,\n cls,\n iconSize,\n IconButton,\n LanguagesIcon,\n LogOutIcon,\n Menu,\n MenuItem,\n MoonIcon,\n Separator,\n SettingsIcon,\n Skeleton,\n SunIcon,\n SunMoonIcon,\n ToggleButtonGroup,\n Tooltip,\n Typography\n} from \"@rebasepro/ui\";\nimport { DrawerNavigationGroup } from \"./DrawerNavigationGroup\";\nimport { DrawerExpansionContext, useDrawerExpansion } from \"./drawer_expansion\";\nimport { LanguageToggle, RebaseLogo, RlsSimulatorBar, useCanSimulateAccess } from \"@rebasepro/app\";\nimport { useApp } from \"./app/useApp\";\nimport { BrandLogo } from \"./BrandLogo\";\n\n/**\n * Default drawer used in the admin.\n *\n * When no `children` are provided, renders the full admin navigation\n * (collection groups, mode switch, plugin slots).\n *\n * When `children` **are** provided, renders the shared drawer shell\n * (logo, scrollable area, footer actions, collapse toggle) with the\n * custom content injected in the scrollable area. This lets consumers\n * like the SaaS dashboard reuse the identical structural layout while\n * supplying their own navigation items.\n *\n * @group Core\n */\nexport function DefaultDrawer({\n title,\n logo,\n logoDark,\n logoDestination,\n children,\n footerActions,\n className,\n style\n}: {\n title?: React.ReactNode;\n logo?: string;\n /** The logo for the dark theme. Falls back to `logo`. */\n logoDark?: string;\n logoDestination?: string;\n /**\n * Custom navigation content for the drawer.\n * When provided, replaces the default admin navigation (collection groups,\n * mode switch, slots). The shared shell (logo, scroll area, footer\n * actions, collapse toggle) is still rendered around it.\n */\n children?: React.ReactNode;\n /**\n * Custom content for the drawer footer actions area (language, theme, user menu).\n * - `undefined` — renders the default `DrawerFooterActions`.\n * - `null` — renders nothing (hides the footer actions).\n * - `ReactNode` — renders the provided custom content.\n */\n footerActions?: React.ReactNode | null;\n className?: string;\n style?: React.CSSProperties;\n}) {\n\n const {\n drawerHovered,\n drawerOpen,\n openDrawer,\n closeDrawer,\n logo: appLogo,\n logoDark: appLogoDark\n } = useApp();\n\n // A drawer given its own `logo` does not borrow the app's dark variant:\n // that one was drawn for a different image.\n const resolvedLogo = logo ?? appLogo;\n const resolvedLogoDark = logo ? logoDark : (logoDark ?? appLogoDark);\n\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const [scrolled, setScrolled] = React.useState(false);\n\n // Open, pinned or floating under the pointer. The rows read it from the\n // `data-expanded` attribute (through CSS) and the expansion store, not as a\n // prop, so the rail opening under the pointer re-renders none of them.\n const expanded = drawerOpen || drawerHovered;\n const expansion = useDrawerExpansion(expanded);\n\n const handleScroll = () => {\n if (scrollRef.current) {\n setScrolled(scrollRef.current.scrollTop > 0);\n }\n };\n\n return (\n <div role=\"navigation\" aria-label=\"Main navigation\"\n data-expanded={expanded}\n className={cls(\"group/drawer flex flex-col h-full relative grow w-full\", className)} style={style}>\n\n <DrawerLogo\n logo={resolvedLogo}\n logoDark={resolvedLogoDark}\n title={title}\n logoDestination={logoDestination}\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n />\n\n <div\n ref={scrollRef}\n onScroll={handleScroll}\n className={\"flex-grow min-h-0 overflow-y-auto overflow-x-hidden no-scrollbar px-2\"}\n style={{\n maskImage: scrolled\n ? \"linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 20px), transparent 100%)\"\n : \"linear-gradient(to bottom, black 0, black calc(100% - 20px), transparent 100%)\"\n }}>\n <DrawerExpansionContext.Provider value={expansion}>\n {children ?? <AdminNavigationContent />}\n </DrawerExpansionContext.Provider>\n </div>\n\n {footerActions !== null && (\n footerActions !== undefined\n ? footerActions\n : <DrawerFooterActions\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n />\n )}\n\n <DrawerToggle\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n openDrawer={openDrawer}\n closeDrawer={closeDrawer}\n />\n </div>\n );\n}\n\n/**\n * Default admin navigation content — rendered inside DefaultDrawer when no\n * custom `children` are provided. Contains the mode switch, navigation\n * groups, and header / footer plugin slots.\n */\nfunction AdminNavigationContent() {\n\n const {\n drawerHovered,\n drawerOpen,\n closeDrawer,\n closeHover\n } = useApp();\n\n const analyticsController = useAnalyticsController();\n const navigationState = useNavigationStateController();\n const context = useRebaseContext();\n\n const largeLayout = useLargeLayout();\n const adminModeController = useAdminModeController();\n const registry = useRebaseRegistry();\n const ResolvedDrawerNavigationGroup = useComponentOverride(\"Shell.DrawerNavigationGroup\", DrawerNavigationGroup);\n\n const allNavigationEntries = navigationState.topLevelNavigation?.navigationEntries ?? [];\n\n // Build a set of Studio-only dev view slugs so we can distinguish them from\n // admin custom views added via <RebaseCMS views={...}> or plugins.\n const studioViewSlugs = useMemo(() => {\n const slugs = new Set<string>();\n (registry.studioConfig?.devViews ?? []).forEach(v => slugs.add(v.slug));\n // The schema view is also a Studio dev view (auto-injected when collectionEditor is enabled)\n if (studioSchemaToolEnabled(registry)) slugs.add(\"schema\");\n return slugs;\n }, [registry]);\n\n // Studio mode shows Studio dev views + admin entries (Users/Roles).\n // Content mode shows collections, admin custom views, and admin entries — but not Studio dev views.\n const filteredEntries = adminModeController.mode === \"studio\"\n ? allNavigationEntries.filter(e => (e.type === \"view\" && studioViewSlugs.has(e.slug)) || e.type === \"admin\")\n : allNavigationEntries.filter(e => e.type !== \"view\" || !studioViewSlugs.has(e.slug));\n\n // Derive groups from the filtered entries, preserving the order from topLevelNavigation.groups\n const entryGroups = new Set(filteredEntries.map(e => e.group).filter(Boolean));\n const orderedGroups = navigationState.topLevelNavigation?.groups ?? [];\n const groupsToRender = [\n ...orderedGroups.filter(g => entryGroups.has(g)),\n ...[...entryGroups].filter(g => !orderedGroups.includes(g))\n ];\n\n // Group header icons, declared on `navigationGroupMappings`. Keyed by name\n // because that is what a navigation entry's `group` holds.\n const groupIcons = useMemo(() => {\n const icons = new Map<string, string>();\n (registry.cmsConfig?.navigationGroupMappings ?? []).forEach(mapping => {\n if (mapping.icon) icons.set(mapping.name, mapping.icon);\n });\n return icons;\n }, [registry.cmsConfig?.navigationGroupMappings]);\n\n // Collapsible groups state - using \"drawer\" namespace for independent state from home page\n const collapsedDefaults = useMemo(\n () => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, \"drawer\"),\n [registry.cmsConfig?.navigationGroupMappings]\n );\n const { isGroupCollapsed, toggleGroupCollapsed } = useCollapsedGroups(groupsToRender, \"drawer\", collapsedDefaults);\n\n const headerSlot = useSlot(\"navigation.header\", { drawerOpen,\ndrawerHovered,\ncontext });\n const footerSlot = useSlot(\"navigation.footer\", { drawerOpen,\ndrawerHovered,\ncontext });\n\n // The same handler across a hover: every row is handed it.\n const onItemClick = useCallback((view: NavigationEntry) => {\n const eventName: AnalyticsEvent = view.type === \"collection\"\n ? \"drawer_navigate_to_collection\"\n : (view.type === \"view\" ? \"drawer_navigate_to_view\" : \"unmapped_event\");\n analyticsController.onAnalyticsEvent?.(eventName, { url: view.url });\n if (!largeLayout) {\n closeDrawer();\n } else if (!drawerOpen) {\n closeHover();\n }\n }, [analyticsController, largeLayout, drawerOpen, closeDrawer, closeHover]);\n\n if (!navigationState.topLevelNavigation)\n return null;\n\n const drawerVisuallyOpen = drawerOpen || drawerHovered;\n\n return (\n <>\n {registry.studioConfig && (\n <DrawerModeSwitch\n drawerOpen={drawerOpen}\n drawerHovered={drawerHovered}\n />\n )}\n\n {headerSlot}\n\n {groupsToRender.map((group) => {\n const entriesInGroup = filteredEntries.filter(e => e.group === group);\n return (\n <ResolvedDrawerNavigationGroup\n key={`drawer_group_${group}`}\n group={group}\n entries={entriesInGroup}\n collapsed={isGroupCollapsed(group)}\n onToggleCollapsed={() => toggleGroupCollapsed(group)}\n drawerOpen={drawerVisuallyOpen}\n onItemClick={onItemClick}\n icon={groupIcons.get(group)}\n />\n );\n })}\n\n {footerSlot}\n </>\n );\n}\n\nexport function DrawerLogo({\n logo,\n logoDark,\n title,\n logoDestination = \"/\",\n drawerOpen,\n drawerHovered\n}: {\n logo?: string;\n logoDark?: string;\n title?: React.ReactNode;\n logoDestination?: string;\n drawerOpen: boolean;\n drawerHovered: boolean;\n}) {\n\n const showFullContent = drawerOpen || drawerHovered;\n const { t } = useTranslation();\n\n return (\n <div className=\"flex flex-row items-center shrink-0 pt-4 pb-0 px-2\">\n {/* Logo — always visible */}\n {/* Named explicitly because neither branch below carries text: the\n stock `RebaseLogo` is a bare <svg> with no <title>, and a custom\n `logo` only ever gets the generic alt \"Logo\", which names the image\n rather than saying where the link goes. The title link beside it is\n no help either — it renders only when a `title` is set. */}\n <Link\n className=\"shrink-0 flex items-center justify-center w-[56px] h-[40px]\"\n to={logoDestination}\n aria-label={t(\"home\", { defaultValue: \"Home\" })}\n >\n {logo\n ? <BrandLogo logo={logo} logoDark={logoDark} className=\"w-[28px] h-[28px] object-contain\"/>\n : <RebaseLogo width=\"28px\" height=\"28px\"/>\n }\n </Link>\n\n {/* Title (fades in when expanded or hovered) */}\n <div\n className={cls(\n \"flex flex-row items-center overflow-hidden transition-all duration-200 ease-in-out\",\n showFullContent ? \"opacity-100 w-full ml-1\" : \"opacity-0 w-0 ml-0\"\n )}\n >\n {title && (\n <Link\n className=\"visited:text-inherit dark:visited:text-inherit block truncate\"\n to={logoDestination}\n >\n {typeof title === \"string\"\n ? <Typography variant=\"subtitle1\" noWrap className=\"truncate\">{title}</Typography>\n : title\n }\n </Link>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Toggle button at the bottom of the drawer.\n * Uses double-chevron icons to indicate collapse/expand direction.\n */\nexport function DrawerToggle({\n drawerOpen,\n drawerHovered,\n openDrawer,\n closeDrawer\n}: {\n drawerOpen: boolean;\n drawerHovered: boolean;\n openDrawer: () => void;\n closeDrawer: () => void;\n}) {\n const isExpanded = drawerOpen;\n const isHovered = drawerHovered && !drawerOpen;\n const showFullContent = isExpanded || isHovered;\n\n const [wantsTooltip, setWantsTooltip] = React.useState(false);\n // See {@link DrawerNavigationItem}: a masked tooltip never hears the pointer\n // leave, so the stale state is dropped as the mask goes on.\n if (showFullContent && wantsTooltip) setWantsTooltip(false);\n\n const { t } = useTranslation();\n\n return (\n <div className=\"shrink-0 mt-auto px-4 pt-0.5 pb-2\">\n <Tooltip\n title={isExpanded ? t(\"collapse\") : t(\"expand\")}\n // The row spells out \"Collapse\"/\"Expand\" itself whenever it is wide\n // enough to show the label — expanded, or floating open under the\n // pointer. A tooltip repeating that word is noise; it earns its\n // place only on a bare rail, where the chevron stands alone.\n //\n // Masked, not withheld: see {@link DrawerNavigationItem} for why\n // this stays controlled in both states.\n open={!showFullContent && wantsTooltip}\n onOpenChange={setWantsTooltip}\n side=\"right\"\n sideOffset={12}\n asChild={true}\n >\n <button\n type=\"button\"\n className={cls(\n \"flex flex-row items-center rounded-lg cursor-pointer w-full\",\n \"hover:bg-surface-hover\",\n \"transition-colors duration-150\",\n \"py-2\"\n )}\n aria-expanded={isExpanded}\n aria-label={isExpanded ? t(\"collapse\") : t(\"expand\")}\n onClick={() => isExpanded ? closeDrawer() : openDrawer()}\n >\n {/* 44px in both states, on the same grid as the rows above and\n for the same reason: the rail floats open under the pointer,\n and a slot that changed width with it walked the chevron\n sideways on hover. See the note in DrawerNavigationItem. */}\n <div className=\"shrink-0 flex items-center justify-center w-[44px] h-[24px] text-surface-500 dark:text-surface-400\">\n {isExpanded\n ? <ChevronsLeftIcon size={iconSize.small}/>\n : <ChevronsRightIcon size={iconSize.small}/>\n }\n </div>\n <div className={cls(\n \"overflow-hidden transition-all duration-200 ease-in-out\",\n showFullContent ? \"opacity-100 w-auto\" : \"opacity-0 w-0\"\n )}>\n <Typography\n variant=\"body2\"\n className=\"text-surface-500 dark:text-surface-400 select-none whitespace-nowrap\"\n >\n {isExpanded ? t(\"collapse\") : t(\"expand\")}\n </Typography>\n </div>\n </button>\n </Tooltip>\n </div>\n );\n}\n\n/**\n * Segmented Content / Studio switch rendered inside the drawer.\n * Animates in/out with the drawer open state via opacity + max-height.\n */\nfunction DrawerModeSwitch({\n drawerOpen,\n drawerHovered\n}: {\n drawerOpen: boolean;\n drawerHovered: boolean;\n}) {\n const adminModeController = useAdminModeController();\n const urlController = useUrlController();\n const navigate = useNavigate();\n const { t } = useTranslation();\n const showSwitch = drawerOpen || drawerHovered;\n\n return (\n <div\n // Hidden by opacity so it can fade with the rail; `inert` takes it\n // out of the tab order and the accessibility tree while it is.\n inert={!showSwitch}\n className={cls(\n \"shrink-0 overflow-hidden transition-all duration-200 ease-in-out px-3 h-8 mt-2 mb-0\",\n showSwitch ? \"opacity-100\" : \"opacity-0 pointer-events-none\"\n )}\n >\n <ToggleButtonGroup<AdminModeController[\"mode\"]>\n fullWidth\n aria-label={t(\"panel_mode\")}\n value={adminModeController.mode}\n onValueChange={(mode) => {\n adminModeController.setMode(mode);\n if (mode === \"cms\") navigate(urlController.basePath ?? \"/\");\n else navigate(urlController.basePath === \"/\" ? \"/s\" : `${urlController.basePath ?? \"\"}/s`);\n }}\n options={[\n { value: \"cms\", label: \"CMS\" },\n { value: \"studio\", label: \"Studio\" }\n ]}\n />\n </div>\n );\n}\n\n/**\n * Footer actions rendered at the bottom of the drawer, above the collapse/expand toggle.\n * Replaces the app bar icons (language, theme, user avatar) with a drawer-native layout\n * that adapts between collapsed (icons only) and expanded (full labels + user bar) states.\n *\n * @group Core\n */\nexport function DrawerFooterActions({\n drawerOpen,\n drawerHovered,\n /**\n * Custom content to render inside the user dropdown menu.\n * When provided, these items are appended after the user info header\n * and before the default Sign Out item.\n */\n dropDownActions,\n /**\n * Override the user object displayed in the footer.\n * When omitted, falls back to `authController.user`.\n */\n user: userProp\n}: {\n drawerOpen: boolean;\n drawerHovered: boolean;\n dropDownActions?: React.ReactNode;\n user?: import(\"@rebasepro/types\").User;\n}) {\n const authController = useAuthController();\n const {\n mode,\n setMode\n } = useModeController();\n const navigate = useNavigate();\n const { t } = useTranslation();\n\n const user = userProp ?? authController.user;\n const showFullContent = drawerOpen || drawerHovered;\n const isFloating = drawerHovered && !drawerOpen;\n const portalRef = React.useRef<HTMLDivElement>(null);\n const canSimulateAccess = useCanSimulateAccess();\n\n // User avatar\n let avatarComponent: React.ReactElement | null;\n if (user) {\n const initial = user?.displayName\n ? user.displayName[0].toUpperCase()\n : (user?.email ? user.email[0].toUpperCase() : \"A\");\n avatarComponent = <Avatar src={user.photoURL ?? undefined} className=\"w-8 h-8 text-xs\">\n {initial}\n </Avatar>;\n } else if (user === undefined || authController.initialLoading) {\n avatarComponent = <Skeleton className=\"w-8 h-8 rounded-full\"/>;\n } else {\n avatarComponent = null;\n }\n\n return (\n <div className=\"shrink-0 pt-2 pb-0\" ref={portalRef}>\n {/* The RLS simulator: an icon on the collapsed rail, the pill when expanded. */}\n {canSimulateAccess && (\n <div className=\"flex items-center px-[16px] py-1\">\n {/* The avatar's 44px column, so the icon lines up with it. */}\n <div className={cls(\"flex\", { \"w-[44px] justify-center\": !showFullContent })}>\n <RlsSimulatorBar\n compact={!showFullContent}\n side=\"right\"\n align=\"end\"\n portalContainer={portalRef.current}/>\n </div>\n </div>\n )}\n {avatarComponent && (\n <div className=\"flex items-center px-[16px] py-1\">\n <Menu\n trigger={\n <div\n className={cls(\n // Same 44px grid, and fixed across both states for\n // the same reason — see DrawerNavigationItem.\n \"shrink-0 flex items-center justify-center w-[44px] cursor-pointer\",\n \"rounded-md py-1\",\n \"hover:bg-surface-hover\",\n \"transition-colors duration-150\"\n )}\n role=\"button\"\n tabIndex={0}\n aria-label={t(\"user_menu\", { defaultValue: \"User menu\" })}\n >\n {avatarComponent}\n </div>\n }\n side=\"top\"\n align=\"start\"\n >\n {user && <div className=\"px-4 py-2 mb-1\">\n {user.displayName && <Typography variant=\"body1\" color=\"secondary\">\n {user.displayName}\n </Typography>}\n {user.email && <Typography variant=\"body2\" color=\"secondary\">\n {user.email}\n </Typography>}\n </div>}\n\n {dropDownActions}\n\n {!dropDownActions && <>\n <MenuItem onClick={() => navigate(\"/settings\")}>\n <SettingsIcon/>\n {t(\"account_settings\")}\n </MenuItem>\n <MenuItem onClick={async () => {\n await authController.signOut();\n navigate(\"/\");\n }}>\n <LogOutIcon/>\n {t(\"log_out\")}\n </MenuItem>\n </>}\n </Menu>\n\n {/* Language + Theme — only when expanded */}\n {showFullContent && (\n <div className=\"flex items-center gap-0\">\n <LanguageToggle/>\n <Menu\n trigger={\n <IconButton\n aria-label={t(\"toggle_theme\", { defaultValue: \"Toggle theme\" })}\n className=\"text-surface-500 dark:text-surface-400\"\n >\n {mode === \"dark\"\n ? <MoonIcon size={iconSize.small}/>\n : mode === \"light\"\n ? <SunIcon size={iconSize.small}/>\n : <SunMoonIcon size={iconSize.small}/>}\n </IconButton>\n }\n portalContainer={portalRef.current}\n side=\"top\"\n >\n <MenuItem onClick={() => setMode(\"dark\")}><MoonIcon size={iconSize.smallest}/> {t(\"dark_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"light\")}><SunIcon size={iconSize.smallest}/> {t(\"light_mode\")}</MenuItem>\n <MenuItem onClick={() => setMode(\"system\")}><SunMoonIcon size={iconSize.smallest}/> {t(\"system_mode\")}</MenuItem>\n </Menu>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,cAAc,EAC1B,OACA,MACA,UACA,iBACA,UACA,eACA,WACA,SAuBD;CAEC,MAAM,EACF,eACA,YACA,YACA,aACA,MAAM,SACN,UAAU,gBACV,OAAO;CAIX,MAAM,eAAe,QAAQ;CAC7B,MAAM,mBAAmB,OAAO,WAAY,YAAY;CAExD,MAAM,YAAY,MAAM,OAAuB,IAAI;CACnD,MAAM,CAAC,UAAU,eAAe,MAAM,SAAS,KAAK;CAKpD,MAAM,WAAW,cAAc;CAC/B,MAAM,YAAY,mBAAmB,QAAQ;CAE7C,MAAM,qBAAqB;EACvB,IAAI,UAAU,SACV,YAAY,UAAU,QAAQ,YAAY,CAAC;CAEnD;CAEA,OACI,qBAAC,OAAD;EAAK,MAAK;EAAa,cAAW;EAC9B,iBAAe;EACf,WAAW,IAAI,0DAA0D,SAAS;EAAU;YAFhG;GAII,oBAAC,YAAD;IACI,MAAM;IACN,UAAU;IACH;IACU;IACL;IACG;GAClB,CAAA;GAED,oBAAC,OAAD;IACI,KAAK;IACL,UAAU;IACV,WAAW;IACX,OAAO,EACH,WAAW,WACL,qGACA,iFACV;cACA,oBAAC,uBAAuB,UAAxB;KAAiC,OAAO;eACnC,YAAY,oBAAC,wBAAD,CAAyB,CAAA;IACT,CAAA;GACh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-label": `${t("copy_id")} ${value}`,
356
- className: cls("hidden md:inline-flex items-center gap-1.5 shrink-0 whitespace-nowrap px-2 py-0.5 rounded-md", "font-mono text-[11px] text-text-secondary dark:text-text-secondary-dark", "bg-surface-field", "hover:bg-surface-field-hover transition-colors"),
356
+ className: cls("hidden md:inline-flex items-center gap-1.5 shrink-0 whitespace-nowrap px-2 py-0.5 rounded-md", "font-mono text-xs text-text-secondary dark:text-text-secondary-dark", "bg-surface-field", "hover:bg-surface-field-hover transition-colors"),
357
357
  children: [truncated, copied ? /* @__PURE__ */ jsx(CheckIcon, { size: iconSize.smallest }) : /* @__PURE__ */ jsx(CopyIcon, { size: iconSize.smallest })]
358
358
  })
359
359
  });