@okta/odyssey-react-mui 1.36.1 → 1.37.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 (73) hide show
  1. package/README.md +8 -3
  2. package/dist/cjs/Pagination/Pagination.cjs +1 -1
  3. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  4. package/dist/cjs/Pagination/usePagination.cjs +3 -1
  5. package/dist/cjs/Pagination/usePagination.cjs.map +1 -1
  6. package/dist/cjs/labs/DataView/TableLayoutContent.cjs +3 -3
  7. package/dist/cjs/labs/DataView/TableLayoutContent.cjs.map +1 -1
  8. package/dist/cjs/labs/PageTemplate/DocumentationLink.cjs +41 -0
  9. package/dist/cjs/labs/PageTemplate/DocumentationLink.cjs.map +1 -0
  10. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +22 -8
  11. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
  12. package/dist/cjs/properties/ts/odyssey-react-mui.cjs +1 -0
  13. package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
  14. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +2 -1
  15. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  16. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +6 -2
  17. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  18. package/dist/cjs/ui-shell/WideUiShellContent.cjs +0 -1
  19. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  20. package/dist/cjs/ui-shell/renderUiShell.cjs +12 -0
  21. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  22. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  23. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  24. package/dist/cjs/web-component/renderReactInWebComponent.cjs.map +1 -1
  25. package/dist/esm/Pagination/Pagination.js +1 -1
  26. package/dist/esm/Pagination/Pagination.js.map +1 -1
  27. package/dist/esm/Pagination/usePagination.js +3 -1
  28. package/dist/esm/Pagination/usePagination.js.map +1 -1
  29. package/dist/esm/labs/DataView/TableLayoutContent.js +3 -3
  30. package/dist/esm/labs/DataView/TableLayoutContent.js.map +1 -1
  31. package/dist/esm/labs/PageTemplate/DocumentationLink.js +35 -0
  32. package/dist/esm/labs/PageTemplate/DocumentationLink.js.map +1 -0
  33. package/dist/esm/labs/PageTemplate/PageTemplate.js +22 -8
  34. package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
  35. package/dist/esm/properties/ts/odyssey-react-mui.js +1 -0
  36. package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
  37. package/dist/esm/ui-shell/NarrowUiShellContent.js +2 -1
  38. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  39. package/dist/esm/ui-shell/SideNav/SideNav.js +6 -2
  40. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  41. package/dist/esm/ui-shell/WideUiShellContent.js +0 -1
  42. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  43. package/dist/esm/ui-shell/renderUiShell.js +12 -0
  44. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  45. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  46. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  47. package/dist/esm/web-component/renderReactInWebComponent.js.map +1 -1
  48. package/dist/index.cjs +231 -0
  49. package/dist/index.d.ts +22 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +25 -0
  52. package/dist/index.mjs +229 -0
  53. package/dist/index.scss +549 -0
  54. package/dist/tsconfig.production.tsbuildinfo +1 -1
  55. package/dist/tsconfig.tsbuildinfo +1 -0
  56. package/dist/types/OdysseyTranslationProvider.d.ts +1 -1
  57. package/dist/types/OdysseyTranslationProvider.d.ts.map +1 -1
  58. package/dist/types/Pagination/usePagination.d.ts.map +1 -1
  59. package/dist/types/i18n.d.ts +1 -0
  60. package/dist/types/i18n.d.ts.map +1 -1
  61. package/dist/types/labs/PageTemplate/DocumentationLink.d.ts +34 -0
  62. package/dist/types/labs/PageTemplate/DocumentationLink.d.ts.map +1 -0
  63. package/dist/types/labs/PageTemplate/PageTemplate.d.ts.map +1 -1
  64. package/dist/types/properties/ts/odyssey-react-mui.d.ts +1 -0
  65. package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  66. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  67. package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
  68. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  69. package/dist/types/ui-shell/renderUiShell.d.ts +19 -4
  70. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  71. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  72. package/dist/types/web-component/renderReactInWebComponent.d.ts.map +1 -1
  73. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"SideNav.js","names":["styled","memo","useMemo","useState","useCallback","useRef","useEffect","useTranslation","arrayMove","ErrorBoundary","NavAccordion","useOdysseyDesignTokens","OdysseyThemeProvider","SideNavHeader","SideNavItemContent","StyledSideNavListItem","SideNavFooterContent","SideNavItemContentContext","SIDE_NAV_TOGGLE_ICON_HALF_SIZE","SIDE_NAV_TOGGLE_ICON_SIZE","SideNavToggleButton","SortableList","Overline","useUiShellContext","SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION","SIDE_NAV_WIDTH","UI_SHELL_BASE_Z_INDEX","UI_SHELL_OVERLAY_Z_INDEX","useIsSideNavCollapsedSessionStorage","useMountLifecycleEffect","jsx","_jsx","jsxs","_jsxs","SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED","SIDE_NAV_COLLAPSED_PADDING_UNHIGHLIGHTED","StyledCollapsibleContent","shouldForwardProp","prop","odysseyDesignTokens","isSideNavCollapsed","position","display","gridTemplateColumns","height","transition","TransitionDurationMain","transitionTimingFunction","TransitionTimingMain","overflow","opacity","StyledOpacityTransitionContainer","gridTemplateRows","StyledSideNavContainer","backgroundColor","hasNeighboringContent","isAppContentWhiteBackground","isSideNavToggleHighlighted","HueNeutralWhite","width","content","pointerEvents","right","BorderWidthMain","top","userSelect","zIndex","BorderColorPrimaryControl","HueNeutral100","HueNeutral200","transform","borderRightColor","borderRightStyle","BorderStyleMain","borderRightWidth","StyledSideNavToggleButtonContainer","StyledSideNavHeaderContainer","borderColor","hasContentScrolled","flexShrink","borderBottomWidth","borderBottomStyle","borderBottomColor","concat","StyledSideNavListContainer","padding","listStyle","listStyleType","margin","StyledSideNavScrollableContainer","overflowY","paddingInline","Spacing2","StyledSectionHeaderContainer","contrastFontColor","color","HueNeutral600","marginBlock","Spacing3","paddingBlock","Spacing1","Spacing4","StyledSideNavFooter","sideNavBackgroundColor","StyledPersistentSideNavFooter","isContentScrollable","transitionProperty","transitionDuration","transitionTiming","boxShadow","StyledSideNavFooterItemsContainer","sideNavContrastColors","flexWrap","alignItems","fontSize","TypographySizeOverline","fontColor","textDecoration","HueNeutral900","StyledLoadingItemContainer","gap","getHasScrollableContent","scrollableContainer","scrollHeight","clientHeight","LoadingItem","children","_Skeleton","variant","SideNav","appName","footerComponent","footerItems","hasCustomFooter","isCollapsible","isCollapsed","isCompact","isLoading","isObtrusive","logoProps","onCollapse","onExpand","onSort","sideNavItems","setHasContentScrolled","setHasNeighboringContent","setIsContentScrollable","setIsSideNavToggleHighlighted","sideNavItemsList","updateSideNavItemsList","sessionState","setSessionState","setIsSideNavCollapsed","uiShellContext","t","scrollableContentRef","resizeObserverRef","intersectionObserverRef","sideNavRef","blankElement","current","getBoundingClientRect","x","onMount","onUpdate","updateIsContentScrollable","parentElement","resizeObserverDebounceTimer","ResizeObserver","cancelAnimationFrame","requestAnimationFrame","observe","IntersectionObserver","entries","isIntersecting","slice","sort","a","b","time","at","root","threshold","ulElement","liElement","Array","from","disconnect","scrollIntoViewRef","firstSideNavItemIdWithIsSelected","flattenedItems","flatMap","sideNavItem","nestedNavItems","firstItemWithIsSelected","find","isSelected","id","scrollIntoView","getRefIfThisIsFirstNodeWithIsSelected","itemId","undefined","sideNavItemContentProviderValue","depth","setSelectedItem","selectedItemId","updatedSideNavItems","map","item","childItem","closeSideNavMenu","processedSideNavItems","childNavItems","childProps","isDisabled","isSortable","navItem","Provider","value","onItemSelected","scrollRef","translate","sideNavExpandClickHandler","sideNavExpandKeyHandler","event","key","code","preventDefault","unsubscribe","subscribeToCloseSideNavMenu","setSortedItems","parentId","activeId","activeIndex","overIndex","sortedSideNavItems","onSideNavToggleButtonHighlight","isHighlighted","appBackgroundColor","ref","clickAreaPadding","ariaControls","onClick","onHighlight","onKeyDown","role","fill","_","index","href","isDefaultExpanded","isExpanded","isSectionHeader","label","startIcon","fallback","component","nestedChildren","items","onChange","renderItem","sortableItem","Item","disabled","MemoizedSideNav","displayName"],"sources":["../../../../src/ui-shell/SideNav/SideNav.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n memo,\n useMemo,\n useState,\n useCallback,\n useRef,\n useEffect,\n KeyboardEventHandler,\n CSSProperties,\n} from \"react\";\nimport { Skeleton } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\nimport { arrayMove } from \"@dnd-kit/sortable\";\nimport { UniqueIdentifier } from \"@dnd-kit/core\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { Property } from \"csstype\";\n\nimport { ContrastColors } from \"../../createContrastColors.js\";\nimport { NavAccordion } from \"./NavAccordion.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.js\";\nimport type { SideNavProps } from \"./types.js\";\nimport { SideNavHeader } from \"./SideNavHeader.js\";\nimport {\n SideNavItemContent,\n StyledSideNavListItem,\n} from \"./SideNavItemContent.js\";\nimport { SideNavFooterContent } from \"./SideNavFooterContent.js\";\nimport { SideNavItemContentContext } from \"./SideNavItemContentContext.js\";\nimport {\n SIDE_NAV_TOGGLE_ICON_HALF_SIZE,\n SIDE_NAV_TOGGLE_ICON_SIZE,\n SideNavToggleButton,\n SideNavToggleButtonProps,\n} from \"./SideNavToggleButton.js\";\nimport { SortableList } from \"./SortableList/SortableList.js\";\nimport { Overline } from \"../../Typography.js\";\nimport {\n UiShellColors,\n useUiShellContext,\n} from \"../../ui-shell/UiShellProvider.js\";\nimport {\n SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION,\n SIDE_NAV_WIDTH,\n UI_SHELL_BASE_Z_INDEX,\n UI_SHELL_OVERLAY_Z_INDEX,\n} from \"../uiShellSharedConstants.js\";\nimport { useIsSideNavCollapsedSessionStorage } from \"./useIsSideNavCollapsedSessionStorage.js\";\nimport { useMountLifecycleEffect } from \"../../useMountLifecycleEffect.js\";\n\nexport const SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED = 12;\nexport const SIDE_NAV_COLLAPSED_PADDING_UNHIGHLIGHTED = 2;\n\nconst StyledCollapsibleContent = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})<{\n odysseyDesignTokens: DesignTokens;\n isSideNavCollapsed: boolean;\n}>(({ odysseyDesignTokens, isSideNavCollapsed }) => ({\n position: \"relative\",\n display: \"grid\",\n gridTemplateColumns: SIDE_NAV_WIDTH,\n height: \"100%\",\n transition: `grid-template-columns ${odysseyDesignTokens.TransitionDurationMain}, opacity 300ms`,\n transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain,\n overflow: \"hidden\",\n\n ...(isSideNavCollapsed &&\n ({\n gridTemplateColumns: 0,\n opacity: 0,\n } satisfies CSSProperties)),\n}));\n\nconst StyledOpacityTransitionContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})(\n ({\n odysseyDesignTokens,\n isSideNavCollapsed,\n }: {\n odysseyDesignTokens: DesignTokens;\n isSideNavCollapsed: boolean;\n }) => ({\n display: \"grid\",\n gridTemplateRows: \"max-content 1fr max-content\",\n height: \"100%\",\n transition: `opacity 50ms`,\n transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain,\n overflow: \"hidden\",\n\n ...(isSideNavCollapsed &&\n ({\n opacity: 0,\n } satisfies CSSProperties)),\n }),\n);\n\nconst StyledSideNavContainer = styled(\"nav\", {\n shouldForwardProp: (prop) =>\n prop !== \"backgroundColor\" &&\n prop !== \"hasNeighboringContent\" &&\n prop !== \"isAppContentWhiteBackground\" &&\n prop !== \"isSideNavCollapsed\" &&\n prop !== \"isSideNavToggleHighlighted\" &&\n prop !== \"odysseyDesignTokens\",\n})<{\n backgroundColor?: UiShellColors[\"sideNavBackgroundColor\"];\n hasNeighboringContent: boolean;\n isAppContentWhiteBackground: boolean;\n isSideNavCollapsed: boolean;\n isSideNavToggleHighlighted: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n backgroundColor,\n hasNeighboringContent,\n isAppContentWhiteBackground,\n isSideNavCollapsed,\n isSideNavToggleHighlighted,\n odysseyDesignTokens,\n }) => ({\n // Side nav container styles\n backgroundColor: backgroundColor || odysseyDesignTokens.HueNeutralWhite,\n height: \"100%\",\n position: \"relative\",\n width: \"fit-content\",\n\n // Right-side vertical line shared\n \"&::before, &::after\": {\n content: \"''\",\n height: \"100%\",\n pointerEvents: \"none\",\n position: \"absolute\",\n right: `-${odysseyDesignTokens.BorderWidthMain}`,\n top: 0,\n transition: `opacity ${odysseyDesignTokens.TransitionDurationMain}, transform ${odysseyDesignTokens.TransitionDurationMain}, width ${odysseyDesignTokens.TransitionDurationMain}`,\n userSelect: \"none\",\n zIndex: UI_SHELL_OVERLAY_Z_INDEX,\n },\n\n // Right-side vertical line when open\n \"&::before\": {\n backgroundColor: isSideNavToggleHighlighted\n ? odysseyDesignTokens.BorderColorPrimaryControl\n : odysseyDesignTokens.HueNeutral100,\n opacity:\n isAppContentWhiteBackground ||\n (!isSideNavCollapsed && isSideNavToggleHighlighted)\n ? 1\n : 0,\n width: `calc(${odysseyDesignTokens.BorderWidthMain} * 2)`,\n },\n\n // Side nav vertical fill line when no neighboring content\n \"&::after\": {\n backgroundColor: odysseyDesignTokens.HueNeutral200,\n opacity: isSideNavCollapsed ? 1 : 0,\n transform:\n isSideNavCollapsed && !hasNeighboringContent\n ? isSideNavToggleHighlighted\n ? `translateX(calc(100% - (${odysseyDesignTokens.BorderWidthMain} * 2)))`\n : `translateX(calc(100% - ${SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED}px))`\n : \"translateX(0)\",\n width: hasNeighboringContent\n ? 0\n : `calc(${SIDE_NAV_TOGGLE_ICON_HALF_SIZE + SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED}px + ${odysseyDesignTokens.BorderWidthMain} * 2)`,\n\n // Right-side vertical line when collapsed\n ...((isSideNavCollapsed && isSideNavToggleHighlighted\n ? {\n borderRightColor: odysseyDesignTokens.BorderColorPrimaryControl,\n borderRightStyle:\n odysseyDesignTokens.BorderStyleMain as Property.BorderRightStyle,\n borderRightWidth: `calc(${odysseyDesignTokens.BorderWidthMain} * 2)`,\n }\n : {}) satisfies CSSProperties),\n },\n }),\n);\n\nconst StyledSideNavToggleButtonContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"hasNeighboringContent\" &&\n prop !== \"isSideNavCollapsed\" &&\n prop !== \"isSideNavToggleHighlighted\" &&\n prop !== \"odysseyDesignTokens\",\n})<{\n hasNeighboringContent: boolean;\n isSideNavCollapsed: boolean;\n isSideNavToggleHighlighted: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n hasNeighboringContent,\n isSideNavCollapsed,\n isSideNavToggleHighlighted,\n odysseyDesignTokens,\n }) => ({\n position: \"absolute\",\n right: `${SIDE_NAV_TOGGLE_ICON_HALF_SIZE}px`,\n top: SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION,\n transform:\n isSideNavCollapsed && !hasNeighboringContent\n ? isSideNavToggleHighlighted\n ? `translate3d(calc(100% + ${SIDE_NAV_TOGGLE_ICON_HALF_SIZE + SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED}px), 0, 0)`\n : `translate3d(calc(100% + ${SIDE_NAV_TOGGLE_ICON_HALF_SIZE + SIDE_NAV_COLLAPSED_PADDING_UNHIGHLIGHTED}px), 0, 0)`\n : \"translate3d(100%, 0, 0)\",\n transition: `transform ${odysseyDesignTokens.TransitionDurationMain}`,\n zIndex: UI_SHELL_OVERLAY_Z_INDEX + 1,\n }),\n);\n\nconst StyledSideNavHeaderContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"borderColor\" &&\n prop !== \"hasContentScrolled\" &&\n prop !== \"odysseyDesignTokens\",\n})<{\n borderColor: ContrastColors[\"fontColor\"];\n hasContentScrolled: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ borderColor, hasContentScrolled, odysseyDesignTokens }) => ({\n flexShrink: 0,\n // The bottom border should appear only if the scrollable region has been scrolled\n ...(hasContentScrolled &&\n ({\n borderBottomWidth: odysseyDesignTokens.BorderWidthMain,\n borderBottomStyle: odysseyDesignTokens.BorderStyleMain,\n borderBottomColor: odysseyDesignTokens.HueNeutral100,\n\n ...(borderColor &&\n ({\n borderBottomColor: borderColor.concat(\"15\"),\n } satisfies CSSProperties)),\n } as CSSProperties)),\n}));\n\nconst StyledSideNavListContainer = styled(\"ul\")(() => ({\n padding: 0,\n listStyle: \"none\",\n listStyleType: \"none\",\n margin: 0,\n width: \"100%\",\n}));\n\nconst StyledSideNavScrollableContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"inline-grid\",\n gridTemplateRows: \"1fr max-content\",\n overflowY: \"auto\",\n paddingInline: odysseyDesignTokens.Spacing2,\n}));\n\nconst StyledSectionHeaderContainer = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"contrastFontColor\",\n})(\n ({\n contrastFontColor,\n odysseyDesignTokens,\n }: {\n contrastFontColor: ContrastColors[\"fontColor\"];\n odysseyDesignTokens: DesignTokens;\n }) => ({\n color: contrastFontColor || odysseyDesignTokens.HueNeutral600,\n marginBlock: `${odysseyDesignTokens.Spacing3}`,\n paddingBlock: odysseyDesignTokens.Spacing1,\n paddingInline: odysseyDesignTokens.Spacing4,\n }),\n);\n\nconst StyledSideNavFooter = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"sideNavBackgroundColor\",\n})(\n ({\n odysseyDesignTokens,\n sideNavBackgroundColor,\n }: {\n odysseyDesignTokens: DesignTokens;\n sideNavBackgroundColor?: UiShellColors[\"sideNavBackgroundColor\"];\n }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n flexShrink: 0,\n padding: odysseyDesignTokens.Spacing4,\n\n ...(sideNavBackgroundColor &&\n ({\n backgroundColor: sideNavBackgroundColor,\n } satisfies CSSProperties)),\n }),\n);\n\nconst StyledPersistentSideNavFooter = styled(StyledSideNavFooter, {\n shouldForwardProp: (prop) =>\n prop !== \"isContentScrollable\" &&\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"sideNavBackgroundColor\",\n})(\n ({\n isContentScrollable,\n odysseyDesignTokens,\n sideNavBackgroundColor,\n }: {\n isContentScrollable: boolean;\n odysseyDesignTokens: DesignTokens;\n sideNavBackgroundColor?: UiShellColors[\"sideNavBackgroundColor\"];\n }) => ({\n transitionProperty: \"box-shadow\",\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n transitionTiming: odysseyDesignTokens.TransitionTimingMain,\n zIndex: UI_SHELL_BASE_Z_INDEX,\n\n // The box shadow should appear above the footer only if the scrollable region has overflow\n ...(isContentScrollable &&\n ({\n boxShadow: \"0px -8px 8px -8px rgba(39, 39, 39, 0.08)\",\n } satisfies CSSProperties)),\n\n ...(sideNavBackgroundColor &&\n ({\n backgroundColor: sideNavBackgroundColor,\n } satisfies CSSProperties)),\n }),\n);\n\nconst StyledSideNavFooterItemsContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"sideNavContrastColors\",\n})<{\n odysseyDesignTokens: DesignTokens;\n sideNavContrastColors: UiShellColors[\"sideNavContrastColors\"];\n}>(({ odysseyDesignTokens, sideNavContrastColors }) => ({\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n fontSize: odysseyDesignTokens.TypographySizeOverline,\n\n \"a, span\": {\n color: odysseyDesignTokens.HueNeutral600,\n transition: `color ${odysseyDesignTokens.TransitionDurationMain}`,\n\n \"&:visited\": {\n color: odysseyDesignTokens.HueNeutral600,\n\n ...(sideNavContrastColors?.fontColor &&\n ({\n color: sideNavContrastColors?.fontColor,\n } satisfies CSSProperties)),\n },\n\n \"&:hover\": {\n textDecoration: \"none\",\n color: odysseyDesignTokens.HueNeutral900,\n\n ...(sideNavContrastColors?.fontColor &&\n ({\n color: sideNavContrastColors?.fontColor,\n } satisfies CSSProperties)),\n },\n\n ...(sideNavContrastColors?.fontColor &&\n ({\n color: sideNavContrastColors?.fontColor,\n } satisfies CSSProperties)),\n },\n}));\n\nconst StyledLoadingItemContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing2,\n paddingBlock: odysseyDesignTokens.Spacing2,\n paddingInline: odysseyDesignTokens.Spacing4,\n}));\n\nconst getHasScrollableContent = (scrollableContainer: HTMLElement) =>\n scrollableContainer.scrollHeight > scrollableContainer.clientHeight;\n\nconst LoadingItem = () => {\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n return (\n <StyledLoadingItemContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Skeleton\n variant=\"circular\"\n width={odysseyDesignTokens.Spacing4}\n height={odysseyDesignTokens.Spacing4}\n />\n <Skeleton variant=\"rounded\" width=\"100%\" />\n </StyledLoadingItemContainer>\n );\n};\n\nconst SideNav = ({\n appName,\n footerComponent,\n footerItems,\n hasCustomFooter,\n isCollapsible,\n isCollapsed = false,\n isCompact,\n isLoading,\n isObtrusive,\n logoProps,\n onCollapse,\n onExpand,\n onSort,\n sideNavItems,\n}: SideNavProps) => {\n const [hasContentScrolled, setHasContentScrolled] = useState(false);\n const [hasNeighboringContent, setHasNeighboringContent] = useState(false);\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const [isSideNavToggleHighlighted, setIsSideNavToggleHighlighted] =\n useState(false);\n const [sideNavItemsList, updateSideNavItemsList] = useState(sideNavItems);\n\n const {\n sessionState: isSideNavCollapsed,\n setSessionState: setIsSideNavCollapsed,\n } = useIsSideNavCollapsedSessionStorage(isCollapsed);\n\n const uiShellContext = useUiShellContext();\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const scrollableContentRef = useRef<HTMLUListElement>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n const intersectionObserverRef = useRef<IntersectionObserver | null>(null);\n const sideNavRef = useRef<HTMLDivElement>(null);\n\n const blankElement = useMemo(() => <div />, []);\n\n // The default value (sideNavItems) passed to useState is ONLY used by the useState hook for\n // the very first value. Subsequent updates to the prop (sideNavItems) need to cause the state\n // to update!\n useEffect(() => updateSideNavItemsList(sideNavItems), [sideNavItems]);\n\n // update sidenav collapse status\n useEffect(() => {\n if (sideNavRef.current) {\n setHasNeighboringContent(\n sideNavRef.current.getBoundingClientRect().x > 0,\n );\n }\n // We want this listening to `isCollapsed`.\n }, [isCollapsed]);\n\n // In the case that you can't control the side nav, then it should use whatever state was passed (app control) rather than what's stored in session storage (user control).\n const onMount = useCallback(() => {\n if (!isCollapsible) {\n setIsSideNavCollapsed(isCollapsed);\n }\n }, [isCollapsed, isCollapsible, setIsSideNavCollapsed]);\n\n const onUpdate = useCallback(() => {\n setIsSideNavCollapsed(isCollapsed);\n }, [isCollapsed, setIsSideNavCollapsed]);\n\n useMountLifecycleEffect({\n onMount,\n onUpdate,\n });\n\n useEffect(() => {\n // This is called directly in this effect AND perhaps as a result of the ResizeObserver\n const updateIsContentScrollable = () => {\n if (\n scrollableContentRef.current &&\n scrollableContentRef.current.parentElement\n ) {\n setIsContentScrollable(\n getHasScrollableContent(scrollableContentRef.current.parentElement),\n );\n }\n };\n\n // If the window is resized, we may need to re-determine if the scrollable container has overflow\n // Setup a ResizeObserver to know if the size of the scrollableContent changes\n let resizeObserverDebounceTimer: ReturnType<typeof requestAnimationFrame>;\n if (!resizeObserverRef.current) {\n resizeObserverRef.current = new ResizeObserver(() => {\n cancelAnimationFrame(resizeObserverDebounceTimer);\n resizeObserverDebounceTimer = requestAnimationFrame(\n updateIsContentScrollable,\n );\n });\n }\n\n if (resizeObserverRef.current && scrollableContentRef.current) {\n // Observe the <ul> itself (in case it changes size due to the content expanding)\n resizeObserverRef.current.observe(scrollableContentRef.current);\n if (scrollableContentRef.current.parentElement) {\n // ALSO observe the parent (<SideNavScrollableContainer>) in case the window resizes\n resizeObserverRef.current.observe(\n scrollableContentRef.current.parentElement,\n );\n }\n }\n\n // Determine if the scrollable container has overflow or not on load\n updateIsContentScrollable();\n\n // Finally, we only want to have the border on the bottom of the header iff the user has scrolled\n // the scrollable container\n if (!intersectionObserverRef.current && scrollableContentRef.current) {\n intersectionObserverRef.current = new IntersectionObserver(\n (entries) => {\n // If isIntersecting is true, then we're at the top of the scroll container\n // If isIntersecting is false, some scrolling has occurred.\n // The entries must be sorted by time and we only really need to look at the latest one\n const isIntersecting = entries\n .slice()\n .sort((a, b) => a.time - b.time)\n .at(0)?.isIntersecting;\n setHasContentScrolled(!isIntersecting);\n },\n {\n root: scrollableContentRef.current.parentElement,\n threshold: 1.0,\n },\n );\n }\n\n if (intersectionObserverRef.current && scrollableContentRef.current) {\n const ulElement = scrollableContentRef.current;\n const [liElement] = Array.from(ulElement?.children || []);\n\n if (liElement) {\n intersectionObserverRef.current.observe(liElement);\n }\n }\n\n // Cleanup when unmounted:\n return () => {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n resizeObserverRef.current = null;\n }\n if (intersectionObserverRef.current) {\n intersectionObserverRef.current.disconnect();\n intersectionObserverRef.current = null;\n }\n cancelAnimationFrame(resizeObserverDebounceTimer); // Ensure timer is cleared on component unmount\n };\n }, [sideNavItemsList]);\n\n const scrollIntoViewRef = useRef<HTMLLIElement>(null);\n /**\n * Look through the sideNavItems and determine which is the first node\n * with isSelected. This should be the node we set a ref on in order to\n * call scrollIntoView in the effect\n */\n const firstSideNavItemIdWithIsSelected = useMemo(() => {\n const flattenedItems = sideNavItemsList.flatMap((sideNavItem) =>\n sideNavItem.nestedNavItems\n ? [sideNavItem, ...sideNavItem.nestedNavItems]\n : sideNavItem,\n );\n const firstItemWithIsSelected = flattenedItems.find(\n (sideNavItem) => sideNavItem.isSelected,\n );\n return firstItemWithIsSelected?.id;\n }, [sideNavItemsList]);\n /**\n * Once we've rendered and if we have an item to scroll to, do the scroll action.\n * This must rely on checking firstSideNavItemIdWithIsSelected or it will not run\n * once the actual ref is populated.\n */\n useEffect(() => {\n if (firstSideNavItemIdWithIsSelected && scrollIntoViewRef.current) {\n scrollIntoViewRef.current.scrollIntoView();\n }\n }, [firstSideNavItemIdWithIsSelected]);\n\n /**\n * We only want to put a ref on a node iff it is the first selected node.\n * This function returns the ref only if the ID provided matches the first\n * selected node, otherwise returns undefined (so that the node has no ref)\n */\n const getRefIfThisIsFirstNodeWithIsSelected = useCallback(\n (itemId: string) =>\n itemId === firstSideNavItemIdWithIsSelected\n ? scrollIntoViewRef\n : undefined,\n [firstSideNavItemIdWithIsSelected],\n );\n\n const sideNavItemContentProviderValue = useMemo(\n () => ({ isCompact, depth: 1 }),\n [isCompact],\n );\n\n const setSelectedItem = useCallback(\n (selectedItemId: string) => {\n const updatedSideNavItems = sideNavItemsList.map((item) => {\n if (item.id === selectedItemId) {\n item.isSelected = true;\n } else if (item.isSelected) {\n delete item.isSelected;\n }\n\n return item.nestedNavItems\n ? {\n ...item,\n nestedNavItems: item.nestedNavItems.map((childItem) => {\n if (childItem.id === selectedItemId) {\n childItem.isSelected = true;\n } else if (childItem.isSelected) {\n delete childItem.isSelected;\n }\n return childItem;\n }),\n }\n : item;\n });\n updateSideNavItemsList(updatedSideNavItems);\n\n if (isCollapsed || isObtrusive) {\n uiShellContext?.closeSideNavMenu();\n }\n },\n [isCollapsed, isObtrusive, sideNavItemsList, uiShellContext],\n );\n\n const processedSideNavItems = useMemo(() => {\n return sideNavItemsList?.map((item) => ({\n ...item,\n childNavItems: item.nestedNavItems?.map((childProps) => ({\n id: childProps.id,\n isSelected: childProps.isSelected,\n isDisabled: childProps.isDisabled,\n isSortable: childProps.isSortable,\n navItem: (\n <SideNavItemContentContext.Provider\n key={childProps.id}\n value={{\n ...sideNavItemContentProviderValue,\n depth: 2,\n isSortable: item.isSortable,\n }}\n >\n <SideNavItemContent\n {...childProps}\n onItemSelected={setSelectedItem}\n scrollRef={getRefIfThisIsFirstNodeWithIsSelected(childProps.id)}\n translate={childProps.translate}\n />\n </SideNavItemContentContext.Provider>\n ),\n })),\n }));\n }, [\n getRefIfThisIsFirstNodeWithIsSelected,\n setSelectedItem,\n sideNavItemContentProviderValue,\n sideNavItemsList,\n ]);\n\n const sideNavExpandClickHandler = useCallback(() => {\n setIsSideNavCollapsed((isSideNavCollapsed) => {\n if (isSideNavCollapsed) {\n onExpand?.();\n } else {\n onCollapse?.();\n }\n\n return !isSideNavCollapsed;\n });\n }, [onCollapse, onExpand, setIsSideNavCollapsed]);\n\n const sideNavExpandKeyHandler = useCallback<\n KeyboardEventHandler<HTMLButtonElement>\n >(\n (event) => {\n if (event?.key === \"Enter\" || event?.code === \"Space\") {\n event.preventDefault();\n sideNavExpandClickHandler();\n }\n },\n [sideNavExpandClickHandler],\n );\n\n useEffect(() => {\n const unsubscribe = uiShellContext?.subscribeToCloseSideNavMenu(() => {\n onCollapse?.();\n setIsSideNavCollapsed(true);\n });\n\n return () => {\n unsubscribe?.();\n };\n }, [onCollapse, setIsSideNavCollapsed, uiShellContext]);\n\n const setSortedItems = useCallback(\n (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => {\n const sortedSideNavItems = sideNavItemsList.map((item) =>\n item.id === parentId && item.nestedNavItems\n ? {\n ...item,\n nestedNavItems: arrayMove(\n item.nestedNavItems,\n activeIndex,\n overIndex,\n ),\n }\n : item,\n );\n updateSideNavItemsList(sortedSideNavItems);\n onSort?.(sortedSideNavItems, parentId, activeId, activeIndex, overIndex);\n },\n [onSort, sideNavItemsList],\n );\n\n const onSideNavToggleButtonHighlight = useCallback<\n NonNullable<SideNavToggleButtonProps[\"onHighlight\"]>\n >((isHighlighted) => {\n setIsSideNavToggleHighlighted(isHighlighted);\n }, []);\n\n return (\n <StyledSideNavContainer\n aria-label={t(\"navigation.label\")}\n backgroundColor={uiShellContext?.sideNavBackgroundColor}\n hasNeighboringContent={hasNeighboringContent}\n id=\"side-nav-expandable\"\n isAppContentWhiteBackground={\n uiShellContext?.appBackgroundColor ===\n odysseyDesignTokens.HueNeutralWhite\n }\n isSideNavCollapsed={isSideNavCollapsed}\n isSideNavToggleHighlighted={isSideNavToggleHighlighted}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={sideNavRef}\n >\n {isCollapsible && (\n <StyledSideNavToggleButtonContainer\n hasNeighboringContent={hasNeighboringContent}\n isSideNavCollapsed={isSideNavCollapsed}\n isSideNavToggleHighlighted={isSideNavToggleHighlighted}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <SideNavToggleButton\n clickAreaPadding={\n isSideNavCollapsed && !hasNeighboringContent\n ? SIDE_NAV_TOGGLE_ICON_SIZE / 2\n : 0\n }\n ariaControls=\"side-nav-expandable\"\n isSideNavCollapsed={isSideNavCollapsed}\n onClick={sideNavExpandClickHandler}\n onHighlight={onSideNavToggleButtonHighlight}\n onKeyDown={sideNavExpandKeyHandler}\n />\n </StyledSideNavToggleButtonContainer>\n )}\n\n <OdysseyThemeProvider>\n <StyledCollapsibleContent\n data-se=\"collapsible-region\"\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <StyledOpacityTransitionContainer\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {appName || isLoading || logoProps ? (\n <StyledSideNavHeaderContainer\n hasContentScrolled={hasContentScrolled}\n odysseyDesignTokens={odysseyDesignTokens}\n borderColor={uiShellContext?.sideNavContrastColors?.fontColor}\n >\n {isLoading && !appName && !logoProps ? (\n <SideNavHeader isLoading={isLoading} />\n ) : (\n <SideNavHeader\n appName={appName}\n isLoading={isLoading}\n logoProps={logoProps}\n />\n )}\n </StyledSideNavHeaderContainer>\n ) : (\n <div />\n )}\n\n <StyledSideNavScrollableContainer\n odysseyDesignTokens={odysseyDesignTokens}\n data-se=\"scrollable-region\"\n >\n <StyledSideNavListContainer\n role=\"none\"\n ref={scrollableContentRef}\n >\n {isLoading\n ? Array(6)\n .fill(null)\n .map((_, index) => <LoadingItem key={index} />)\n : processedSideNavItems?.map((item) => {\n const {\n childNavItems,\n href,\n id,\n isDefaultExpanded,\n isDisabled,\n isExpanded,\n isSectionHeader,\n isSortable,\n label,\n startIcon,\n } = item;\n\n if (isSectionHeader) {\n return (\n <ErrorBoundary fallback={blankElement} key={id}>\n <StyledSectionHeaderContainer\n contrastFontColor={\n uiShellContext?.sideNavContrastColors?.fontColor\n }\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Overline component=\"h3\">{label}</Overline>\n </StyledSectionHeaderContainer>\n </ErrorBoundary>\n );\n } else if (childNavItems) {\n const nestedChildren = (\n <StyledSideNavListContainer role=\"presentation\">\n {isSortable ? (\n <SortableList\n parentId={item.id}\n items={childNavItems}\n onChange={setSortedItems}\n renderItem={(sortableItem) => (\n <SortableList.Item\n id={sortableItem.id}\n isDisabled={sortableItem.isDisabled}\n isSelected={sortableItem.isSelected}\n isSortable={sortableItem.isSortable}\n >\n {sortableItem.navItem}\n </SortableList.Item>\n )}\n />\n ) : (\n childNavItems.map((item) => item.navItem)\n )}\n </StyledSideNavListContainer>\n );\n\n return href ? (\n <ErrorBoundary fallback={blankElement} key={id}>\n <SideNavItemContent\n {...item}\n href={href}\n onItemSelected={setSelectedItem}\n scrollRef={getRefIfThisIsFirstNodeWithIsSelected(\n item.id,\n )}\n startIcon={item.startIcon}\n />\n\n <StyledSideNavListItem\n id={`${id}-items`}\n odysseyDesignTokens={odysseyDesignTokens}\n disabled={isDisabled}\n aria-disabled={isDisabled}\n >\n {nestedChildren}\n </StyledSideNavListItem>\n </ErrorBoundary>\n ) : (\n <ErrorBoundary fallback={blankElement} key={id}>\n <StyledSideNavListItem\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n disabled={isDisabled}\n aria-disabled={isDisabled}\n >\n <NavAccordion\n label={label}\n isCompact={isCompact}\n isDefaultExpanded={isDefaultExpanded}\n isExpanded={isExpanded}\n startIcon={startIcon}\n isDisabled={isDisabled}\n >\n {nestedChildren}\n </NavAccordion>\n </StyledSideNavListItem>\n </ErrorBoundary>\n );\n } else {\n return (\n <ErrorBoundary fallback={blankElement} key={item.id}>\n <SideNavItemContentContext.Provider\n value={sideNavItemContentProviderValue}\n >\n <SideNavItemContent\n {...item}\n onItemSelected={setSelectedItem}\n scrollRef={getRefIfThisIsFirstNodeWithIsSelected(\n item.id,\n )}\n startIcon={item.startIcon}\n />\n </SideNavItemContentContext.Provider>\n </ErrorBoundary>\n );\n }\n })}\n </StyledSideNavListContainer>\n {!isLoading && footerItems && !hasCustomFooter && (\n <StyledSideNavFooter\n odysseyDesignTokens={odysseyDesignTokens}\n sideNavBackgroundColor={\n uiShellContext?.sideNavBackgroundColor\n }\n >\n <StyledSideNavFooterItemsContainer\n odysseyDesignTokens={odysseyDesignTokens}\n sideNavContrastColors={\n uiShellContext?.sideNavContrastColors\n }\n >\n <SideNavFooterContent footerItems={footerItems} />\n </StyledSideNavFooterItemsContainer>\n </StyledSideNavFooter>\n )}\n </StyledSideNavScrollableContainer>\n {!isLoading && !footerItems && hasCustomFooter && (\n <StyledPersistentSideNavFooter\n isContentScrollable={isContentScrollable}\n odysseyDesignTokens={odysseyDesignTokens}\n sideNavBackgroundColor={uiShellContext?.sideNavBackgroundColor}\n >\n {footerComponent}\n </StyledPersistentSideNavFooter>\n )}\n </StyledOpacityTransitionContainer>\n </StyledCollapsibleContent>\n </OdysseyThemeProvider>\n </StyledSideNavContainer>\n );\n};\n\nconst MemoizedSideNav = memo(SideNav);\nMemoizedSideNav.displayName = \"SideNav\";\n\nexport { MemoizedSideNav as SideNav };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,IAAI,EACJC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,SAAS,QAGJ,OAAO;AAEd,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,SAAS,QAAQ,mBAAmB;AAE7C,SAASC,aAAa,QAAQ,sBAAsB;AAIpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAEEC,sBAAsB,QACjB,qCAA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BAAuB;YAAAuB,QAAA,EAE9DK;UAAe,CACa,CAChC;QAAA,CAC+B;MAAC,CACX;IAAC,CACP,CAAC;EAAA,CACD,CAAC;AAE7B,CAAC;AAED,MAAMqI,eAAe,GAAGvQ,IAAI,CAACgI,OAAO,CAAC;AACrCuI,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIvI,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"SideNav.js","names":["styled","memo","useMemo","useState","useCallback","useRef","useEffect","useTranslation","arrayMove","ErrorBoundary","NavAccordion","useOdysseyDesignTokens","OdysseyThemeProvider","SideNavHeader","SideNavItemContent","StyledSideNavListItem","SideNavFooterContent","SideNavItemContentContext","SIDE_NAV_TOGGLE_ICON_HALF_SIZE","SIDE_NAV_TOGGLE_ICON_SIZE","SideNavToggleButton","SortableList","Overline","useUiShellContext","SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION","SIDE_NAV_WIDTH","UI_SHELL_BASE_Z_INDEX","UI_SHELL_OVERLAY_Z_INDEX","useIsSideNavCollapsedSessionStorage","useMountLifecycleEffect","jsx","_jsx","jsxs","_jsxs","SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED","SIDE_NAV_COLLAPSED_PADDING_UNHIGHLIGHTED","StyledCollapsibleContent","shouldForwardProp","prop","odysseyDesignTokens","isSideNavCollapsed","position","display","gridTemplateColumns","height","transition","TransitionDurationMain","transitionTimingFunction","TransitionTimingMain","overflow","opacity","StyledOpacityTransitionContainer","gridTemplateRows","StyledSideNavContainer","backgroundColor","hasNeighboringContent","isAppContentWhiteBackground","isSideNavToggleHighlighted","HueNeutralWhite","width","content","pointerEvents","right","BorderWidthMain","top","userSelect","zIndex","BorderColorPrimaryControl","HueNeutral100","HueNeutral200","transform","borderRightColor","borderRightStyle","BorderStyleMain","borderRightWidth","StyledSideNavToggleButtonContainer","StyledSideNavHeaderContainer","borderColor","hasContentScrolled","flexShrink","borderBottomWidth","borderBottomStyle","borderBottomColor","concat","StyledSideNavListContainer","padding","listStyle","listStyleType","margin","StyledSideNavScrollableContainer","overflowY","paddingInline","Spacing2","StyledSectionHeaderContainer","contrastFontColor","color","HueNeutral600","marginBlock","Spacing3","paddingBlock","Spacing1","Spacing4","StyledSideNavFooter","sideNavBackgroundColor","StyledPersistentSideNavFooter","isContentScrollable","transitionProperty","transitionDuration","transitionTiming","boxShadow","StyledSideNavFooterItemsContainer","sideNavContrastColors","flexWrap","alignItems","fontSize","TypographySizeOverline","fontColor","textDecoration","HueNeutral900","StyledLoadingItemContainer","gap","getHasScrollableContent","scrollableContainer","scrollHeight","clientHeight","LoadingItem","children","_Skeleton","variant","SideNav","appName","footerComponent","footerItems","hasCustomFooter","isCollapsible","isCollapsed","isCompact","isLoading","isObtrusive","logoProps","onCollapse","onExpand","onSort","sideNavItems","setHasContentScrolled","setHasNeighboringContent","setIsContentScrollable","setIsSideNavToggleHighlighted","sideNavItemsList","updateSideNavItemsList","sessionState","setSessionState","setIsSideNavCollapsed","uiShellContext","t","scrollableContentRef","resizeObserverRef","intersectionObserverRef","sideNavRef","blankElement","current","getBoundingClientRect","x","onMount","onUpdate","updateIsContentScrollable","parentElement","resizeObserverDebounceTimer","ResizeObserver","cancelAnimationFrame","requestAnimationFrame","observe","IntersectionObserver","entries","isIntersecting","slice","sort","a","b","time","at","root","threshold","ulElement","liElement","Array","from","disconnect","scrollIntoViewRef","firstSideNavItemIdWithIsSelected","flattenedItems","flatMap","sideNavItem","nestedNavItems","firstItemWithIsSelected","find","isSelected","id","scrollIntoView","getRefIfThisIsFirstNodeWithIsSelected","itemId","undefined","sideNavItemContentProviderValue","depth","setSelectedItem","selectedItemId","updatedSideNavItems","map","item","childItem","closeSideNavMenu","processedSideNavItems","childNavItems","childProps","isDisabled","isSortable","navItem","Provider","value","onItemSelected","scrollRef","translate","sideNavExpandClickHandler","sideNavExpandKeyHandler","event","key","code","preventDefault","unsubscribe","subscribeToCloseSideNavMenu","setSortedItems","parentId","activeId","activeIndex","overIndex","sortedSideNavItems","onSideNavToggleButtonHighlight","isHighlighted","appBackgroundColor","ref","clickAreaPadding","ariaControls","onClick","onHighlight","onKeyDown","role","fill","_","index","href","isDefaultExpanded","isExpanded","isSectionHeader","label","startIcon","fallback","component","nestedChildren","items","onChange","renderItem","sortableItem","Item","disabled","MemoizedSideNav","displayName"],"sources":["../../../../src/ui-shell/SideNav/SideNav.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n memo,\n useMemo,\n useState,\n useCallback,\n useRef,\n useEffect,\n KeyboardEventHandler,\n CSSProperties,\n} from \"react\";\nimport { Skeleton } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\nimport { arrayMove } from \"@dnd-kit/sortable\";\nimport { UniqueIdentifier } from \"@dnd-kit/core\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { Property } from \"csstype\";\n\nimport { ContrastColors } from \"../../createContrastColors.js\";\nimport { NavAccordion } from \"./NavAccordion.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../../OdysseyDesignTokensContext.js\";\nimport { OdysseyThemeProvider } from \"../../OdysseyThemeProvider.js\";\nimport type { SideNavProps } from \"./types.js\";\nimport { SideNavHeader } from \"./SideNavHeader.js\";\nimport {\n SideNavItemContent,\n StyledSideNavListItem,\n} from \"./SideNavItemContent.js\";\nimport { SideNavFooterContent } from \"./SideNavFooterContent.js\";\nimport { SideNavItemContentContext } from \"./SideNavItemContentContext.js\";\nimport {\n SIDE_NAV_TOGGLE_ICON_HALF_SIZE,\n SIDE_NAV_TOGGLE_ICON_SIZE,\n SideNavToggleButton,\n SideNavToggleButtonProps,\n} from \"./SideNavToggleButton.js\";\nimport { SortableList } from \"./SortableList/SortableList.js\";\nimport { Overline } from \"../../Typography.js\";\nimport {\n UiShellColors,\n useUiShellContext,\n} from \"../../ui-shell/UiShellProvider.js\";\nimport {\n SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION,\n SIDE_NAV_WIDTH,\n UI_SHELL_BASE_Z_INDEX,\n UI_SHELL_OVERLAY_Z_INDEX,\n} from \"../uiShellSharedConstants.js\";\nimport { useIsSideNavCollapsedSessionStorage } from \"./useIsSideNavCollapsedSessionStorage.js\";\nimport { useMountLifecycleEffect } from \"../../useMountLifecycleEffect.js\";\n\nexport const SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED = 12;\nexport const SIDE_NAV_COLLAPSED_PADDING_UNHIGHLIGHTED = 2;\n\nconst StyledCollapsibleContent = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})<{\n odysseyDesignTokens: DesignTokens;\n isSideNavCollapsed: boolean;\n}>(({ odysseyDesignTokens, isSideNavCollapsed }) => ({\n position: \"relative\",\n display: \"grid\",\n gridTemplateColumns: SIDE_NAV_WIDTH,\n height: \"100%\",\n transition: `grid-template-columns ${odysseyDesignTokens.TransitionDurationMain}, opacity 300ms`,\n transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain,\n overflow: \"hidden\",\n\n ...(isSideNavCollapsed &&\n ({\n gridTemplateColumns: 0,\n opacity: 0,\n } satisfies CSSProperties)),\n}));\n\nconst StyledOpacityTransitionContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isSideNavCollapsed\",\n})(\n ({\n odysseyDesignTokens,\n isSideNavCollapsed,\n }: {\n odysseyDesignTokens: DesignTokens;\n isSideNavCollapsed: boolean;\n }) => ({\n display: \"grid\",\n gridTemplateRows: \"max-content 1fr max-content\",\n height: \"100%\",\n transition: `opacity 50ms`,\n transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain,\n overflow: \"hidden\",\n\n ...(isSideNavCollapsed &&\n ({\n opacity: 0,\n } satisfies CSSProperties)),\n }),\n);\n\nconst StyledSideNavContainer = styled(\"nav\", {\n shouldForwardProp: (prop) =>\n prop !== \"backgroundColor\" &&\n prop !== \"hasNeighboringContent\" &&\n prop !== \"isAppContentWhiteBackground\" &&\n prop !== \"isSideNavCollapsed\" &&\n prop !== \"isSideNavToggleHighlighted\" &&\n prop !== \"odysseyDesignTokens\",\n})<{\n backgroundColor?: UiShellColors[\"sideNavBackgroundColor\"];\n hasNeighboringContent: boolean;\n isAppContentWhiteBackground: boolean;\n isSideNavCollapsed: boolean;\n isSideNavToggleHighlighted: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n backgroundColor,\n hasNeighboringContent,\n isAppContentWhiteBackground,\n isSideNavCollapsed,\n isSideNavToggleHighlighted,\n odysseyDesignTokens,\n }) => ({\n // Side nav container styles\n backgroundColor: backgroundColor || odysseyDesignTokens.HueNeutralWhite,\n height: \"100%\",\n position: \"relative\",\n width: \"fit-content\",\n\n // Right-side vertical line shared\n \"&::before, &::after\": {\n content: \"''\",\n height: \"100%\",\n pointerEvents: \"none\",\n position: \"absolute\",\n right: `-${odysseyDesignTokens.BorderWidthMain}`,\n top: 0,\n transition: `opacity ${odysseyDesignTokens.TransitionDurationMain}, transform ${odysseyDesignTokens.TransitionDurationMain}, width ${odysseyDesignTokens.TransitionDurationMain}`,\n userSelect: \"none\",\n zIndex: UI_SHELL_OVERLAY_Z_INDEX,\n },\n\n // Right-side vertical line when open\n \"&::before\": {\n backgroundColor: isSideNavToggleHighlighted\n ? odysseyDesignTokens.BorderColorPrimaryControl\n : odysseyDesignTokens.HueNeutral100,\n opacity:\n isAppContentWhiteBackground ||\n (!isSideNavCollapsed && isSideNavToggleHighlighted)\n ? 1\n : 0,\n width: `calc(${odysseyDesignTokens.BorderWidthMain} * 2)`,\n },\n\n // Side nav vertical fill line when no neighboring content\n \"&::after\": {\n backgroundColor: odysseyDesignTokens.HueNeutral200,\n opacity: isSideNavCollapsed ? 1 : 0,\n transform:\n isSideNavCollapsed && !hasNeighboringContent\n ? isSideNavToggleHighlighted\n ? `translateX(calc(100% - (${odysseyDesignTokens.BorderWidthMain} * 2)))`\n : `translateX(calc(100% - ${SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED}px))`\n : \"translateX(0)\",\n width: hasNeighboringContent\n ? 0\n : `calc(${SIDE_NAV_TOGGLE_ICON_HALF_SIZE + SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED}px + ${odysseyDesignTokens.BorderWidthMain} * 2)`,\n\n // Right-side vertical line when collapsed\n ...((isSideNavCollapsed && isSideNavToggleHighlighted\n ? {\n borderRightColor: odysseyDesignTokens.BorderColorPrimaryControl,\n borderRightStyle:\n odysseyDesignTokens.BorderStyleMain as Property.BorderRightStyle,\n borderRightWidth: `calc(${odysseyDesignTokens.BorderWidthMain} * 2)`,\n }\n : {}) satisfies CSSProperties),\n },\n }),\n);\n\nconst StyledSideNavToggleButtonContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"hasNeighboringContent\" &&\n prop !== \"isSideNavCollapsed\" &&\n prop !== \"isSideNavToggleHighlighted\" &&\n prop !== \"odysseyDesignTokens\",\n})<{\n hasNeighboringContent: boolean;\n isSideNavCollapsed: boolean;\n isSideNavToggleHighlighted: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n ({\n hasNeighboringContent,\n isSideNavCollapsed,\n isSideNavToggleHighlighted,\n odysseyDesignTokens,\n }) => ({\n position: \"absolute\",\n right: `${SIDE_NAV_TOGGLE_ICON_HALF_SIZE}px`,\n top: SIDE_NAV_VISIBILITY_TOGGLE_ICON_POSITION,\n transform:\n isSideNavCollapsed && !hasNeighboringContent\n ? isSideNavToggleHighlighted\n ? `translate3d(calc(100% + ${SIDE_NAV_TOGGLE_ICON_HALF_SIZE + SIDE_NAV_COLLAPSED_PADDING_HIGHLIGHTED}px), 0, 0)`\n : `translate3d(calc(100% + ${SIDE_NAV_TOGGLE_ICON_HALF_SIZE + SIDE_NAV_COLLAPSED_PADDING_UNHIGHLIGHTED}px), 0, 0)`\n : \"translate3d(100%, 0, 0)\",\n transition: `transform ${odysseyDesignTokens.TransitionDurationMain}`,\n zIndex: UI_SHELL_OVERLAY_Z_INDEX + 1,\n }),\n);\n\nconst StyledSideNavHeaderContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"borderColor\" &&\n prop !== \"hasContentScrolled\" &&\n prop !== \"odysseyDesignTokens\",\n})<{\n borderColor: ContrastColors[\"fontColor\"];\n hasContentScrolled: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ borderColor, hasContentScrolled, odysseyDesignTokens }) => ({\n flexShrink: 0,\n // The bottom border should appear only if the scrollable region has been scrolled\n ...(hasContentScrolled &&\n ({\n borderBottomWidth: odysseyDesignTokens.BorderWidthMain,\n borderBottomStyle: odysseyDesignTokens.BorderStyleMain,\n borderBottomColor: odysseyDesignTokens.HueNeutral100,\n\n ...(borderColor &&\n ({\n borderBottomColor: borderColor.concat(\"15\"),\n } satisfies CSSProperties)),\n } as CSSProperties)),\n}));\n\nconst StyledSideNavListContainer = styled(\"ul\")(() => ({\n padding: 0,\n listStyle: \"none\",\n listStyleType: \"none\",\n margin: 0,\n width: \"100%\",\n}));\n\nconst StyledSideNavScrollableContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"inline-grid\",\n gridTemplateRows: \"1fr max-content\",\n overflowY: \"auto\",\n paddingInline: odysseyDesignTokens.Spacing2,\n}));\n\nconst StyledSectionHeaderContainer = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"contrastFontColor\",\n})(\n ({\n contrastFontColor,\n odysseyDesignTokens,\n }: {\n contrastFontColor: ContrastColors[\"fontColor\"];\n odysseyDesignTokens: DesignTokens;\n }) => ({\n color: contrastFontColor || odysseyDesignTokens.HueNeutral600,\n marginBlock: `${odysseyDesignTokens.Spacing3}`,\n paddingBlock: odysseyDesignTokens.Spacing1,\n paddingInline: odysseyDesignTokens.Spacing4,\n }),\n);\n\nconst StyledSideNavFooter = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"sideNavBackgroundColor\",\n})(\n ({\n odysseyDesignTokens,\n sideNavBackgroundColor,\n }: {\n odysseyDesignTokens: DesignTokens;\n sideNavBackgroundColor?: UiShellColors[\"sideNavBackgroundColor\"];\n }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n flexShrink: 0,\n padding: odysseyDesignTokens.Spacing4,\n\n ...(sideNavBackgroundColor &&\n ({\n backgroundColor: sideNavBackgroundColor,\n } satisfies CSSProperties)),\n }),\n);\n\nconst StyledPersistentSideNavFooter = styled(StyledSideNavFooter, {\n shouldForwardProp: (prop) =>\n prop !== \"isContentScrollable\" &&\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"sideNavBackgroundColor\",\n})(\n ({\n isContentScrollable,\n odysseyDesignTokens,\n sideNavBackgroundColor,\n }: {\n isContentScrollable: boolean;\n odysseyDesignTokens: DesignTokens;\n sideNavBackgroundColor?: UiShellColors[\"sideNavBackgroundColor\"];\n }) => ({\n transitionProperty: \"box-shadow\",\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n transitionTiming: odysseyDesignTokens.TransitionTimingMain,\n zIndex: UI_SHELL_BASE_Z_INDEX,\n\n // The box shadow should appear above the footer only if the scrollable region has overflow\n ...(isContentScrollable &&\n ({\n boxShadow: \"0px -8px 8px -8px rgba(39, 39, 39, 0.08)\",\n } satisfies CSSProperties)),\n\n ...(sideNavBackgroundColor &&\n ({\n backgroundColor: sideNavBackgroundColor,\n } satisfies CSSProperties)),\n }),\n);\n\nconst StyledSideNavFooterItemsContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"sideNavContrastColors\",\n})<{\n odysseyDesignTokens: DesignTokens;\n sideNavContrastColors: UiShellColors[\"sideNavContrastColors\"];\n}>(({ odysseyDesignTokens, sideNavContrastColors }) => ({\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n fontSize: odysseyDesignTokens.TypographySizeOverline,\n\n \"a, span\": {\n color: odysseyDesignTokens.HueNeutral600,\n transition: `color ${odysseyDesignTokens.TransitionDurationMain}`,\n\n \"&:visited\": {\n color: odysseyDesignTokens.HueNeutral600,\n\n ...(sideNavContrastColors?.fontColor &&\n ({\n color: sideNavContrastColors?.fontColor,\n } satisfies CSSProperties)),\n },\n\n \"&:hover\": {\n textDecoration: \"none\",\n color: odysseyDesignTokens.HueNeutral900,\n\n ...(sideNavContrastColors?.fontColor &&\n ({\n color: sideNavContrastColors?.fontColor,\n } satisfies CSSProperties)),\n },\n\n ...(sideNavContrastColors?.fontColor &&\n ({\n color: sideNavContrastColors?.fontColor,\n } satisfies CSSProperties)),\n },\n}));\n\nconst StyledLoadingItemContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n alignItems: \"center\",\n display: \"flex\",\n gap: odysseyDesignTokens.Spacing2,\n paddingBlock: odysseyDesignTokens.Spacing2,\n paddingInline: odysseyDesignTokens.Spacing4,\n}));\n\nconst getHasScrollableContent = (scrollableContainer: HTMLElement) =>\n scrollableContainer.scrollHeight > scrollableContainer.clientHeight;\n\nconst LoadingItem = () => {\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n return (\n <StyledLoadingItemContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Skeleton\n variant=\"circular\"\n width={odysseyDesignTokens.Spacing4}\n height={odysseyDesignTokens.Spacing4}\n />\n <Skeleton variant=\"rounded\" width=\"100%\" />\n </StyledLoadingItemContainer>\n );\n};\n\nconst SideNav = ({\n appName,\n footerComponent,\n footerItems,\n hasCustomFooter,\n isCollapsible,\n isCollapsed = false,\n isCompact,\n isLoading,\n isObtrusive,\n logoProps,\n onCollapse,\n onExpand,\n onSort,\n sideNavItems,\n}: SideNavProps) => {\n const [hasContentScrolled, setHasContentScrolled] = useState(false);\n const [hasNeighboringContent, setHasNeighboringContent] = useState(false);\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const [isSideNavToggleHighlighted, setIsSideNavToggleHighlighted] =\n useState(false);\n const [sideNavItemsList, updateSideNavItemsList] = useState(sideNavItems);\n\n const {\n sessionState: isSideNavCollapsed,\n setSessionState: setIsSideNavCollapsed,\n } = useIsSideNavCollapsedSessionStorage(isCollapsed);\n\n const uiShellContext = useUiShellContext();\n const odysseyDesignTokens: DesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const scrollableContentRef = useRef<HTMLUListElement>(null);\n const resizeObserverRef = useRef<ResizeObserver | null>(null);\n const intersectionObserverRef = useRef<IntersectionObserver | null>(null);\n const sideNavRef = useRef<HTMLDivElement>(null);\n\n const blankElement = useMemo(() => <div />, []);\n\n // The default value (sideNavItems) passed to useState is ONLY used by the useState hook for\n // the very first value. Subsequent updates to the prop (sideNavItems) need to cause the state\n // to update!\n useEffect(() => updateSideNavItemsList(sideNavItems), [sideNavItems]);\n\n // update sidenav collapse status\n useEffect(() => {\n if (sideNavRef.current) {\n setHasNeighboringContent(\n sideNavRef.current.getBoundingClientRect().x > 0,\n );\n }\n // We want this listening to `isCollapsed`.\n }, [isCollapsed]);\n\n // In the case that you can't control the side nav, then it should use whatever state was passed (app control) rather than what's stored in session storage (user control).\n const onMount = useCallback(() => {\n if (!isCollapsible) {\n setIsSideNavCollapsed(isCollapsed);\n }\n }, [isCollapsed, isCollapsible, setIsSideNavCollapsed]);\n\n const onUpdate = useCallback(() => {\n setIsSideNavCollapsed(isCollapsed);\n }, [isCollapsed, setIsSideNavCollapsed]);\n\n useMountLifecycleEffect({\n onMount,\n onUpdate,\n });\n\n useEffect(() => {\n // This is called directly in this effect AND perhaps as a result of the ResizeObserver\n const updateIsContentScrollable = () => {\n if (\n scrollableContentRef.current &&\n scrollableContentRef.current.parentElement\n ) {\n setIsContentScrollable(\n getHasScrollableContent(scrollableContentRef.current.parentElement),\n );\n }\n };\n\n // If the window is resized, we may need to re-determine if the scrollable container has overflow\n // Setup a ResizeObserver to know if the size of the scrollableContent changes\n let resizeObserverDebounceTimer: ReturnType<typeof requestAnimationFrame>;\n if (!resizeObserverRef.current) {\n resizeObserverRef.current = new ResizeObserver(() => {\n cancelAnimationFrame(resizeObserverDebounceTimer);\n resizeObserverDebounceTimer = requestAnimationFrame(\n updateIsContentScrollable,\n );\n });\n }\n\n if (resizeObserverRef.current && scrollableContentRef.current) {\n // Observe the <ul> itself (in case it changes size due to the content expanding)\n resizeObserverRef.current.observe(scrollableContentRef.current);\n if (scrollableContentRef.current.parentElement) {\n // ALSO observe the parent (<SideNavScrollableContainer>) in case the window resizes\n resizeObserverRef.current.observe(\n scrollableContentRef.current.parentElement,\n );\n }\n }\n\n // Determine if the scrollable container has overflow or not on load\n updateIsContentScrollable();\n\n // Finally, we only want to have the border on the bottom of the header iff the user has scrolled\n // the scrollable container\n if (!intersectionObserverRef.current && scrollableContentRef.current) {\n intersectionObserverRef.current = new IntersectionObserver(\n (entries) => {\n // If isIntersecting is true, then we're at the top of the scroll container\n // If isIntersecting is false, some scrolling has occurred.\n // The entries must be sorted by time and we only really need to look at the latest one\n const isIntersecting = entries\n .slice()\n .sort((a, b) => a.time - b.time)\n .at(0)?.isIntersecting;\n setHasContentScrolled(!isIntersecting);\n },\n {\n root: scrollableContentRef.current.parentElement,\n threshold: 1.0,\n },\n );\n }\n\n if (intersectionObserverRef.current && scrollableContentRef.current) {\n const ulElement = scrollableContentRef.current;\n const [liElement] = Array.from(ulElement?.children || []);\n\n if (liElement) {\n intersectionObserverRef.current.observe(liElement);\n }\n }\n\n // Cleanup when unmounted:\n return () => {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n resizeObserverRef.current = null;\n }\n if (intersectionObserverRef.current) {\n intersectionObserverRef.current.disconnect();\n intersectionObserverRef.current = null;\n }\n cancelAnimationFrame(resizeObserverDebounceTimer); // Ensure timer is cleared on component unmount\n };\n }, [sideNavItemsList]);\n\n const scrollIntoViewRef = useRef<HTMLLIElement>(null);\n /**\n * Look through the sideNavItems and determine which is the first node\n * with isSelected. This should be the node we set a ref on in order to\n * call scrollIntoView in the effect\n */\n const firstSideNavItemIdWithIsSelected = useMemo(() => {\n const flattenedItems = sideNavItemsList.flatMap((sideNavItem) =>\n sideNavItem.nestedNavItems\n ? [sideNavItem, ...sideNavItem.nestedNavItems]\n : sideNavItem,\n );\n const firstItemWithIsSelected = flattenedItems.find(\n (sideNavItem) => sideNavItem.isSelected,\n );\n return firstItemWithIsSelected?.id;\n }, [sideNavItemsList]);\n /**\n * Once we've rendered and if we have an item to scroll to, do the scroll action.\n * This must rely on checking firstSideNavItemIdWithIsSelected or it will not run\n * once the actual ref is populated.\n */\n useEffect(() => {\n if (firstSideNavItemIdWithIsSelected && scrollIntoViewRef.current) {\n scrollIntoViewRef.current.scrollIntoView();\n }\n }, [firstSideNavItemIdWithIsSelected]);\n\n /**\n * We only want to put a ref on a node iff it is the first selected node.\n * This function returns the ref only if the ID provided matches the first\n * selected node, otherwise returns undefined (so that the node has no ref)\n */\n const getRefIfThisIsFirstNodeWithIsSelected = useCallback(\n (itemId: string) =>\n itemId === firstSideNavItemIdWithIsSelected\n ? scrollIntoViewRef\n : undefined,\n [firstSideNavItemIdWithIsSelected],\n );\n\n const sideNavItemContentProviderValue = useMemo(\n () => ({ isCompact, depth: 1 }),\n [isCompact],\n );\n\n const setSelectedItem = useCallback(\n (selectedItemId: string) => {\n const updatedSideNavItems = sideNavItemsList.map((item) => {\n if (item.id === selectedItemId) {\n item.isSelected = true;\n } else if (item.isSelected) {\n delete item.isSelected;\n }\n\n return item.nestedNavItems\n ? {\n ...item,\n nestedNavItems: item.nestedNavItems.map((childItem) => {\n if (childItem.id === selectedItemId) {\n childItem.isSelected = true;\n } else if (childItem.isSelected) {\n delete childItem.isSelected;\n }\n return childItem;\n }),\n }\n : item;\n });\n updateSideNavItemsList(updatedSideNavItems);\n\n if (isCollapsed || isObtrusive) {\n if (isCollapsible) {\n uiShellContext?.closeSideNavMenu();\n } else {\n onCollapse?.();\n }\n }\n },\n [\n isCollapsed,\n isCollapsible,\n isObtrusive,\n onCollapse,\n sideNavItemsList,\n uiShellContext,\n ],\n );\n\n const processedSideNavItems = useMemo(() => {\n return sideNavItemsList?.map((item) => ({\n ...item,\n childNavItems: item.nestedNavItems?.map((childProps) => ({\n id: childProps.id,\n isSelected: childProps.isSelected,\n isDisabled: childProps.isDisabled,\n isSortable: childProps.isSortable,\n navItem: (\n <SideNavItemContentContext.Provider\n key={childProps.id}\n value={{\n ...sideNavItemContentProviderValue,\n depth: 2,\n isSortable: item.isSortable,\n }}\n >\n <SideNavItemContent\n {...childProps}\n onItemSelected={setSelectedItem}\n scrollRef={getRefIfThisIsFirstNodeWithIsSelected(childProps.id)}\n translate={childProps.translate}\n />\n </SideNavItemContentContext.Provider>\n ),\n })),\n }));\n }, [\n getRefIfThisIsFirstNodeWithIsSelected,\n setSelectedItem,\n sideNavItemContentProviderValue,\n sideNavItemsList,\n ]);\n\n const sideNavExpandClickHandler = useCallback(() => {\n setIsSideNavCollapsed((isSideNavCollapsed) => {\n if (isSideNavCollapsed) {\n onExpand?.();\n } else {\n onCollapse?.();\n }\n\n return !isSideNavCollapsed;\n });\n }, [onCollapse, onExpand, setIsSideNavCollapsed]);\n\n const sideNavExpandKeyHandler = useCallback<\n KeyboardEventHandler<HTMLButtonElement>\n >(\n (event) => {\n if (event?.key === \"Enter\" || event?.code === \"Space\") {\n event.preventDefault();\n sideNavExpandClickHandler();\n }\n },\n [sideNavExpandClickHandler],\n );\n\n useEffect(() => {\n const unsubscribe = uiShellContext?.subscribeToCloseSideNavMenu(() => {\n onCollapse?.();\n setIsSideNavCollapsed(true);\n });\n\n return () => {\n unsubscribe?.();\n };\n }, [onCollapse, setIsSideNavCollapsed, uiShellContext]);\n\n const setSortedItems = useCallback(\n (\n parentId: string,\n activeId: UniqueIdentifier,\n activeIndex: number,\n overIndex: number,\n ) => {\n const sortedSideNavItems = sideNavItemsList.map((item) =>\n item.id === parentId && item.nestedNavItems\n ? {\n ...item,\n nestedNavItems: arrayMove(\n item.nestedNavItems,\n activeIndex,\n overIndex,\n ),\n }\n : item,\n );\n updateSideNavItemsList(sortedSideNavItems);\n onSort?.(sortedSideNavItems, parentId, activeId, activeIndex, overIndex);\n },\n [onSort, sideNavItemsList],\n );\n\n const onSideNavToggleButtonHighlight = useCallback<\n NonNullable<SideNavToggleButtonProps[\"onHighlight\"]>\n >((isHighlighted) => {\n setIsSideNavToggleHighlighted(isHighlighted);\n }, []);\n\n return (\n <StyledSideNavContainer\n aria-label={t(\"navigation.label\")}\n backgroundColor={uiShellContext?.sideNavBackgroundColor}\n hasNeighboringContent={hasNeighboringContent}\n id=\"side-nav-expandable\"\n isAppContentWhiteBackground={\n uiShellContext?.appBackgroundColor ===\n odysseyDesignTokens.HueNeutralWhite\n }\n isSideNavCollapsed={isSideNavCollapsed}\n isSideNavToggleHighlighted={isSideNavToggleHighlighted}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={sideNavRef}\n >\n {isCollapsible && (\n <StyledSideNavToggleButtonContainer\n hasNeighboringContent={hasNeighboringContent}\n isSideNavCollapsed={isSideNavCollapsed}\n isSideNavToggleHighlighted={isSideNavToggleHighlighted}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <SideNavToggleButton\n clickAreaPadding={\n isSideNavCollapsed && !hasNeighboringContent\n ? SIDE_NAV_TOGGLE_ICON_SIZE / 2\n : 0\n }\n ariaControls=\"side-nav-expandable\"\n isSideNavCollapsed={isSideNavCollapsed}\n onClick={sideNavExpandClickHandler}\n onHighlight={onSideNavToggleButtonHighlight}\n onKeyDown={sideNavExpandKeyHandler}\n />\n </StyledSideNavToggleButtonContainer>\n )}\n\n <OdysseyThemeProvider>\n <StyledCollapsibleContent\n data-se=\"collapsible-region\"\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <StyledOpacityTransitionContainer\n isSideNavCollapsed={isSideNavCollapsed}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {appName || isLoading || logoProps ? (\n <StyledSideNavHeaderContainer\n hasContentScrolled={hasContentScrolled}\n odysseyDesignTokens={odysseyDesignTokens}\n borderColor={uiShellContext?.sideNavContrastColors?.fontColor}\n >\n {isLoading && !appName && !logoProps ? (\n <SideNavHeader isLoading={isLoading} />\n ) : (\n <SideNavHeader\n appName={appName}\n isLoading={isLoading}\n logoProps={logoProps}\n />\n )}\n </StyledSideNavHeaderContainer>\n ) : (\n <div />\n )}\n\n <StyledSideNavScrollableContainer\n odysseyDesignTokens={odysseyDesignTokens}\n data-se=\"scrollable-region\"\n >\n <StyledSideNavListContainer\n role=\"none\"\n ref={scrollableContentRef}\n >\n {isLoading\n ? Array(6)\n .fill(null)\n .map((_, index) => <LoadingItem key={index} />)\n : processedSideNavItems?.map((item) => {\n const {\n childNavItems,\n href,\n id,\n isDefaultExpanded,\n isDisabled,\n isExpanded,\n isSectionHeader,\n isSortable,\n label,\n startIcon,\n } = item;\n\n if (isSectionHeader) {\n return (\n <ErrorBoundary fallback={blankElement} key={id}>\n <StyledSectionHeaderContainer\n contrastFontColor={\n uiShellContext?.sideNavContrastColors?.fontColor\n }\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Overline component=\"h3\">{label}</Overline>\n </StyledSectionHeaderContainer>\n </ErrorBoundary>\n );\n } else if (childNavItems) {\n const nestedChildren = (\n <StyledSideNavListContainer role=\"presentation\">\n {isSortable ? (\n <SortableList\n parentId={item.id}\n items={childNavItems}\n onChange={setSortedItems}\n renderItem={(sortableItem) => (\n <SortableList.Item\n id={sortableItem.id}\n isDisabled={sortableItem.isDisabled}\n isSelected={sortableItem.isSelected}\n isSortable={sortableItem.isSortable}\n >\n {sortableItem.navItem}\n </SortableList.Item>\n )}\n />\n ) : (\n childNavItems.map((item) => item.navItem)\n )}\n </StyledSideNavListContainer>\n );\n\n return href ? (\n <ErrorBoundary fallback={blankElement} key={id}>\n <SideNavItemContent\n {...item}\n href={href}\n onItemSelected={setSelectedItem}\n scrollRef={getRefIfThisIsFirstNodeWithIsSelected(\n item.id,\n )}\n startIcon={item.startIcon}\n />\n\n <StyledSideNavListItem\n id={`${id}-items`}\n odysseyDesignTokens={odysseyDesignTokens}\n disabled={isDisabled}\n aria-disabled={isDisabled}\n >\n {nestedChildren}\n </StyledSideNavListItem>\n </ErrorBoundary>\n ) : (\n <ErrorBoundary fallback={blankElement} key={id}>\n <StyledSideNavListItem\n id={id}\n odysseyDesignTokens={odysseyDesignTokens}\n disabled={isDisabled}\n aria-disabled={isDisabled}\n >\n <NavAccordion\n label={label}\n isCompact={isCompact}\n isDefaultExpanded={isDefaultExpanded}\n isExpanded={isExpanded}\n startIcon={startIcon}\n isDisabled={isDisabled}\n >\n {nestedChildren}\n </NavAccordion>\n </StyledSideNavListItem>\n </ErrorBoundary>\n );\n } else {\n return (\n <ErrorBoundary fallback={blankElement} key={item.id}>\n <SideNavItemContentContext.Provider\n value={sideNavItemContentProviderValue}\n >\n <SideNavItemContent\n {...item}\n onItemSelected={setSelectedItem}\n scrollRef={getRefIfThisIsFirstNodeWithIsSelected(\n item.id,\n )}\n startIcon={item.startIcon}\n />\n </SideNavItemContentContext.Provider>\n </ErrorBoundary>\n );\n }\n })}\n </StyledSideNavListContainer>\n {!isLoading && footerItems && !hasCustomFooter && (\n <StyledSideNavFooter\n odysseyDesignTokens={odysseyDesignTokens}\n sideNavBackgroundColor={\n uiShellContext?.sideNavBackgroundColor\n }\n >\n <StyledSideNavFooterItemsContainer\n odysseyDesignTokens={odysseyDesignTokens}\n sideNavContrastColors={\n uiShellContext?.sideNavContrastColors\n }\n >\n <SideNavFooterContent footerItems={footerItems} />\n </StyledSideNavFooterItemsContainer>\n </StyledSideNavFooter>\n )}\n </StyledSideNavScrollableContainer>\n {!isLoading && !footerItems && hasCustomFooter && (\n <StyledPersistentSideNavFooter\n isContentScrollable={isContentScrollable}\n odysseyDesignTokens={odysseyDesignTokens}\n sideNavBackgroundColor={uiShellContext?.sideNavBackgroundColor}\n >\n {footerComponent}\n </StyledPersistentSideNavFooter>\n )}\n </StyledOpacityTransitionContainer>\n </StyledCollapsibleContent>\n </OdysseyThemeProvider>\n </StyledSideNavContainer>\n );\n};\n\nconst MemoizedSideNav = memo(SideNav);\nMemoizedSideNav.displayName = \"SideNav\";\n\nexport { MemoizedSideNav as SideNav };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,IAAI,EACJC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,MAAM,EACNC,SAAS,QAGJ,OAAO;AAEd,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,SAAS,QAAQ,mBAAmB;AAE7C,SAASC,aAAa,QAAQ,sBAAsB;AAIpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAEEC,sBAAsB,QACjB,qCAAqC;AAC5C,SAASC,oBAAoB,QAAQ,+BAA+B;AAEpE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACEC,kBAAkB,EAClBC,qBAAqB,QAChB,yBAAyB;AAChC,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SACEC,8BAA8B,EAC9BC,yBAAyB,EACzBC,mBAAmB,QAEd,0BAA0B;AACjC,SAASC,YAAY,QAAQ,gCAA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G,SAAS;AAEvC,SAASD,eAAe,IAAIvI,OAAO","ignoreList":[]}
