breadcrumbs-panel.ts 485 B

12345678910111213141516171819
  1. import { isSplitTestEnabled } from '@/utils/splitTestUtils'
  2. import { showPanel } from '@codemirror/view'
  3. export function createBreadcrumbsPanel() {
  4. const dom = document.createElement('div')
  5. dom.classList.add('ol-cm-breadcrumbs-portal')
  6. return { dom, top: true }
  7. }
  8. /**
  9. * A panel which contains the editor breadcrumbs
  10. */
  11. export const breadcrumbPanel = () => {
  12. if (!isSplitTestEnabled('editor-redesign')) {
  13. return []
  14. }
  15. return [showPanel.of(createBreadcrumbsPanel)]
  16. }