@@ -31,7 +31,6 @@ const StyledAppContainer = styled("div", {
31
31
  }) => ({
32
32
  backgroundColor: appBackgroundColor,
33
33
  gridArea: "app-content",
34
- pointerEvents: "none",
35
34
  position: "relative"
36
35
  }));
37
36
  const StyledAppSwitcherContainer = styled("div")({
@@ -1 +1 @@
1
- {"version":3,"file":"WideUiShellContent.js","names":["styled","memo","useRef","ErrorBoundary","AppSwitcher","InnerAppContainer","useOdysseyDesignTokens","SideNav","TopNav","useScrollState","useMatchAppElementToUiShellAppArea","useUiShellContext","emptySideNavItems","jsx","_jsx","jsxs","_jsxs","appSwitcherDefaultAppIcons","StyledAppContainer","shouldForwardProp","prop","appBackgroundColor","backgroundColor","gridArea","pointerEvents","position","StyledAppSwitcherContainer","StyledBannersContainer","StyledSideNavContainer","StyledShellContainer","odysseyDesignTokens","HueNeutral50","display","gridGap","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","width","StyledTopNavContainer","WideUiShellContent","appElement","appElementScrollingMode","appSwitcherProps","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","optionalComponents","sideNavProps","topNavProps","uiShellContext","isContentScrolled","sideNavContainerRef","topNavContainerRef","uiShellAppAreaRef","parentContainerRef","paddingMode","uiShellResizableRefs","ref","children","banners","includes","fallback","appIcons","isLoading","selectedAppName","undefined","sideNavItems","hasCustomFooter","sideNavFooter","footerComponent","footerItems","leftSideComponent","topNavLeftSide","rightSideComponent","topNavRightSide","tabIndex","MemoizedWideUiShellContent","displayName"],"sources":["../../../src/ui-shell/WideUiShellContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, useRef } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { AppSwitcher } from \"./AppSwitcher/index.js\";\nimport { AppSwitcherAppIconData } from \"./AppSwitcher/AppSwitcherApp.js\";\nimport { InnerAppContainer } from \"./InnerAppContainer.js\";\nimport {\n useOdysseyDesignTokens,\n type DesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { SideNav } from \"./SideNav/index.js\";\nimport { TopNav } from \"./TopNav/index.js\";\nimport { useScrollState } from \"./useScrollState.js\";\nimport { useMatchAppElementToUiShellAppArea } from \"./useMatchAppElementToUiShellAppArea.js\";\nimport {\n UiShellNavComponentProps,\n UiShellContentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellColors, useUiShellContext } from \"./UiShellProvider.js\";\nimport { emptySideNavItems } from \"./uiShellSharedConstants.js\";\n\nconst appSwitcherDefaultAppIcons = [] satisfies AppSwitcherAppIconData[];\n\nconst StyledAppContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"appBackgroundColor\" && prop !== \"odysseyDesignTokens\",\n})<{\n appBackgroundColor?: UiShellColors[\"appBackgroundColor\"];\n}>(({ appBackgroundColor }) => ({\n backgroundColor: appBackgroundColor,\n gridArea: \"app-content\",\n pointerEvents: \"none\",\n position: \"relative\",\n}));\n\nconst StyledAppSwitcherContainer = styled(\"div\")({\n gridArea: \"app-switcher\",\n});\n\nconst StyledBannersContainer = styled(\"div\")({\n gridArea: \"banners\",\n});\n\nconst StyledSideNavContainer = styled(\"div\")({\n gridArea: \"side-nav\",\n});\n\nconst StyledShellContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n display: \"grid\",\n gridGap: 0,\n gridTemplateAreas: `\n \"banners banners banners\"\n \"app-switcher side-nav top-nav\"\n \"app-switcher side-nav app-content\"\n `,\n gridTemplateColumns: \"auto auto 1fr\",\n gridTemplateRows: \"auto auto 1fr\",\n height: \"100vh\",\n width: \"100vw\",\n}));\n\nconst StyledTopNavContainer = styled(\"div\")({\n gridArea: \"top-nav\",\n});\n\nexport type WideUiShellContentProps = UiShellNavComponentProps &\n UiShellContentProps;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst WideUiShellContent = ({\n appElement,\n appElementScrollingMode,\n appSwitcherProps,\n hasStandardAppContentPadding = true,\n initialVisibleSections = [\"TopNav\", \"SideNav\", \"AppSwitcher\"],\n onError = console.error,\n optionalComponents,\n sideNavProps,\n topNavProps,\n}: WideUiShellContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const uiShellContext = useUiShellContext();\n\n const { isContentScrolled } = useScrollState(appElement);\n\n const sideNavContainerRef = useRef<HTMLDivElement>(null);\n const topNavContainerRef = useRef<HTMLDivElement>(null);\n const uiShellAppAreaRef = useRef<HTMLDivElement>(null);\n\n const { parentContainerRef } = useMatchAppElementToUiShellAppArea({\n appElement,\n appElementScrollingMode,\n paddingMode: hasStandardAppContentPadding ? \"comfortable\" : \"none\",\n uiShellAppAreaRef,\n uiShellResizableRefs: [\n sideNavContainerRef,\n topNavContainerRef,\n uiShellAppAreaRef,\n ],\n });\n\n return (\n <StyledShellContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={parentContainerRef}\n >\n <StyledBannersContainer>\n {optionalComponents?.banners}\n </StyledBannersContainer>\n\n <StyledAppSwitcherContainer>\n {\n /* If AppSwitcher should be initially visible and we have not yet received props, render AppSwitcher in the loading state */\n initialVisibleSections?.includes(\"AppSwitcher\") &&\n !appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher\n appIcons={appSwitcherDefaultAppIcons}\n isLoading\n selectedAppName=\"\"\n />\n </ErrorBoundary>\n )\n }\n\n {appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher {...appSwitcherProps} />\n </ErrorBoundary>\n )}\n </StyledAppSwitcherContainer>\n\n <StyledSideNavContainer ref={sideNavContainerRef}>\n {\n /* If SideNav should be initially visible and we have not yet received props, render SideNav with minimal inputs */\n initialVisibleSections?.includes(\"SideNav\") &&\n sideNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav isLoading sideNavItems={emptySideNavItems} />\n </ErrorBoundary>\n )\n }\n\n {sideNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav\n {...{\n ...sideNavProps,\n ...(sideNavProps.hasCustomFooter &&\n optionalComponents?.sideNavFooter\n ? {\n footerComponent: optionalComponents.sideNavFooter,\n footerItems: undefined,\n hasCustomFooter: sideNavProps.hasCustomFooter,\n }\n : {\n footerItems: sideNavProps.footerItems,\n hasCustomFooter: false,\n }),\n }}\n />\n </ErrorBoundary>\n )}\n </StyledSideNavContainer>\n\n <StyledTopNavContainer ref={topNavContainerRef}>\n {\n /* If TopNav should be initially visible and we have not yet received props, render Topnav with minimal inputs */\n initialVisibleSections?.includes(\"TopNav\") &&\n topNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )\n }\n\n {topNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n {...topNavProps}\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )}\n </StyledTopNavContainer>\n\n <StyledAppContainer\n appBackgroundColor={uiShellContext?.appBackgroundColor}\n tabIndex={0}\n ref={uiShellAppAreaRef}\n >\n <InnerAppContainer isContentScrolled={isContentScrolled} />\n </StyledAppContainer>\n </StyledShellContainer>\n );\n};\n\nconst MemoizedWideUiShellContent = memo(WideUiShellContent);\nMemoizedWideUiShellContent.displayName = \"WideUiShellContent\";\n\nexport { MemoizedWideUiShellContent as WideUiShellContent };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,IAAI,EAAEC,MAAM,QAAQ,OAAO;AACpC,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SACEC,sBAAsB,QAEjB,kCAAkC;AACzC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,kCAAkC,QAAQ,yCAAyC;AAK5F,SAAwBC,iBAAiB,QAAQ,sBAAsB;AACvE,SAASC,iBAAiB,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,0BAA0B,GAAG,EAAqC;AAExE,MAAMC,kBAAkB,GAAGlB,MAAM,CAAC,KAAK,EAAE;EACvCmB,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,oBAAoB,IAAIA,IAAI,KAAK;AAC9C,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAmB,CAAC,MAAM;EAC9BC,eAAe,EAAED,kBAAkB;EACnCE,QAAQ,EAAE,aAAa;EACvBC,aAAa,EAAE,MAAM;EACrBC,QAAQ,EAAE;AACZ,CAAC,CAAC,CAAC;AAEH,MAAMC,0BAA0B,GAAG1B,MAAM,CAAC,KAAK,CAAC,CAAC;EAC/CuB,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEF,MAAMI,sBAAsB,GAAG3B,MA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AAkB,EAAE4B;QAAgB,CACzD;MAAC,CACW,CAChB;IAAA,CACoB,CAAC,EAExB/D,IAAA,CAACI,kBAAkB;MACjBG,kBAAkB,EAAE+B,cAAc,EAAE/B,kBAAmB;MACvDyD,QAAQ,EAAE,CAAE;MACZlB,GAAG,EAAEJ,iBAAkB;MAAAK,QAAA,EAEvB/C,IAAA,CAACT,iBAAiB;QAACgD,iBAAiB,EAAEA;MAAkB,CAAE;IAAC,CACzC,CAAC;EAAA,CACD,CAAC;AAE3B,CAAC;AAED,MAAM0B,0BAA0B,GAAG9E,IAAI,CAACuC,kBAAkB,CAAC;AAC3DuC,0BAA0B,CAACC,WAAW,GAAG,oBAAoB;AAE7D,SAASD,0BAA0B,IAAIvC,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"WideUiShellContent.js","names":["styled","memo","useRef","ErrorBoundary","AppSwitcher","InnerAppContainer","useOdysseyDesignTokens","SideNav","TopNav","useScrollState","useMatchAppElementToUiShellAppArea","useUiShellContext","emptySideNavItems","jsx","_jsx","jsxs","_jsxs","appSwitcherDefaultAppIcons","StyledAppContainer","shouldForwardProp","prop","appBackgroundColor","backgroundColor","gridArea","position","StyledAppSwitcherContainer","StyledBannersContainer","StyledSideNavContainer","StyledShellContainer","odysseyDesignTokens","HueNeutral50","display","gridGap","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","width","StyledTopNavContainer","WideUiShellContent","appElement","appElementScrollingMode","appSwitcherProps","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","optionalComponents","sideNavProps","topNavProps","uiShellContext","isContentScrolled","sideNavContainerRef","topNavContainerRef","uiShellAppAreaRef","parentContainerRef","paddingMode","uiShellResizableRefs","ref","children","banners","includes","fallback","appIcons","isLoading","selectedAppName","undefined","sideNavItems","hasCustomFooter","sideNavFooter","footerComponent","footerItems","leftSideComponent","topNavLeftSide","rightSideComponent","topNavRightSide","tabIndex","MemoizedWideUiShellContent","displayName"],"sources":["../../../src/ui-shell/WideUiShellContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { memo, useRef } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { AppSwitcher } from \"./AppSwitcher/index.js\";\nimport { AppSwitcherAppIconData } from \"./AppSwitcher/AppSwitcherApp.js\";\nimport { InnerAppContainer } from \"./InnerAppContainer.js\";\nimport {\n useOdysseyDesignTokens,\n type DesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { SideNav } from \"./SideNav/index.js\";\nimport { TopNav } from \"./TopNav/index.js\";\nimport { useScrollState } from \"./useScrollState.js\";\nimport { useMatchAppElementToUiShellAppArea } from \"./useMatchAppElementToUiShellAppArea.js\";\nimport {\n UiShellNavComponentProps,\n UiShellContentProps,\n} from \"./uiShellContentTypes.js\";\nimport { UiShellColors, useUiShellContext } from \"./UiShellProvider.js\";\nimport { emptySideNavItems } from \"./uiShellSharedConstants.js\";\n\nconst appSwitcherDefaultAppIcons = [] satisfies AppSwitcherAppIconData[];\n\nconst StyledAppContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"appBackgroundColor\" && prop !== \"odysseyDesignTokens\",\n})<{\n appBackgroundColor?: UiShellColors[\"appBackgroundColor\"];\n}>(({ appBackgroundColor }) => ({\n backgroundColor: appBackgroundColor,\n gridArea: \"app-content\",\n position: \"relative\",\n}));\n\nconst StyledAppSwitcherContainer = styled(\"div\")({\n gridArea: \"app-switcher\",\n});\n\nconst StyledBannersContainer = styled(\"div\")({\n gridArea: \"banners\",\n});\n\nconst StyledSideNavContainer = styled(\"div\")({\n gridArea: \"side-nav\",\n});\n\nconst StyledShellContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n display: \"grid\",\n gridGap: 0,\n gridTemplateAreas: `\n \"banners banners banners\"\n \"app-switcher side-nav top-nav\"\n \"app-switcher side-nav app-content\"\n `,\n gridTemplateColumns: \"auto auto 1fr\",\n gridTemplateRows: \"auto auto 1fr\",\n height: \"100vh\",\n width: \"100vw\",\n}));\n\nconst StyledTopNavContainer = styled(\"div\")({\n gridArea: \"top-nav\",\n});\n\nexport type WideUiShellContentProps = UiShellNavComponentProps &\n UiShellContentProps;\n\n/**\n * Our new Unified Platform UI Shell.\n *\n * This includes the top and side navigation as well as the footer and provides a spot for your app to render into.\n *\n * If an error occurs, this will revert to only showing the app.\n */\nconst WideUiShellContent = ({\n appElement,\n appElementScrollingMode,\n appSwitcherProps,\n hasStandardAppContentPadding = true,\n initialVisibleSections = [\"TopNav\", \"SideNav\", \"AppSwitcher\"],\n onError = console.error,\n optionalComponents,\n sideNavProps,\n topNavProps,\n}: WideUiShellContentProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const uiShellContext = useUiShellContext();\n\n const { isContentScrolled } = useScrollState(appElement);\n\n const sideNavContainerRef = useRef<HTMLDivElement>(null);\n const topNavContainerRef = useRef<HTMLDivElement>(null);\n const uiShellAppAreaRef = useRef<HTMLDivElement>(null);\n\n const { parentContainerRef } = useMatchAppElementToUiShellAppArea({\n appElement,\n appElementScrollingMode,\n paddingMode: hasStandardAppContentPadding ? \"comfortable\" : \"none\",\n uiShellAppAreaRef,\n uiShellResizableRefs: [\n sideNavContainerRef,\n topNavContainerRef,\n uiShellAppAreaRef,\n ],\n });\n\n return (\n <StyledShellContainer\n odysseyDesignTokens={odysseyDesignTokens}\n ref={parentContainerRef}\n >\n <StyledBannersContainer>\n {optionalComponents?.banners}\n </StyledBannersContainer>\n\n <StyledAppSwitcherContainer>\n {\n /* If AppSwitcher should be initially visible and we have not yet received props, render AppSwitcher in the loading state */\n initialVisibleSections?.includes(\"AppSwitcher\") &&\n !appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher\n appIcons={appSwitcherDefaultAppIcons}\n isLoading\n selectedAppName=\"\"\n />\n </ErrorBoundary>\n )\n }\n\n {appSwitcherProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <AppSwitcher {...appSwitcherProps} />\n </ErrorBoundary>\n )}\n </StyledAppSwitcherContainer>\n\n <StyledSideNavContainer ref={sideNavContainerRef}>\n {\n /* If SideNav should be initially visible and we have not yet received props, render SideNav with minimal inputs */\n initialVisibleSections?.includes(\"SideNav\") &&\n sideNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav isLoading sideNavItems={emptySideNavItems} />\n </ErrorBoundary>\n )\n }\n\n {sideNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <SideNav\n {...{\n ...sideNavProps,\n ...(sideNavProps.hasCustomFooter &&\n optionalComponents?.sideNavFooter\n ? {\n footerComponent: optionalComponents.sideNavFooter,\n footerItems: undefined,\n hasCustomFooter: sideNavProps.hasCustomFooter,\n }\n : {\n footerItems: sideNavProps.footerItems,\n hasCustomFooter: false,\n }),\n }}\n />\n </ErrorBoundary>\n )}\n </StyledSideNavContainer>\n\n <StyledTopNavContainer ref={topNavContainerRef}>\n {\n /* If TopNav should be initially visible and we have not yet received props, render Topnav with minimal inputs */\n initialVisibleSections?.includes(\"TopNav\") &&\n topNavProps === undefined && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )\n }\n\n {topNavProps && (\n <ErrorBoundary fallback={null} onError={onError}>\n <TopNav\n {...topNavProps}\n leftSideComponent={optionalComponents?.topNavLeftSide}\n rightSideComponent={optionalComponents?.topNavRightSide}\n />\n </ErrorBoundary>\n )}\n </StyledTopNavContainer>\n\n <StyledAppContainer\n appBackgroundColor={uiShellContext?.appBackgroundColor}\n tabIndex={0}\n ref={uiShellAppAreaRef}\n >\n <InnerAppContainer isContentScrolled={isContentScrolled} />\n </StyledAppContainer>\n </StyledShellContainer>\n );\n};\n\nconst MemoizedWideUiShellContent = memo(WideUiShellContent);\nMemoizedWideUiShellContent.displayName = \"WideUiShellContent\";\n\nexport { MemoizedWideUiShellContent as WideUiShellContent };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,IAAI,EAAEC,MAAM,QAAQ,OAAO;AACpC,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,WAAW,QAAQ,wBAAwB;AAEpD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SACEC,sBAAsB,QAEjB,kCAAkC;AACzC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,kCAAkC,QAAQ,yCAAyC;AAK5F,SAAwBC,iBAAiB,QAAQ,sBAAsB;AACvE,SAASC,iBAAiB,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,0BAA0B,GAAG,EAAqC;AAExE,MAAMC,kBAAkB,GAAGlB,MAAM,CAAC,KAAK,EAAE;EACvCmB,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,oBAAoB,IAAIA,IAAI,KAAK;AAC9C,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAmB,CAAC,MAAM;EAC9BC,eAAe,EAAED,kBAAkB;EACnCE,QAAQ,EAA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C4D,QAAQ,EAAE,IAAK;QAAClB,OAAO,EAAEA,OAAQ;QAAAe,QAAA,EAC9C9C,IAAA,CAACN,MAAM;UAAA,GACD0C,WAAW;UACfuB,iBAAiB,EAAEzB,kBAAkB,EAAE0B,cAAe;UACtDC,kBAAkB,EAAE3B,kBAAkB,EAAE4B;QAAgB,CACzD;MAAC,CACW,CAChB;IAAA,CACoB,CAAC,EAExB9D,IAAA,CAACI,kBAAkB;MACjBG,kBAAkB,EAAE8B,cAAc,EAAE9B,kBAAmB;MACvDwD,QAAQ,EAAE,CAAE;MACZlB,GAAG,EAAEJ,iBAAkB;MAAAK,QAAA,EAEvB9C,IAAA,CAACT,iBAAiB;QAAC+C,iBAAiB,EAAEA;MAAkB,CAAE;IAAC,CACzC,CAAC;EAAA,CACD,CAAC;AAE3B,CAAC;AAED,MAAM0B,0BAA0B,GAAG7E,IAAI,CAACsC,kBAAkB,CAAC;AAC3DuC,0BAA0B,CAACC,WAAW,GAAG,oBAAoB;AAE7D,SAASD,0BAA0B,IAAIvC,kBAAkB","ignoreList":[]}
@@ -33,6 +33,7 @@ export const renderUiShell = ({
33
33
  hasStandardAppContentPadding,
34
34
  initialVisibleSections,
35
35
  onError = console.error,
36
+ onRender,
36
37
  parentElement,
37
38
  sideNavBackgroundColor,
38
39
  topNavBackgroundColor
@@ -97,6 +98,17 @@ export const renderUiShell = ({
97
98
  webComponentParentElement: parentElement,
98
99
  webComponentChildren
99
100
  });
101
+ const unsubscribeFromUnifiedUiShellRendered = subscribeToReactAppSubscribed(() => {
102
+ unsubscribeFromUnifiedUiShellRendered();
103
+ onRender?.({
104
+ appElement,
105
+ closeRightSideMenu,
106
+ closeSideNavMenu,
107
+ setComponentProps: publishAfterReactAppReadyForProps,
108
+ slottedElements,
109
+ uiShellElement
110
+ });
111
+ });
100
112
  parentElement.appendChild(appElement);
101
113
  return {
102
114
  appElement,
@@ -1 +1 @@
1
- {"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","UiShell","uiShellDataAttribute","renderReactInWebComponent","jsx","_jsx","optionalComponentSlotNames","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","breakpointConfig","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","parentElement","sideNavBackgroundColor","topNavBackgroundColor","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","closeRightSideMenu","subscribeToCloseRightSideMenu","closeSideNavMenu","subscribeToCloseSideNavMenu","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","appendChild","setComponentProps"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus } from \"./createMessageBus.js\";\nimport { UiShell, UiShellProps } from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n breakpointConfig,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n parentElement,\n sideNavBackgroundColor,\n topNavBackgroundColor,\n}: {\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"breakpointConfig\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const {\n publish: closeRightSideMenu,\n subscribe: subscribeToCloseRightSideMenu,\n } = createMessageBus();\n\n const { publish: closeSideNavMenu, subscribe: subscribeToCloseSideNavMenu } =\n createMessageBus();\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n >;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n breakpointConfig={breakpointConfig}\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n closeSideNavMenu={closeSideNavMenu}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentParentElement: parentElement,\n webComponentChildren,\n });\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,OAAO,QAAsB,cAAc;AAEpD,SAASC,oBAAoB,QAAQ,oBAAoB;AACzD,SAASC,yBAAyB,QAAQ,+CAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1F,OAAO,MAAMC,0BAGZ,GAAG;EACFC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,iBAAiB;EAChCC,aAAa,EAAE,iBAAiB;EAChCC,cAAc,EAAE,mBAAmB;EACnCC,eAAe,EAAE;AACnB,CAAC;AAWD,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU,EAAEC,kBAAkB;EAC9BC,uBAAuB;EACvBC,gBAAgB;EAChBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,aAAa;EACbC,sBAAsB;EACtBC;AAqBwC,CAAC,KAAK;EAC9C,MAAMX,UAAU,GAAGC,kBAAkB,IAAIW,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGtEJ,aAAa,CAACK,YAAY,CAAC3B,oBAAoB,EAAE,EAAE,CAAC;EAEpD,MAAM;IAAE4B,OAAO,EAAEC,kBAAkB;IAAEC,SAAS,EAAEC;EAAuB,CAAC,GACtEjC,gBAAgB,CAA2C,CAAC;EAE9D,MAAM;IACJ8B,OAAO,EAAEI,0BAA0B;IACnCF,SAAS,EAAEG;EACb,CAAC,GAAGnC,gBAAgB,CAAC,CAAC;EAEtB,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AAQ;QACjBmC,qBAAqB,EAAEtB,0BAA2B;QAElDuB,kBAAkB,EAAEf,MAAM,CAACC,WAAW,CACpCD,MAAM,CAACE,OAAO,CAACtC,0BAA0B,CAAC,CAACuC,GAAG,CAC5C,CAAC,CAACC,oBAAoB,EAAEC,QAAQ,CAAC,KAAK,CACpCD,oBAAoB,EACpBzC,IAAA;UAAMqD,IAAI,EAAEX;QAAS,CAAE,CAAC,CAE5B,CACF,CAAE;QACFtB,sBAAsB,EAAEA,sBAAuB;QAC/Ca,6BAA6B,EAAEA,6BAA8B;QAC7DE,2BAA2B,EAAEA,2BAA4B;QACzDP,sBAAsB,EAAEA,sBAAuB;QAC/CP,qBAAqB,EAAEA,qBAAsB;QAC7CiC,iBAAiB,EAAEN,iBAAiB,CAACO,cAAe;QACpDC,oBAAoB,EAAER,iBAAiB,CAACS;MAAkB,CAC3D;IAAC,CACW,CAChB;IACDC,yBAAyB,EAAEvC,aAAa;IACxCyB;EACF,CAAC,CAAC;EAEFzB,aAAa,CAACwC,WAAW,CAACjD,UAAU,CAAC;EAErC,OAAO;IACLA,UAAU;IACVsB,kBAAkB;IAClBE,gBAAgB;IAChB0B,iBAAiB,EAAE7B,iCAAiC;IACpDK,eAAe;IACfU;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"renderUiShell.js","names":["ErrorBoundary","bufferLatest","createMessageBus","UiShell","uiShellDataAttribute","renderReactInWebComponent","jsx","_jsx","optionalComponentSlotNames","banners","rightSideMenu","sideNavFooter","topNavLeftSide","topNavRightSide","renderUiShell","appBackgroundColor","appBackgroundContrastMode","appElement","providedAppElement","appElementScrollingMode","breakpointConfig","hasStandardAppContentPadding","initialVisibleSections","onError","console","error","onRender","parentElement","sideNavBackgroundColor","topNavBackgroundColor","document","createElement","setAttribute","publish","publishPropChanges","subscribe","subscribeToPropChanges","publishSubscriptionCreated","subscribeToReactAppSubscribed","publishAfterReactAppReadyForProps","closeRightSideMenu","subscribeToCloseRightSideMenu","closeSideNavMenu","subscribeToCloseSideNavMenu","slottedElements","Object","fromEntries","entries","map","optionalComponentKey","slotName","element","webComponentChildren","values","uiShellElement","getReactComponent","reactRootElements","fallback","children","onSubscriptionCreated","optionalComponents","name","uiShellAppElement","appRootElement","uiShellStylesElement","stylesRootElement","webComponentParentElement","unsubscribeFromUnifiedUiShellRendered","setComponentProps","appendChild"],"sources":["../../../src/ui-shell/renderUiShell.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type SetStateAction } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport { bufferLatest } from \"./bufferLatest.js\";\nimport { createMessageBus, PublishMessage } from \"./createMessageBus.js\";\nimport { UiShell, UiShellProps } from \"./UiShell.js\";\nimport { UiShellNavComponentProps } from \"./uiShellContentTypes.js\";\nimport { uiShellDataAttribute } from \"./useHasUiShell.js\";\nimport { renderReactInWebComponent } from \"../web-component/renderReactInWebComponent.js\";\n\nexport const optionalComponentSlotNames: Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n string\n> = {\n banners: \"banners\",\n rightSideMenu: \"right-side-menu\",\n sideNavFooter: \"side-nav-footer\",\n topNavLeftSide: \"top-nav-left-side\",\n topNavRightSide: \"top-nav-right-side\",\n};\n\nexport type SlottedElements = Record<\n keyof Required<UiShellProps>[\"optionalComponents\"],\n HTMLDivElement\n>;\n\nexport type RenderedUiShell = {\n closeRightSideMenu: PublishMessage<void>;\n closeSideNavMenu: PublishMessage<void>;\n setComponentProps: ReturnType<\n typeof bufferLatest<SetStateAction<UiShellNavComponentProps>>\n >;\n slottedElements: SlottedElements;\n uiShellElement: ReturnType<typeof renderReactInWebComponent>;\n} & Partial<Pick<UiShellProps, \"appElement\">>;\n\n/**\n * This function renders UI Shell in a web component.\n * This function is agnostic to the UI framework for your app is using. Your application can be another web component, a React app, or even vanilla HTML.\n *\n * **All styles are self-contained.** Even though your application visually renders as children of the web component, its within the global `document` scope, not the web component's `ShadowRoot`. That means any global styles will not affect UI Shell but will affect your application.\n *\n * It places your app's root element in a web component <slot> and ensures it remains rendered in the event of a UI Shell error.\n * It also provides you with other elements fitted to slots in the web component. **In React, you can portal to these components.**\n */\nexport const renderUiShell = ({\n appBackgroundColor,\n appBackgroundContrastMode,\n appElement: providedAppElement,\n appElementScrollingMode,\n breakpointConfig,\n hasStandardAppContentPadding,\n initialVisibleSections,\n onError = console.error,\n onRender,\n parentElement,\n sideNavBackgroundColor,\n topNavBackgroundColor,\n}: {\n /**\n * Notifies when a React rendering error occurs. This could be useful for logging, reporting priority 0 issues, and recovering UI Shell when errors occur.\n */\n onError?: () => void;\n /**\n * Notify once when React has rendered UI Shell the first time.\n */\n onRender?: (renderedUiShell: RenderedUiShell) => void;\n /**\n * HTML element used as the container for UI Shell and the App. They're siblings inside this element.\n */\n parentElement: HTMLElement;\n} & Pick<\n UiShellProps,\n | \"appBackgroundColor\"\n | \"appBackgroundContrastMode\"\n | \"appElementScrollingMode\"\n | \"breakpointConfig\"\n | \"hasStandardAppContentPadding\"\n | \"initialVisibleSections\"\n | \"sideNavBackgroundColor\"\n | \"topNavBackgroundColor\"\n> &\n Partial<Pick<UiShellProps, \"appElement\">>) => {\n const appElement = providedAppElement || document.createElement(\"div\");\n\n // Add this attribute so `PageTemplate` and potentially other components will know if they're in UI Shell with special padding already available.\n parentElement.setAttribute(uiShellDataAttribute, \"\");\n\n const { publish: publishPropChanges, subscribe: subscribeToPropChanges } =\n createMessageBus<SetStateAction<UiShellNavComponentProps>>();\n\n const {\n publish: publishSubscriptionCreated,\n subscribe: subscribeToReactAppSubscribed,\n } = createMessageBus();\n\n const publishAfterReactAppReadyForProps = bufferLatest({\n publish: publishPropChanges,\n subscribe: subscribeToReactAppSubscribed,\n });\n\n const {\n publish: closeRightSideMenu,\n subscribe: subscribeToCloseRightSideMenu,\n } = createMessageBus();\n\n const { publish: closeSideNavMenu, subscribe: subscribeToCloseSideNavMenu } =\n createMessageBus();\n\n const slottedElements = Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => {\n const element = document.createElement(\"div\");\n\n element.setAttribute(\"slot\", slotName);\n\n return [optionalComponentKey, element];\n },\n ),\n ) as SlottedElements;\n\n const webComponentChildren = Object.values(slottedElements);\n\n const uiShellElement = renderReactInWebComponent({\n getReactComponent: (reactRootElements) => (\n <ErrorBoundary fallback={<div data-error />} onError={onError}>\n <UiShell\n breakpointConfig={breakpointConfig}\n appBackgroundColor={appBackgroundColor}\n appBackgroundContrastMode={appBackgroundContrastMode}\n appElement={appElement}\n appElementScrollingMode={appElementScrollingMode}\n closeSideNavMenu={closeSideNavMenu}\n hasStandardAppContentPadding={hasStandardAppContentPadding}\n initialVisibleSections={initialVisibleSections}\n onError={onError}\n onSubscriptionCreated={publishSubscriptionCreated}\n // `optionalComponents` doesn't need to be memoized because gets passed in once, and this isn't a React component.\n optionalComponents={Object.fromEntries(\n Object.entries(optionalComponentSlotNames).map(\n ([optionalComponentKey, slotName]) => [\n optionalComponentKey,\n <slot name={slotName} />,\n ],\n ),\n )}\n sideNavBackgroundColor={sideNavBackgroundColor}\n subscribeToCloseRightSideMenu={subscribeToCloseRightSideMenu}\n subscribeToCloseSideNavMenu={subscribeToCloseSideNavMenu}\n subscribeToPropChanges={subscribeToPropChanges}\n topNavBackgroundColor={topNavBackgroundColor}\n uiShellAppElement={reactRootElements.appRootElement}\n uiShellStylesElement={reactRootElements.stylesRootElement}\n />\n </ErrorBoundary>\n ),\n webComponentParentElement: parentElement,\n webComponentChildren,\n });\n\n const unsubscribeFromUnifiedUiShellRendered = subscribeToReactAppSubscribed(\n () => {\n unsubscribeFromUnifiedUiShellRendered();\n\n onRender?.({\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n });\n },\n );\n\n parentElement.appendChild(appElement);\n\n return {\n appElement,\n closeRightSideMenu,\n closeSideNavMenu,\n setComponentProps: publishAfterReactAppReadyForProps,\n slottedElements,\n uiShellElement,\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,gBAAgB,QAAwB,uBAAuB;AACxE,SAASC,OAAO,QAAsB,cAAc;AAEpD,SAASC,oBAAoB,QAAQ,oBAAoB;AACzD,SAASC,yBAAyB,QAAQ,+CAA+C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1F,OAAO,MAAMC,0BAGZ,GAAG;EACFC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,iBAAiB;EAChCC,aAAa,EAAE,iBAAiB;EAChCC,cAAc,EAAE,mBAAmB;EACnCC,eAAe,EAAE;AACnB,CAAC;AA0BD,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,kBAAkB;EAClBC,yBAAyB;EACzBC,UAAU,EAAEC,kBAAkB;EAC9BC,uBAAuB;EACvBC,gBAAgB;EAChBC,4BAA4B;EAC5BC,sBAAsB;EACtBC,OAAO,GAAGC,OAAO,CAACC,KAAK;EACvBC,QAAQ;EACRC,aAAa;EACbC,sBAAsB;EACtBC;AAyBwC,CAAC,KAAK;EAC9C,MAAMZ,UAAU,GAAGC,kBAAkB,IAAIY,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAGtEJ,aAAa,CAACK,YAAY,CAAC5B,oBAAoB,EAAE,EAAE,CAAC;EAEpD,MAAM;IAAE6B,OAA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 -8,5 +8,5 @@
8
8
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
- */export default "1-36-1";
11
+ */export default "1-37-0";
12
12
  //# sourceMappingURL=odysseyWebComponentVersion.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"odysseyWebComponentVersion.generated.js","names":[],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\nexport default \"1-36-1\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAOA,eAAe,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"odysseyWebComponentVersion.generated.js","names":[],"sources":["../../../src/web-component/odysseyWebComponentVersion.generated.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * DO NOT UPDATE THIS FILE MANUALLY\n * This file is managed by scripts/updateWebComponentVersion.ts and any changes made will be overwritten\n * This script only needs to be run during release, and shouldn't be used during local development.\n */\nexport default \"1-37-0\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAOA,eAAe,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"renderReactInWebComponent.js","names":["version","createReactRootElements","webComponentDataAttributeName","versionedWebComponentName","toLowerCase","SsrFriendlyHtmlElementClass","globalThis","HTMLElement","WebComponentClass","getReactComponent","reactRootElements","elementName","localName","reactRootPromise","Promise","resolve","constructor","appRootElement","stylesRootElement","shadowRoot","attachShadow","mode","appendChild","styleHostElement","document","createElement","setAttribute","window","cspNonce","innerHTML","setGetReactComponent","then","reactRoot","render","connectedCallback","Error","createRoot","disconnectedCallback","unmount","getReactWebComponent","webComponentName","customElements","get","define","element","renderReactInWebComponent","webComponentChildren","webComponentParentElement","webComponentRootElement","reactElement","Array","isArray","forEach","webComponentChild"],"sources":["../../../src/web-component/renderReactInWebComponent.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type ReactNode } from \"react\";\nimport type { Root } from \"react-dom/client\";\nimport version from \"./odysseyWebComponentVersion.generated.js\";\n\nimport {\n createReactRootElements,\n type ReactRootElements,\n} from \"./createReactRootElements.js\";\n\ninterface GetReactWebComponentOptions {\n webComponentName?: string;\n getReactComponent: (reactRootElements: ReactRootElements) => ReactNode;\n}\n\n// Used by selenium when selecting for odyssey web components regardless of their name.\nexport const webComponentDataAttributeName = \"data-odyssey-react-web-component\";\n// Unique name to avoid multiple versions of odyssey overwriting each other's implementations\nexport const versionedWebComponentName =\n `odyssey-react-web-component-${version}`.toLowerCase();\n\nconst SsrFriendlyHtmlElementClass =\n \"HTMLElement\" in globalThis\n ? HTMLElement\n : (class {} as unknown as typeof globalThis.HTMLElement);\n\nexport class WebComponentClass extends SsrFriendlyHtmlElementClass {\n #getReactComponent: GetReactComponentInWebComponent | null = null;\n readonly #reactRootElements: ReactRootElements;\n public readonly elementName: string = this.localName;\n // public for testing\n public reactRootPromise: Promise<Root | null> = Promise.resolve(null);\n\n constructor() {\n super();\n\n this.#reactRootElements = createReactRootElements();\n const { appRootElement, stylesRootElement } = this.#reactRootElements;\n\n const shadowRoot = this.attachShadow({ mode: \"open\" });\n shadowRoot.appendChild(stylesRootElement);\n shadowRoot.appendChild(appRootElement);\n\n const styleHostElement = document.createElement(\"style\");\n styleHostElement.setAttribute(\"nonce\", window.cspNonce);\n styleHostElement.innerHTML = `\n :host {\n all: initial;\n contain: content;\n }\n `;\n stylesRootElement.appendChild(styleHostElement);\n }\n\n /**\n * Provides the function used to initialize react content that is specific to this instance\n * of the web component, which is used later in the connectedCallback.\n *\n * Always set immediately after creation via document.createElement\n */\n setGetReactComponent(getReactComponent: GetReactComponentInWebComponent) {\n this.reactRootPromise = this.reactRootPromise.then((reactRoot) => {\n this.#getReactComponent = getReactComponent;\n if (reactRoot) {\n // connectedCallback has already been fired. Need to mount this content to the existing root\n reactRoot.render(this.#getReactComponent(this.#reactRootElements));\n } else {\n // Nothing to do. Content will be mounted when connectedCallback is called\n }\n\n return reactRoot;\n });\n }\n\n connectedCallback() {\n this.reactRootPromise = this.reactRootPromise\n .then((reactRoot) => {\n if (reactRoot) {\n // Shouldn't ever happen. connected and disconnected should never be called out of order\n throw new Error(\n `connectedCallback fired when reactRoot is already mounted.`,\n );\n }\n\n // Ensure react root is available before mounting\n // If we want to support React v17 in the future, we can use a try-catch on the import to grab the old `ReactDOM.render` function if `react-dom/client` errors. --Kevin Ghadyani\n return import(\"react-dom/client\").then(({ createRoot }) =>\n createRoot(this.#reactRootElements.appRootElement),\n );\n })\n .then((reactRoot) => {\n if (!this.#getReactComponent) {\n // getReactComponent hasn't been set yet. Content will be mounted once it's set.\n } else {\n reactRoot.render(this.#getReactComponent(this.#reactRootElements));\n }\n return reactRoot;\n });\n }\n\n disconnectedCallback() {\n this.reactRootPromise = this.reactRootPromise.then((reactRoot) => {\n if (!reactRoot) {\n // Shouldn't ever happen\n throw new Error(\n `disconnectedCallback fired when reactRoot is already unmounted.`,\n );\n }\n\n reactRoot.unmount();\n // Set root to null. We don't want to attempt to render to a root that's already been unmounted.\n return null;\n });\n }\n}\n\n/**\n * Returns a constructed web component which manages it's own shadow dom and react dom roots\n * A custom name can be specified, otherwise a default is provided\n */\nexport const getReactWebComponent = ({\n webComponentName = versionedWebComponentName,\n getReactComponent,\n}: GetReactWebComponentOptions) => {\n // This name hasn't been defined yet. Add a definition for it before constructing one.\n if (!customElements.get(webComponentName)) {\n customElements.define(webComponentName, WebComponentClass);\n }\n\n const element = document.createElement(webComponentName) as InstanceType<\n typeof WebComponentClass\n >;\n // Set selenium attribute so this can be selected\n element.setAttribute(webComponentDataAttributeName, \"\");\n // function used for creating react content\n element.setGetReactComponent(getReactComponent);\n return element;\n};\n\nexport type GetReactComponentInWebComponent = (\n reactRootElements: ReactRootElements,\n) => ReactNode;\n\nexport type RenderReactInWebComponentProps = {\n /**\n * Optional name given to this web component.\n * Defaults to a 'odyssey-react-wc-' plus the current odyssey version\n */\n webComponentName?: string;\n /**\n * This is a callback function for rendering your React component or app in the Web Component.\n * It gives you access to the Shadow DOM elements if you need them for Odyssey, Emotion, or MUI.\n *\n * You will need to add `<slot>` elements if you want to pass child elements or components or React apps.\n * You can have multiple slots in your app if you add a `name` attribute to your `<slot>` elements.\n */\n getReactComponent: GetReactComponentInWebComponent;\n /**\n * One or more HTML elements that are going to render as `children` of the web component.\n * If your React component doesn't take children, this is unnecessary.\n *\n * Typically, a React app root element is passed, but it can include an array of other elements if there are multiple slots for children.\n *\n * You will need to have rendered `<slot>` elements in your React component or `children` won't show up.\n */\n webComponentChildren?: HTMLElement | HTMLElement[];\n} & (\n | {\n /**\n * The React app renders in the web component, but the web component needs to be rendered in the document.\n *\n * This is the element the web component is rendered into.\n */\n webComponentParentElement: HTMLElement;\n webComponentRootElement?: never;\n }\n | {\n webComponentParentElement?: HTMLElement;\n /**\n * @deprecated Use `webComponentParentElement` instead.\n */\n webComponentRootElement: HTMLElement;\n }\n);\n\n/**\n * Lets you render React apps or components in a Web Component.\n *\n * This is useful when global styles are causing conflicts with your React components.\n */\nexport const renderReactInWebComponent = ({\n webComponentName,\n getReactComponent,\n webComponentChildren,\n webComponentParentElement,\n webComponentRootElement,\n}: RenderReactInWebComponentProps) => {\n const reactElement = getReactWebComponent({\n getReactComponent,\n webComponentName,\n });\n\n if (webComponentChildren) {\n (Array.isArray(webComponentChildren)\n ? webComponentChildren\n : [webComponentChildren]\n ).forEach((webComponentChild) => {\n reactElement.appendChild(webComponentChild);\n });\n }\n\n if (webComponentParentElement) {\n webComponentParentElement.appendChild(reactElement);\n }\n // Remove this condition when `webComponentRootElement` is no longer a prop.\n else if (webComponentRootElement) {\n webComponentRootElement.appendChild(reactElement);\n }\n\n return reactElement;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,OAAO,MAAM,2CAA2C;AAE/D,SACEC,uBAAuB,QAElB,8BAA8B;AAQrC,OAAO,MAAMC,6BAA6B,GAAG,kCAAkC;AAE/E,OAAO,MAAMC,yBAAyB,GACpC,+BAA+BH,OAAO,EAAE,CAACI,WAAW,CAAC,CAAC;AAExD,MAAMC,2BAA2B,GAC/B,aAAa,IAAIC,UAAU,GACvBC,WAAW,GACV,MAAM,EAA+C;AAE5D,OAAO,MAAMC,iBAAiB,SAASH,2BAA2B,CAA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C/C,OAAOmC,OAAO;AAChB,CAAC;AAqDD,OAAO,MAAMC,yBAAyB,GAAGA,CAAC;EACxCL,gBAAgB;EAChB/B,iBAAiB;EACjBqC,oBAAoB;EACpBC,yBAAyB;EACzBC;AAC8B,CAAC,KAAK;EACpC,MAAMC,YAAY,GAAGV,oBAAoB,CAAC;IACxC9B,iBAAiB;IACjB+B;EACF,CAAC,CAAC;EAEF,IAAIM,oBAAoB,EAAE;IACxB,CAACI,KAAK,CAACC,OAAO,CAACL,oBAAoB,CAAC,GAChCA,oBAAoB,GACpB,CAACA,oBAAoB,CAAC,EACxBM,OAAO,CAAEC,iBAAiB,IAAK;MAC/BJ,YAAY,CAAC3B,WAAW,CAAC+B,iBAAiB,CAAC;IAC7C,CAAC,CAAC;EACJ;EAEA,IAAIN,yBAAyB,EAAE;IAC7BA,yBAAyB,CAACzB,WAAW,CAAC2B,YAAY,CAAC;EACrD,CAAC,MAEI,IAAID,uBAAuB,EAAE;IAChCA,uBAAuB,CAAC1B,WAAW,CAAC2B,YAAY,CAAC;EACnD;EAEA,OAAOA,YAAY;AACrB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"renderReactInWebComponent.js","names":["version","createReactRootElements","webComponentDataAttributeName","versionedWebComponentName","toLowerCase","SsrFriendlyHtmlElementClass","globalThis","HTMLElement","WebComponentClass","getReactComponent","reactRootElements","elementName","localName","reactRootPromise","Promise","resolve","constructor","appRootElement","stylesRootElement","shadowRoot","attachShadow","mode","appendChild","styleHostElement","document","createElement","setAttribute","window","cspNonce","innerHTML","setGetReactComponent","then","reactRoot","render","connectedCallback","Error","createRoot","disconnectedCallback","unmount","getReactWebComponent","webComponentName","customElements","get","define","element","renderReactInWebComponent","webComponentChildren","webComponentParentElement","webComponentRootElement","reactElement","Array","isArray","forEach","webComponentChild"],"sources":["../../../src/web-component/renderReactInWebComponent.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { type ReactNode } from \"react\";\nimport type { Root } from \"react-dom/client\";\nimport version from \"./odysseyWebComponentVersion.generated.js\";\n\nimport {\n createReactRootElements,\n type ReactRootElements,\n} from \"./createReactRootElements.js\";\n\ninterface GetReactWebComponentOptions {\n webComponentName?: string;\n getReactComponent: (reactRootElements: ReactRootElements) => ReactNode;\n}\n\n// Used by selenium when selecting for odyssey web components regardless of their name.\nexport const webComponentDataAttributeName = \"data-odyssey-react-web-component\";\n\n// Unique name to avoid multiple versions of odyssey overwriting each other's implementations\nexport const versionedWebComponentName =\n `odyssey-react-web-component-${version}`.toLowerCase();\n\nconst SsrFriendlyHtmlElementClass =\n \"HTMLElement\" in globalThis\n ? HTMLElement\n : (class {} as unknown as typeof globalThis.HTMLElement);\n\nexport class WebComponentClass extends SsrFriendlyHtmlElementClass {\n #getReactComponent: GetReactComponentInWebComponent | null = null;\n readonly #reactRootElements: ReactRootElements;\n public readonly elementName: string = this.localName;\n // public for testing\n public reactRootPromise: Promise<Root | null> = Promise.resolve(null);\n\n constructor() {\n super();\n\n this.#reactRootElements = createReactRootElements();\n const { appRootElement, stylesRootElement } = this.#reactRootElements;\n\n const shadowRoot = this.attachShadow({ mode: \"open\" });\n shadowRoot.appendChild(stylesRootElement);\n shadowRoot.appendChild(appRootElement);\n\n const styleHostElement = document.createElement(\"style\");\n styleHostElement.setAttribute(\"nonce\", window.cspNonce);\n styleHostElement.innerHTML = `\n :host {\n all: initial;\n contain: content;\n }\n `;\n stylesRootElement.appendChild(styleHostElement);\n }\n\n /**\n * Provides the function used to initialize react content that is specific to this instance\n * of the web component, which is used later in the connectedCallback.\n *\n * Always set immediately after creation via document.createElement\n */\n setGetReactComponent(getReactComponent: GetReactComponentInWebComponent) {\n this.reactRootPromise = this.reactRootPromise.then((reactRoot) => {\n this.#getReactComponent = getReactComponent;\n if (reactRoot) {\n // connectedCallback has already been fired. Need to mount this content to the existing root\n reactRoot.render(this.#getReactComponent(this.#reactRootElements));\n } else {\n // Nothing to do. Content will be mounted when connectedCallback is called\n }\n\n return reactRoot;\n });\n }\n\n connectedCallback() {\n this.reactRootPromise = this.reactRootPromise\n .then((reactRoot) => {\n if (reactRoot) {\n // Shouldn't ever happen. connected and disconnected should never be called out of order\n throw new Error(\n `connectedCallback fired when reactRoot is already mounted.`,\n );\n }\n\n // Ensure react root is available before mounting\n // If we want to support React v17 in the future, we can use a try-catch on the import to grab the old `ReactDOM.render` function if `react-dom/client` errors. --Kevin Ghadyani\n return import(\"react-dom/client\").then(({ createRoot }) =>\n createRoot(this.#reactRootElements.appRootElement),\n );\n })\n .then((reactRoot) => {\n if (!this.#getReactComponent) {\n // getReactComponent hasn't been set yet. Content will be mounted once it's set.\n } else {\n reactRoot.render(this.#getReactComponent(this.#reactRootElements));\n }\n return reactRoot;\n });\n }\n\n disconnectedCallback() {\n this.reactRootPromise = this.reactRootPromise.then((reactRoot) => {\n if (!reactRoot) {\n // Shouldn't ever happen\n throw new Error(\n `disconnectedCallback fired when reactRoot is already unmounted.`,\n );\n }\n\n reactRoot.unmount();\n // Set root to null. We don't want to attempt to render to a root that's already been unmounted.\n return null;\n });\n }\n}\n\n/**\n * Returns a constructed web component which manages it's own shadow dom and react dom roots\n * A custom name can be specified, otherwise a default is provided\n */\nexport const getReactWebComponent = ({\n webComponentName = versionedWebComponentName,\n getReactComponent,\n}: GetReactWebComponentOptions) => {\n // This name hasn't been defined yet. Add a definition for it before constructing one.\n if (!customElements.get(webComponentName)) {\n customElements.define(webComponentName, WebComponentClass);\n }\n\n const element = document.createElement(webComponentName) as InstanceType<\n typeof WebComponentClass\n >;\n // Set selenium attribute so this can be selected\n element.setAttribute(webComponentDataAttributeName, \"\");\n // function used for creating react content\n element.setGetReactComponent(getReactComponent);\n return element;\n};\n\nexport type GetReactComponentInWebComponent = (\n reactRootElements: ReactRootElements,\n) => ReactNode;\n\nexport type RenderReactInWebComponentProps = {\n /**\n * Optional name given to this web component.\n * Defaults to a 'odyssey-react-wc-' plus the current odyssey version\n */\n webComponentName?: string;\n /**\n * This is a callback function for rendering your React component or app in the Web Component.\n * It gives you access to the Shadow DOM elements if you need them for Odyssey, Emotion, or MUI.\n *\n * You will need to add `<slot>` elements if you want to pass child elements or components or React apps.\n * You can have multiple slots in your app if you add a `name` attribute to your `<slot>` elements.\n */\n getReactComponent: GetReactComponentInWebComponent;\n /**\n * One or more HTML elements that are going to render as `children` of the web component.\n * If your React component doesn't take children, this is unnecessary.\n *\n * Typically, a React app root element is passed, but it can include an array of other elements if there are multiple slots for children.\n *\n * You will need to have rendered `<slot>` elements in your React component or `children` won't show up.\n */\n webComponentChildren?: HTMLElement | HTMLElement[];\n} & (\n | {\n /**\n * The React app renders in the web component, but the web component needs to be rendered in the document.\n *\n * This is the element the web component is rendered into.\n */\n webComponentParentElement: HTMLElement;\n webComponentRootElement?: never;\n }\n | {\n webComponentParentElement?: HTMLElement;\n /**\n * @deprecated Use `webComponentParentElement` instead.\n */\n webComponentRootElement: HTMLElement;\n }\n);\n\n/**\n * Lets you render React apps or components in a Web Component.\n *\n * This is useful when global styles are causing conflicts with your React components.\n */\nexport const renderReactInWebComponent = ({\n webComponentName,\n getReactComponent,\n webComponentChildren,\n webComponentParentElement,\n webComponentRootElement,\n}: RenderReactInWebComponentProps) => {\n const reactElement = getReactWebComponent({\n getReactComponent,\n webComponentName,\n });\n\n if (webComponentChildren) {\n (Array.isArray(webComponentChildren)\n ? webComponentChildren\n : [webComponentChildren]\n ).forEach((webComponentChild) => {\n reactElement.appendChild(webComponentChild);\n });\n }\n\n if (webComponentParentElement) {\n webComponentParentElement.appendChild(reactElement);\n }\n // Remove this condition when `webComponentRootElement` is no longer a prop.\n else if (webComponentRootElement) {\n webComponentRootElement.appendChild(reactElement);\n }\n\n return reactElement;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,OAAO,MAAM,2CAA2C;AAE/D,SACEC,uBAAuB,QAElB,8BAA8B;AAQrC,OAAO,MAAMC,6BAA6B,GAAG,kCAAkC;AAG/E,OAAO,MAAMC,yBAAyB,GACpC,+BAA+BH,OAAO,EAAE,CAACI,WAAW,CAAC,CAAC;AAExD,MAAMC,2BAA2B,GAC/B,aAAa,IAAIC,UAAU,GACvBC,WAAW,GACV,MAAM,EAA+C;AAE5D,OAAO,MAAMC,iBAAiB,SAASH,2BAA2B,CAAC;EACjE,CAACI,iBAAiB,GAA2C,IAAI;EACxD,CAACC,iBAAiB;EACXC,WAAW,GAAW,IAAI,CAACC,SAAS;EAE7CC,gBAAgB,GAAyBC,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC;EAErEC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IAEP,IAAI,CAAC,CAACN,iBAAiB,GAAGT,uBAAuB,CAAC,CAAC;IACnD,MAAM;MAAEgB,cAAc;MAAEC;IAAkB,CAAC,GAAG,IAAI,CAAC,CAACR,iBAAiB;IAErE,MAAMS,UAAU,GAAG,IAAI,CAACC,YAAY,CAAC;MAAEC,IAAI,EAAE;IAAO,CAAC,CAAC;IACtDF,UAAU,CAACG,WAAW,CAACJ,iBAAiB,CAAC;IACzCC,UAAU,CAACG,WAAW,CAACL,cAAc,CAAC;IAEtC,MAAMM,gBAAgB,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;IACxDF,gBAAgB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;IACvDL,gBAAgB,CAACM,SAAS,GAAG;AACjC;AACA;AACA;AACA;AACA,KAAK;IACDX,iBAAiB,CAACI,WAAW,CAACC,gB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