@dxos/plugin-simple-layout 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/dist/lib/{browser/SimpleLayoutPlugin-Q5BZE6KD.mjs → neutral/SimpleLayoutPlugin.mjs} +3 -1
- package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs +21 -0
- package/dist/lib/neutral/app-graph-builder-EYQKLRRP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +21 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs +22 -0
- package/dist/lib/neutral/chunk-7UDV3JDT.mjs.map +7 -0
- package/dist/lib/{browser/index.mjs → neutral/chunk-AMTEDJHG.mjs} +5 -8
- package/dist/lib/neutral/chunk-AMTEDJHG.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs +26 -0
- package/dist/lib/neutral/chunk-FD2CAY4Q.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XVUAQHKU.mjs +8 -0
- package/dist/lib/neutral/chunk-XVUAQHKU.mjs.map +7 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs +35 -0
- package/dist/lib/neutral/close-WKMURGUB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +926 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +332 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-XI2T7D5O.mjs +49 -0
- package/dist/lib/neutral/open-XI2T7D5O.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-EAIE7KPR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs +18 -0
- package/dist/lib/neutral/react-root-VE265VX4.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-REZMYKQV.mjs +46 -0
- package/dist/lib/neutral/react-surface-REZMYKQV.mjs.map +7 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs +22 -0
- package/dist/lib/neutral/revert-workspace-ST6NZUNG.mjs.map +7 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs +22 -0
- package/dist/lib/neutral/set-6ZRLWPJS.mjs.map +7 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs +13 -0
- package/dist/lib/neutral/set-layout-mode-L22HRCKS.mjs.map +7 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs +58 -0
- package/dist/lib/neutral/spotlight-dismiss-EIYW5E7M.mjs.map +7 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs +47 -0
- package/dist/lib/neutral/state-7NXKBLPY.mjs.map +7 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs +25 -0
- package/dist/lib/neutral/switch-workspace-PYWPTMFO.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/translations.mjs +2 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs +33 -0
- package/dist/lib/neutral/update-complementary-HKWF5OXT.mjs.map +7 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs +30 -0
- package/dist/lib/neutral/update-dialog-P4ASXCE7.mjs.map +7 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs +34 -0
- package/dist/lib/neutral/update-popover-REAKC2GN.mjs.map +7 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs +12 -0
- package/dist/lib/neutral/update-sidebar-O5SQPR6Q.mjs.map +7 -0
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs +129 -0
- package/dist/lib/neutral/url-handler-GZXUUAHD.mjs.map +7 -0
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +3 -3
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +3 -3
- package/dist/types/src/hooks/actions.d.ts.map +1 -1
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts +3 -3
- package/dist/types/src/hooks/useSimpleLayoutState.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/state-access.d.ts +3 -3
- package/dist/types/src/operations/state-access.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/types/{capabilities.d.ts → SimpleLayoutCapabilities.d.ts} +2 -8
- package/dist/types/src/types/SimpleLayoutCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts +4 -0
- package/dist/types/src/types/SimpleLayoutEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +81 -45
- package/src/capabilities/state.tsx +5 -6
- package/src/capabilities/url-handler.ts +16 -13
- package/src/components/Home/Home.tsx +1 -1
- package/src/components/Loading/Loading.tsx +1 -1
- package/src/components/MobileLayout/MobileLayout.tsx +0 -2
- package/src/components/NavBranch/NavBranch.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -0
- package/src/components/SimpleLayout/AppBar.tsx +42 -40
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +3 -3
- package/src/hooks/actions.ts +5 -3
- package/src/hooks/useAppBarProps.ts +2 -2
- package/src/hooks/useDrawerActions.ts +2 -2
- package/src/hooks/useNavbarActions.ts +2 -2
- package/src/hooks/useSimpleLayoutState.ts +7 -5
- package/src/index.ts +1 -6
- package/src/meta.ts +1 -0
- package/src/operations/open.ts +1 -1
- package/src/operations/state-access.ts +5 -3
- package/src/plugin.ts +11 -0
- package/src/types/{capabilities.ts → SimpleLayoutCapabilities.ts} +3 -15
- package/src/types/SimpleLayoutEvents.ts +15 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/SimpleLayoutPlugin-Q5BZE6KD.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/translations.mjs.map +0 -7
- package/dist/lib/node-esm/SimpleLayoutPlugin-OD45TNPO.mjs +0 -52
- package/dist/lib/node-esm/index.mjs +0 -24
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/translations.mjs +0 -36
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -6
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/types/events.ts +0 -15
- /package/dist/lib/{node-esm/SimpleLayoutPlugin-OD45TNPO.mjs.map → neutral/SimpleLayoutPlugin.mjs.map} +0 -0
- /package/dist/lib/{node-esm → neutral}/translations.mjs.map +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/DebugOverlay/DebugOverlay.tsx", "../../../../src/components/Home/Home.tsx", "../../../../src/components/hooks.ts", "../../../../src/components/Loading/Loading.tsx", "../../../../src/components/MobileLayout/MobileLayout.tsx", "../../../../src/components/Popover/Popover.tsx", "../../../../src/components/SimpleLayout/AppBar.tsx", "../../../../src/components/SimpleLayout/Main.tsx", "../../../../src/components/SimpleLayout/NavBar.tsx", "../../../../src/components/SimpleLayout/SimpleLayout.tsx", "../../../../src/components/Dialog/Dialog.tsx", "../../../../src/components/SimpleLayout/Drawer.tsx", "../../../../src/components/NavBranch/NavBranch.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, useCallback, useRef } from 'react';\n\nconst DEBUG_OVERLAY_NAME = 'DebugOverlay';\n\n//\n// Context\n//\n\ntype DebugOverlayContextValue = {\n /** Log a timestamped message to the on-screen debug overlay. */\n dbg: (msg: string) => void;\n};\n\n// Default to a no-op so hooks can call useDebugLog() safely outside of a provider.\nconst [DebugOverlayProvider, useDebugLog] = createContext<DebugOverlayContextValue>(DEBUG_OVERLAY_NAME, {\n dbg: () => {},\n});\n\n//\n// Root\n//\n\ntype DebugOverlayRootProps = PropsWithChildren<{\n /**\n * When true (default), renders the on-screen log panel.\n * Set to false to suppress the overlay while keeping the context available.\n */\n enabled?: boolean;\n maxLines?: number;\n}>;\n\n/**\n * Establishes a debug overlay context.\n *\n * When enabled, renders an on-screen monospaced log panel anchored just above\n * the keyboard (via --kb-height CSS variable). Descendants can call\n * useDebugLog() to obtain the dbg() function for logging.\n *\n * Intended for transient mobile debugging in the iOS Simulator where DevTools\n * console output may not be accessible.\n */\nconst DebugOverlayRoot = ({ children, enabled = true, maxLines = 10 }: DebugOverlayRootProps) => {\n const overlayRef = useRef<HTMLDivElement>(null);\n\n const dbg = useCallback((msg: string) => {\n if (!overlayRef.current) {\n return;\n }\n const line = document.createElement('pre');\n line.textContent = `${(performance.now() / 1000).toFixed(2).padStart(8, ' ')} ${msg}`;\n overlayRef.current.prepend(line);\n while (overlayRef.current.children.length > maxLines) {\n overlayRef.current.lastChild?.remove();\n }\n }, []);\n\n return (\n <DebugOverlayProvider dbg={dbg}>\n {children}\n {enabled && (\n <div\n ref={overlayRef}\n style={{\n position: 'fixed',\n bottom: 'calc(var(--kb-height, 0px) + 8px)',\n left: 8,\n right: 8,\n background: 'rgba(0,0,0,0.8)',\n color: '#0f0',\n fontSize: 10,\n fontFamily: 'monospace',\n padding: 6,\n borderRadius: 4,\n zIndex: 9999,\n pointerEvents: 'none',\n }}\n />\n )}\n </DebugOverlayProvider>\n );\n};\n\n//\n// Exports\n//\n\nexport const DebugOverlay = {\n Root: DebugOverlayRoot,\n};\n\nexport { useDebugLog };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Node, useConnections } from '@dxos/plugin-graph';\nimport { Avatar, Icon, ScrollArea, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\nimport { Mosaic, type MosaicStackTileComponent } from '@dxos/react-ui-mosaic';\nimport { SearchPanel, useSearchListItem, useSearchListResults } from '@dxos/react-ui-search';\nimport { mx } from '@dxos/ui-theme';\nimport { byPosition, getHostPlatform, isTauri } from '@dxos/util';\n\nimport { meta } from '#meta';\n\nimport { useExpandPath } from '../hooks';\n\nexport type HomeProps = {};\n\n/**\n * Home screen.\n */\nexport const Home = (_: HomeProps) => {\n const { t } = useTranslation(meta.id);\n const userAccountItem = useItemsByDisposition('user-account')[0];\n const pinnedItems = useItemsByDisposition('pin-end', true);\n const workspaceItems = useItemsByDisposition('workspace');\n useExpandPath(Node.RootId);\n\n const items = useMemo(\n () => [...(userAccountItem ? [userAccountItem] : []), ...pinnedItems, ...workspaceItems],\n [userAccountItem, pinnedItems, workspaceItems],\n );\n\n const { results, handleSearch } = useSearchListResults({\n items,\n extract: (node) => toLocalizedString(node.properties.label, t),\n });\n\n const autoFocus = !isTauri() || getHostPlatform() !== 'ios';\n\n return (\n <SearchPanel onSearch={handleSearch}>\n <Mosaic.Container asChild>\n <ScrollArea.Root centered padding thin>\n <ScrollArea.Viewport>\n <Mosaic.Stack\n classNames='gap-1'\n draggable={false}\n items={results}\n getId={(item) => item.id}\n Tile={WorkspaceTile}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Mosaic.Container>\n </SearchPanel>\n );\n};\n\nconst WorkspaceTile: MosaicStackTileComponent<Node.Node> = (props) => {\n const data = props.data;\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const { selectedValue, registerItem, unregisterItem } = useSearchListItem();\n const name = toLocalizedString(data.properties.label, t);\n const isSelected = selectedValue === data.id;\n const cardRef = useRef<HTMLDivElement>(null);\n\n useExpandPath(data.id);\n\n const handleSelect = useCallback(\n () => invokePromise(LayoutOperation.SwitchWorkspace, { subject: data.id }),\n [invokePromise, data.id],\n );\n\n // Register this workspace with the search context.\n useEffect(() => {\n if (cardRef.current) {\n registerItem(data.id, cardRef.current, handleSelect);\n }\n\n return () => unregisterItem(data.id);\n }, [data.id, handleSelect, registerItem, unregisterItem]);\n\n // Scroll into view when selected.\n useEffect(() => {\n if (isSelected && cardRef.current) {\n cardRef.current.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n }, [isSelected]);\n\n return (\n <Card.Root\n role='button'\n fullWidth\n tabIndex={-1} // TODO(burdon): Use Mosaic.Focus.\n data-selected={isSelected}\n classNames={mx('dx-focus-ring', isSelected && 'bg-selected-surface')}\n onClick={handleSelect}\n ref={cardRef}\n >\n <Card.Toolbar density='fine'>\n <Avatar.Root>\n <Avatar.Content\n icon={data.properties.icon}\n hue={data.properties.hue}\n hueVariant='transparent'\n variant='square'\n size={8}\n fallback={name}\n />\n <Avatar.Label classNames='cursor-pointer'>{name}</Avatar.Label>\n <Icon icon='ph--caret-right--regular' />\n </Avatar.Root>\n </Card.Toolbar>\n </Card.Root>\n );\n};\n\n/** Filters nodes by disposition. */\nconst filterItems = (node: Node.Node, disposition: string) => {\n return node.properties.disposition === disposition;\n};\n\n/** Returns root-level items filtered by disposition. */\nconst useItemsByDisposition = (disposition: string, sort = false) => {\n const { graph } = useAppGraph();\n const connections = useConnections(graph, Node.RootId, 'child');\n return useMemo(() => {\n const filtered = connections.filter((node) => filterItems(node, disposition));\n return sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;\n }, [connections, disposition, sort]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Graph } from '@dxos/plugin-graph';\nimport { expandAttendableId } from '@dxos/react-ui-attention';\n\n/**\n * Expand graph nodes along the full path from root to the given node ID.\n * Walks each progressive prefix, ensuring ancestor nodes are materialized\n * before attempting to access their children.\n */\nexport const useExpandPath = (nodeId?: string) => {\n const { graph } = useAppGraph();\n\n useEffect(() => {\n if (nodeId) {\n for (const prefix of expandAttendableId(nodeId)) {\n Graph.expand(graph, prefix, 'child');\n }\n }\n }, [nodeId, graph]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\n// TODO(burdon): Show skeleton: https://github.com/dxos/dxos/issues/8259\nexport const Loading = () => {\n return <div className='grid place-items-center dx-attention-surface' />;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, forwardRef, useEffect, useLayoutEffect, useState } from 'react';\n\nimport { addEventListener, combine } from '@dxos/async';\nimport { log } from '@dxos/log';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useDebugLog } from '../DebugOverlay';\n\nconst MOBILE_LAYOUT_NAME = 'MobileLayout';\nconst MOBILE_LAYOUT_ROOT_NAME = 'MobileLayout.Root';\nconst MOBILE_LAYOUT_PANEL_NAME = 'MobileLayout.Panel';\n\n//\n// Context\n//\n\ntype MobileLayoutContextValue = {\n keyboardOpen: boolean;\n};\n\nconst [MobileLayoutProvider, useMobileLayout] = createContext<MobileLayoutContextValue>(MOBILE_LAYOUT_NAME);\n\n//\n// Root\n//\n\ntype MobileLayoutRootProps = ThemedClassName<\n PropsWithChildren<{\n transition?: number;\n onKeyboardOpenChange?: (nextState: boolean) => void;\n }>\n>;\n\n/**\n * Mobile layout root container that handles iOS keyboard detection.\n */\n// TODO(burdon): Should this be ios-only?\nconst MobileLayoutRoot = forwardRef<HTMLDivElement, MobileLayoutRootProps>(\n ({ classNames, children, transition = 500, onKeyboardOpenChange, ...props }, forwardedRef) => {\n const { open: keyboardOpen } = useIOSKeyboard();\n useLockBodyScroll(keyboardOpen);\n useAutoScroll();\n\n // Fire synchronously after DOM mutation (before paint) so SimpleLayout's Splitter mode\n // change is batched into the same paint as the keyboard open state change, preventing\n // intermediate render frames from showing an un-adjusted layout.\n useLayoutEffect(() => onKeyboardOpenChange?.(keyboardOpen), [keyboardOpen, onKeyboardOpenChange]);\n\n return (\n <MobileLayoutProvider keyboardOpen={keyboardOpen}>\n <div\n {...props}\n style={{\n height: 'calc(100vh - var(--kb-height, 0px))',\n transition: `height ${keyboardOpen ? 0 : transition}ms ease-out`,\n // transition: `height ${animationDuration}ms ease-out`,\n }}\n className={mx('fixed top-0 left-0 right-0 grid overflow-hidden', classNames)}\n ref={forwardedRef}\n >\n {children}\n </div>\n </MobileLayoutProvider>\n );\n },\n);\n\nMobileLayoutRoot.displayName = MOBILE_LAYOUT_ROOT_NAME;\n\n//\n// Panel\n//\n\ntype MobileLayoutPanelProps = ThemedClassName<\n PropsWithChildren<{\n safe?: {\n top: boolean;\n bottom: boolean;\n };\n }>\n>;\n\n/**\n * Mobile layout panel that applies safe area insets.\n */\nconst MobileLayoutPanel = forwardRef<HTMLDivElement, MobileLayoutPanelProps>(\n ({ classNames, children, safe, ...props }, forwardedRef) => {\n return (\n <div\n {...props}\n style={{\n paddingTop: safe?.top ? 'env(safe-area-inset-top)' : undefined,\n paddingBottom: safe?.bottom ? `calc((1 - var(--kb-open, 0)) * env(safe-area-inset-bottom))` : undefined,\n }}\n className={mx(classNames)}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\nMobileLayoutPanel.displayName = MOBILE_LAYOUT_PANEL_NAME;\n\n//\n// Exports\n//\n\nexport const MobileLayout = {\n Root: MobileLayoutRoot,\n Panel: MobileLayoutPanel,\n};\n\nexport { useMobileLayout };\n\nexport type { MobileLayoutRootProps, MobileLayoutPanelProps };\n\n/**\n * Prevents iOS (WKWebView) from shifting the layout when the keyboard appears.\n *\n * Scroll events and window.scrollY stay at 0 in this WKWebView setup — the shift is\n * caused by the browser's scroll-into-view for the focused input. We keep a window\n * scroll reset as belt-and-suspenders, and also monitor container scroll events.\n */\nconst useAutoScroll = () => {\n // TODO(burdon): Remove debug logging.\n const { dbg } = useDebugLog('useAutoScroll');\n\n useEffect(() => {\n const resetScroll = () => {\n if (window.scrollX !== 0 || window.scrollY !== 0) {\n window.scrollTo(0, 0);\n }\n };\n\n const detectContainerScroll = (event: Event) => {\n const el = event.target as HTMLElement;\n if (el === document.documentElement || el === document.body) {\n return;\n }\n\n dbg(`scroll: ${el.tagName}.${Array.from(el.classList).slice(0, 2).join('.')} top=${el.scrollTop.toFixed(0)}`);\n };\n\n return combine(\n addEventListener(window, 'scroll', resetScroll),\n window.visualViewport ? addEventListener(window.visualViewport, 'scroll' as any, resetScroll) : () => {},\n\n // TODO(burdon): Remove debug logging.\n addEventListener(document, 'scroll', detectContainerScroll as EventListener, { capture: true } as any),\n\n // Prevent focus-triggered scroll-into-view on inputs.\n (() => {\n let focusingWithPreventScroll = false;\n return addEventListener(\n document,\n 'focus',\n (event: FocusEvent) => {\n if (focusingWithPreventScroll) {\n return;\n }\n\n const target = event.target as HTMLElement;\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n focusingWithPreventScroll = true;\n target.focus({ preventScroll: true });\n focusingWithPreventScroll = false;\n }\n },\n { capture: true },\n );\n })(),\n );\n }, [dbg]);\n};\n\n/**\n * Prevent iOS Safari viewport scroll when enabled.\n * Setting overflow:hidden doesn't work on iOS, so we must preventDefault on touchmove events.\n * Only allows scrolling if the target is within a scrollable container.\n */\nconst useLockBodyScroll = (enabled: boolean) => {\n useEffect(() => {\n if (!enabled) {\n return;\n }\n\n const isScrollable = (el: HTMLElement | null, axis: 'x' | 'y'): boolean => {\n while (el && el !== document.body) {\n const style = getComputedStyle(el);\n if (axis === 'y') {\n const overflow = style.overflowY;\n if ((overflow === 'auto' || overflow === 'scroll') && el.scrollHeight > el.clientHeight) {\n return true;\n }\n } else {\n const overflow = style.overflowX;\n if ((overflow === 'auto' || overflow === 'scroll') && el.scrollWidth > el.clientWidth) {\n return true;\n }\n }\n\n el = el.parentElement;\n }\n\n return false;\n };\n\n let touchStartX = 0;\n let touchStartY = 0;\n\n return combine(\n // Record initial touch position.\n addEventListener(\n document,\n 'touchstart',\n (event: TouchEvent) => {\n const touch = event.touches[0];\n touchStartX = touch.clientX;\n touchStartY = touch.clientY;\n },\n { passive: true },\n ),\n\n // Prevent scrolling the viewport.\n addEventListener(\n document,\n 'touchmove',\n (event: TouchEvent) => {\n const touch = event.touches[0];\n const dx = Math.abs(touch.clientX - touchStartX);\n const dy = Math.abs(touch.clientY - touchStartY);\n if (!isScrollable(event.target as HTMLElement, dx > dy ? 'x' : 'y')) {\n event.preventDefault();\n }\n },\n { passive: false },\n ),\n );\n }, [enabled]);\n};\n\n//\n// Hooks\n//\n\ntype IOSKeyboard = {\n open: boolean;\n height: number;\n /** Native keyboard animation duration in ms, from the iOS keyboard event. */\n duration: number | undefined;\n};\n\n/**\n * Mobile container that handles iOS keyboard layout adjustments.\n *\n * Uses two strategies for keyboard detection:\n * 1. Tauri iOS: Native keyboard plugin for reliable height/animation events.\n * 2. Web/PWA: visualViewport API as fallback.\n *\n * iPhone (portrait, points)\n * - Without predictive bar: ~291 pt\n * - With predictive bar: ~335 pt\n * - With accessory view: ~380–420 pt\n *\n * Example:\n * - Viewport: 874 (entire screen)\n * - SafeArea: 96 (62+34)\n * - Main: 778\n * - Keyboard: 318; 413 (incl. Input Accessory View)\n *\n * CSS Variables set on document.documentElement:\n * --vvh: Visual viewport height (use as container height).\n * --kb-height: Keyboard height in pixels.\n * --kb-open: 1 when keyboard is open, 0 when closed.\n *\n * NOTE: By default when an input is selected on iOS the Input Accessory View is shown above the keyboard.\n * This can be disabled by setting the `inputAccessoryView` property to `false`.\n *\n * On iOS (Tauri), listens for 'keyboard' CustomEvents dispatched by the native KeyboardObserver.swift.\n * Falls back to VisualViewport API on other platforms.\n */\nconst useIOSKeyboard = (): IOSKeyboard => {\n const { dbg } = useDebugLog('useIOSKeyboard');\n\n const [open, setOpen] = useState(false);\n const [height, setHeight] = useState(0);\n const [duration, setDuration] = useState<number | undefined>(undefined);\n\n // Detect keyboard state.\n useEffect(() => {\n const viewport = window.visualViewport;\n if (!viewport) {\n return;\n }\n\n // Handler for VisualViewport resize (fallback for non-iOS).\n const initialHeight = viewport.height ?? window.innerHeight;\n\n const updateState = (keyboardHeight: number, keyboardOpen: boolean, animationDuration?: number) => {\n setOpen(keyboardOpen);\n setHeight(keyboardHeight);\n setDuration(animationDuration);\n\n const vvh = initialHeight - keyboardHeight;\n document.documentElement.style.setProperty('--vvh', `${vvh}px`);\n document.documentElement.style.setProperty('--kb-height', `${keyboardHeight}px`);\n document.documentElement.style.setProperty('--kb-open', keyboardOpen ? '1' : '0');\n log.info('viewport size', { initialHeight, vvh, keyboardHeight, keyboardOpen, animationDuration });\n };\n\n let rafId: number | undefined;\n\n return combine(\n // Handler for native iOS keyboard events (from KeyboardObserver.swift).\n addEventListener(\n window,\n 'keyboard' as any,\n (event: CustomEvent<{ type: 'show' | 'hide'; height: number; duration: number }>) => {\n const { type, height, duration } = event.detail;\n // iOS KeyboardObserver.swift sends duration in seconds (e.g., 0.25). Convert to ms.\n const durationMs = duration < 1 ? duration * 1000 : duration;\n\n // TODO(burdon): Remove debug logging.\n const vp = window.visualViewport;\n dbg(\n `kb:${type} h=${height} dur=${duration} scrollY=${window.scrollY} vpOffset=${vp?.offsetTop?.toFixed(0) ?? '?'}`,\n );\n log.info('keyboard event', { type, height, duration });\n\n updateState(height, type === 'show', durationMs);\n\n // RAF loop: monitor visualViewport.offsetTop and window.scrollY every frame.\n // TODO(burdon): Remove debug logging.\n const end = performance.now() + durationMs + 300;\n let prevOffsetTop = vp?.offsetTop ?? 0;\n let prevScrollY = window.scrollY;\n const monitorFrame = () => {\n const offsetTop = vp?.offsetTop ?? 0;\n const scrollY = window.scrollY;\n if (offsetTop !== prevOffsetTop || scrollY !== prevScrollY) {\n dbg(`Δ vpOffset=${offsetTop.toFixed(0)} scrollY=${scrollY.toFixed(0)}`);\n prevOffsetTop = offsetTop;\n prevScrollY = scrollY;\n }\n if (scrollY !== 0) {\n window.scrollTo(0, 0);\n }\n if (performance.now() < end) {\n rafId = requestAnimationFrame(monitorFrame);\n }\n };\n rafId = requestAnimationFrame(monitorFrame);\n },\n ),\n () => {\n if (rafId !== undefined) {\n cancelAnimationFrame(rafId);\n }\n },\n );\n }, [dbg]);\n\n return { open, height, duration };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Popover, type PopoverContentInteractOutsideEvent, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\n\nimport { useSimpleLayoutState } from '#hooks';\nimport { meta } from '#meta';\n\nconst DEBOUNCE_DELAY = 40;\n\ntype LayoutPopoverContextValue = {\n setOpen: (open: boolean) => void;\n};\n\nconst [LayoutPopoverProvider, useLayoutPopoverContext] = createContext<LayoutPopoverContextValue>('LayoutPopover');\n\nexport const PopoverRoot = ({ children }: PropsWithChildren) => {\n const { state } = useSimpleLayoutState();\n const [open, setOpen] = useState(false);\n const virtualRef = useRef<HTMLButtonElement | null>(null);\n const [virtualIter, setVirtualIter] = useState(0);\n const debounceRef = useRef<NodeJS.Timeout | null>(null);\n\n // TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering\n // the anchor further down the tree or measuring the virtual trigger's client rect.\n useEffect(() => {\n setOpen(false);\n if (state.popoverOpen) {\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n if (state.popoverAnchor && virtualRef.current !== state.popoverAnchor) {\n virtualRef.current = state.popoverAnchor ?? null;\n setVirtualIter((iter) => iter + 1);\n }\n debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);\n }\n }, [state.popoverOpen, state.popoverAnchorId, state.popoverAnchor, state.popoverContent]);\n\n return (\n <LayoutPopoverProvider setOpen={setOpen}>\n <Popover.Root modal={false} open={open}>\n {state.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}\n {children}\n </Popover.Root>\n </LayoutPopoverProvider>\n );\n};\n\nexport const PopoverContent = () => {\n const { t } = useTranslation(meta.id);\n const { state, updateState } = useSimpleLayoutState();\n const { setOpen } = useLayoutPopoverContext('PopoverContent');\n const handleClose = useCallback(() => {\n setOpen(false);\n updateState((s) => ({\n ...s,\n popoverOpen: false,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverSide: undefined,\n }));\n }, [setOpen, updateState]);\n\n const handleInteractOutside = useCallback(\n (event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {\n if (\n // TODO(thure): CodeMirror should not focus itself when it updates.\n event.type === 'dismissableLayer.focusOutside' &&\n (event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')\n ) {\n event.preventDefault();\n } else {\n handleClose();\n }\n },\n [handleClose],\n );\n\n /* TODO(thure): Make this a constant and document it. */\n const collisionBoundaries: HTMLElement[] = useMemo(() => {\n const closest = state.popoverAnchor?.closest('[data-popover-collision-boundary]') as HTMLElement | null | undefined;\n return closest ? [closest] : [];\n }, [state.popoverAnchor]);\n\n return (\n <Popover.Portal>\n <Popover.Content\n side={state.popoverSide}\n sticky='always'\n hideWhenDetached\n collisionBoundary={collisionBoundaries}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleInteractOutside}\n >\n <Popover.Viewport>\n {state.popoverKind === 'base' && state.popoverContent && 'component' in state.popoverContent && (\n <Surface.Surface type={AppSurface.Popover} data={state.popoverContent} limit={1} />\n )}\n {state.popoverKind === 'card' && (\n <Card.Root border={false} classNames='dx-card-popover'>\n <Card.Toolbar>\n {/* TODO(wittjosiah): Cleaner way to handle no drag handle in toolbar? */}\n <span />\n {state.popoverTitle ? <Card.Title>{toLocalizedString(state.popoverTitle, t)}</Card.Title> : <span />}\n <Card.CloseIconButton onClick={handleClose} />\n </Card.Toolbar>\n {state.popoverContent && 'subject' in state.popoverContent && (\n <Surface.Surface type={AppSurface.Card} data={state.popoverContent} limit={1} />\n )}\n </Card.Root>\n )}\n </Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom, useAtomValue } from '@effect-atom/atom-react';\nimport React, { Fragment } from 'react';\n\nimport { DensityProvider, IconButton, Popover, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type ActionExecutor, type ActionGraphProps, Menu, useMenuActions } from '@dxos/react-ui-menu';\nimport { composable, composableProps, osTranslations } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\n\nimport { useMobileLayout } from '../MobileLayout';\n\nconst APP_BAR_NAME = 'SimpleLayout.AppBar';\n\nexport type AppBarProps = {\n /** Title/label to display in the banner. */\n title?: string;\n /** Action graph atom for the dropdown menu. */\n actions: Atom.Atom<ActionGraphProps>;\n /** Whether to show the back button. */\n showBackButton?: boolean;\n /** Popover anchor ID for the dropdown trigger. */\n popoverAnchorId?: string;\n /** Action executor callback. */\n onAction?: ActionExecutor;\n /** Callback when back button is clicked. */\n onBack?: () => void;\n};\n\n/**\n * AppBar component that renders a title, optional back button, and actions dropdown.\n */\nexport const AppBar = composable<HTMLDivElement, AppBarProps>(\n ({ classNames, title, actions, showBackButton, popoverAnchorId, onAction, onBack, ...props }, forwardedRef) => {\n const { t } = useTranslation(meta.id);\n const menuActions = useMenuActions(actions);\n const actionsValue = useAtomValue(actions);\n const hasActions = actionsValue.nodes.length > 0;\n const { keyboardOpen } = useMobileLayout(APP_BAR_NAME);\n\n // Fall back to app name if no title provided.\n const displayTitle = title ?? t('current-app.name', { ns: osTranslations });\n\n // Wrap the menu trigger with Popover.Anchor when the popoverAnchorId is set.\n const AnchorRoot = popoverAnchorId ? Popover.Anchor : Fragment;\n\n return (\n <DensityProvider density='fine'>\n <Toolbar.Root\n {...composableProps(props, {\n role: 'banner',\n classNames: 'grid grid-cols-[var(--dx-rail-size)_1fr_var(--dx-rail-size)] items-center dx-density-fine',\n })}\n ref={forwardedRef}\n >\n {keyboardOpen ? (\n <IconButton variant='ghost' icon='ph--x--regular' iconOnly label={t('done.label')} />\n ) : showBackButton ? (\n <IconButton\n variant='ghost'\n icon='ph--caret-left--regular'\n iconOnly\n label={t('back.label')}\n onClick={onBack}\n />\n ) : (\n <div />\n )}\n <h1 className='text-center truncate font-thin uppercase'>{displayTitle}</h1>\n {hasActions ? (\n <AnchorRoot>\n <Menu.Root {...menuActions} caller={meta.id} onAction={onAction}>\n <Menu.Trigger asChild>\n <IconButton\n variant='ghost'\n icon='ph--dots-three-vertical--regular'\n iconOnly\n label={t('actions-menu.label')}\n />\n </Menu.Trigger>\n <Menu.Content />\n </Menu.Root>\n </AnchorRoot>\n ) : (\n <span />\n )}\n </Toolbar.Root>\n </DensityProvider>\n );\n },\n);\n\nAppBar.displayName = APP_BAR_NAME;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface, useAppGraph } from '@dxos/app-toolkit/ui';\nimport { useNode } from '@dxos/plugin-graph';\nimport { ErrorFallback, Panel } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\n\nimport { useAppBarProps, useNavbarActions, useSimpleLayoutState } from '#hooks';\n\nimport { useExpandPath } from '../hooks';\nimport { Loading } from '../Loading';\nimport { useMobileLayout } from '../MobileLayout';\nimport { AppBar } from './AppBar';\nimport { NavBar } from './NavBar';\n\nconst MAIN_NAME = 'SimpleLayout.Main';\n\n/**\n * Main content component.\n */\nexport const Main = () => {\n const { state } = useSimpleLayoutState();\n const id = state.active ?? state.workspace;\n const attentionAttrs = useAttentionAttributes(id);\n const { keyboardOpen } = useMobileLayout(MAIN_NAME);\n const { actions, onAction } = useNavbarActions();\n const appBarProps = useAppBarProps();\n\n const placeholder = useMemo(() => <Loading />, []);\n\n const { graph } = useAppGraph();\n const node = useNode(graph, id);\n const data = useMemo(() => {\n return (\n node && {\n attendableId: id,\n subject: node.data,\n properties: node.properties,\n popoverAnchorId: state.popoverAnchorId,\n }\n );\n }, [id, node, node?.data, node?.properties, state.popoverAnchorId]);\n\n useExpandPath(id);\n\n // TODO(burdon): BUG: When showing ANY statusbar the size progressively shrinks when the keyboard opens/closes.\n const showNavBar = !keyboardOpen && !state.isPopover && state.drawerState === 'closed';\n\n return (\n <Panel.Root {...attentionAttrs} className='dx-document'>\n <Panel.Toolbar asChild>\n <AppBar {...appBarProps} />\n </Panel.Toolbar>\n <Panel.Content role='article' className='bg-base-surface'>\n <Surface.Surface\n key={id}\n type={AppSurface.Article}\n data={data}\n limit={1}\n fallback={ErrorFallback}\n placeholder={placeholder}\n />\n </Panel.Content>\n {showNavBar && (\n <Panel.Statusbar asChild>\n <NavBar actions={actions} onAction={onAction} />\n </Panel.Statusbar>\n )}\n </Panel.Root>\n );\n};\n\nMain.displayName = MAIN_NAME;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport React from 'react';\n\nimport { type ActionExecutor, type ActionGraphProps, Menu, useMenuActions } from '@dxos/react-ui-menu';\nimport { composable, composableProps } from '@dxos/ui-theme';\n\nconst NAVBAR_NAME = 'SimpleLayout.NavBar';\n\nexport type NavBarProps = {\n /** Action graph atom for the toolbar. */\n actions: Atom.Atom<ActionGraphProps>;\n /** Action executor callback. */\n onAction?: ActionExecutor;\n};\n\n/**\n * Presentational navbar component that renders a toolbar from an action graph.\n */\nexport const NavBar = composable<HTMLDivElement, NavBarProps>(({ actions, onAction, ...props }, forwardedRef) => {\n const menuActions = useMenuActions(actions);\n\n return (\n <Menu.Root {...menuActions} alwaysActive onAction={onAction}>\n <Menu.Toolbar {...composableProps(props)} ref={forwardedRef} />\n </Menu.Root>\n );\n});\n\nNavBar.displayName = NAVBAR_NAME;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n\nimport { Splitter, type SplitterMode } from '@dxos/react-ui';\nimport { Mosaic } from '@dxos/react-ui-mosaic';\n\nimport { useSimpleLayoutState } from '#hooks';\n\nimport { DebugOverlay } from '../DebugOverlay';\nimport { Dialog } from '../Dialog';\nimport { MobileLayout } from '../MobileLayout';\nimport { PopoverContent, PopoverRoot } from '../Popover';\nimport { Drawer } from './Drawer';\nimport { Main } from './Main';\n\nexport const SimpleLayout = () => {\n const { state } = useSimpleLayoutState();\n const [keyboardOpen, setKeyboardOpen] = useState(false);\n const [splitterMode, setSplitterMode] = useState<SplitterMode>('top');\n\n const drawerRef = useRef<HTMLDivElement>(null);\n\n // Restore Splitter mode when keyboard closes.\n useLayoutEffect(() => {\n if (!keyboardOpen) {\n setSplitterMode(state.drawerState === 'closed' ? 'top' : state.drawerState === 'open' ? 'split' : 'bottom');\n }\n }, [state.drawerState, keyboardOpen]);\n\n return (\n <DebugOverlay.Root enabled={false}>\n <PopoverRoot>\n <Mosaic.Root>\n <MobileLayout.Root\n classNames='dx-container grid relative bg-toolbar-surface'\n onKeyboardOpenChange={(nextKeyboardOpen) => setKeyboardOpen(nextKeyboardOpen)}\n >\n <MobileLayout.Panel safe={{ top: true, bottom: splitterMode === 'top' }}>\n <Splitter.Root mode={splitterMode} ratio={0.55}>\n <Splitter.Panel position='top'>\n <Main />\n </Splitter.Panel>\n <Splitter.Panel position='bottom' ref={drawerRef}>\n <Drawer />\n </Splitter.Panel>\n </Splitter.Root>\n <Dialog />\n <PopoverContent />\n </MobileLayout.Panel>\n </MobileLayout.Root>\n </Mosaic.Root>\n </PopoverRoot>\n </DebugOverlay.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';\nimport { ErrorFallback } from '@dxos/react-ui';\n\nimport { useSimpleLayoutState } from '#hooks';\n\nexport const Dialog = () => {\n const { state, updateState } = useSimpleLayoutState();\n\n const DialogRoot = state.dialogType === 'alert' ? AlertDialog.Root : NaturalDialog.Root;\n const DialogOverlay = state.dialogType === 'alert' ? AlertDialog.Overlay : NaturalDialog.Overlay;\n\n return (\n <DialogRoot\n modal={state.dialogBlockAlign !== 'end'}\n open={state.dialogOpen}\n onOpenChange={(nextOpen) => updateState((state) => ({ ...state, dialogOpen: nextOpen }))}\n >\n {state.dialogBlockAlign === 'end' ? (\n <Surface.Surface\n type={AppSurface.Dialog}\n data={state.dialogContent ?? undefined}\n limit={1}\n fallback={ErrorFallback}\n />\n ) : (\n <DialogOverlay\n blockAlign={state.dialogBlockAlign}\n classNames={state.dialogOverlayClasses}\n style={state.dialogOverlayStyle}\n >\n <Surface.Surface\n type={AppSurface.Dialog}\n data={state.dialogContent ?? undefined}\n limit={1}\n fallback={ErrorFallback}\n />\n </DialogOverlay>\n )}\n </DialogRoot>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useMemo } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface, useAppGraph } from '@dxos/app-toolkit/ui';\nimport { type Node, useNode } from '@dxos/plugin-graph';\nimport { ErrorFallback, Panel } from '@dxos/react-ui';\nimport { getLinkedVariant } from '@dxos/react-ui-attention';\nimport { Menu, useMenuActions } from '@dxos/react-ui-menu';\n\nimport { useCompanions, useDrawerActions, useSimpleLayoutState } from '#hooks';\n\nimport { Loading } from '../Loading';\n\nconst DRAWER_NAME = 'SimpleLayout.Drawer';\n\n/**\n * Companion drawer component.\n */\nexport const Drawer = () => {\n const { graph } = useAppGraph();\n const { state: layoutState } = useSimpleLayoutState();\n\n const placeholder = useMemo(() => <Loading />, []);\n\n // Get all companions for the current active (primary) item.\n const activeId = layoutState.active ?? layoutState.workspace;\n const companions = useCompanions(activeId);\n const { companionId, variant } = useSelectedCompanion(companions, layoutState.companionVariant);\n\n // Get node for the selected companion.\n const node = useNode(graph, companionId);\n const parentNode = useNode(graph, activeId);\n\n // Build Surface data for the companion content.\n const data = useMemo<AppSurface.ArticleData | undefined>(() => {\n if (!node || !companionId) {\n return undefined;\n }\n return {\n attendableId: companionId,\n subject: node.data,\n companionTo: parentNode?.data,\n properties: node.properties,\n variant,\n };\n }, [companionId, node, parentNode, variant]);\n\n // Get drawer actions (tabs + toolbar buttons).\n const { actions, onAction } = useDrawerActions(DRAWER_NAME);\n const menuActions = useMenuActions(actions);\n\n return (\n <Panel.Root>\n <Panel.Toolbar>\n <Menu.Root {...menuActions} alwaysActive onAction={onAction}>\n <Menu.Toolbar />\n </Menu.Root>\n </Panel.Toolbar>\n <Panel.Content>\n <Surface.Surface\n type={AppSurface.Article}\n data={data}\n limit={1}\n fallback={ErrorFallback}\n placeholder={placeholder}\n />\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nDrawer.displayName = DRAWER_NAME;\n\n/**\n * Resolves which companion to show based on variant preference.\n * Falls back to first available if preferred variant not available.\n */\nconst useSelectedCompanion = (companions: Node.Node[], preferredVariant?: string) => {\n const selectedCompanion = useMemo(() => {\n if (companions.length === 0) {\n return undefined;\n }\n\n // Try to find companion matching the preferred variant.\n if (preferredVariant) {\n const preferred = companions.find((c) => getLinkedVariant(c.id) === preferredVariant);\n if (preferred) {\n return preferred;\n }\n }\n\n // Fallback to first companion.\n return companions[0];\n }, [companions, preferredVariant]);\n\n const companionId = selectedCompanion?.id;\n const variant = companionId ? getLinkedVariant(companionId) : undefined;\n\n return { selectedCompanion, companionId, variant };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { type Node, useConnections } from '@dxos/plugin-graph';\nimport { Avatar, Icon, ScrollArea, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui';\nimport { Mosaic, type MosaicStackTileComponent } from '@dxos/react-ui-mosaic';\nimport { SearchPanel, useSearchListItem, useSearchListResults } from '@dxos/react-ui-search';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\n\nimport { useExpandPath } from '../hooks';\n\nexport type NavBranchProps = {\n id: string;\n};\n\n/**\n * Renders the children of a graph branch node as a searchable mosaic list.\n * Used for any node with `role: 'branch'` or a workspace disposition, including\n * spaces, collection sections, type sections, and schema nodes.\n */\nexport const NavBranch = ({ id }: NavBranchProps) => {\n const { t } = useTranslation(meta.id);\n const { graph } = useAppGraph();\n\n useExpandPath(id);\n\n const children = useConnections(graph, id, 'child');\n\n const visibleChildren = useMemo(\n () => children.filter((node) => node.properties.disposition !== 'hidden'),\n [children],\n );\n\n const { results, handleSearch } = useSearchListResults({\n items: visibleChildren,\n extract: (child) => toLocalizedString(child.properties.label, t),\n });\n\n return (\n <SearchPanel onSearch={handleSearch}>\n <Mosaic.Container asChild>\n <ScrollArea.Root centered padding thin>\n <ScrollArea.Viewport>\n <Mosaic.Stack\n classNames='gap-1'\n draggable={false}\n items={results}\n getId={(item) => item.id}\n Tile={NavBranchTile}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Mosaic.Container>\n </SearchPanel>\n );\n};\n\nconst NavBranchTile: MosaicStackTileComponent<Node.Node> = (props) => {\n const data = props.data;\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const ref = useRef<HTMLDivElement>(null);\n const { selectedValue, registerItem, unregisterItem } = useSearchListItem();\n const isSelected = selectedValue === data.id;\n\n const name = toLocalizedString(data.properties.label, t);\n\n const handleSelect = useCallback(\n () => void invokePromise(LayoutOperation.Open, { subject: [data.id] }),\n [invokePromise, data.id],\n );\n\n // Register this item with the search context.\n useEffect(() => {\n if (ref.current) {\n registerItem(data.id, ref.current, handleSelect);\n }\n\n return () => unregisterItem(data.id);\n }, [data.id, handleSelect, registerItem, unregisterItem]);\n\n // Scroll into view when selected.\n useEffect(() => {\n if (isSelected && ref.current) {\n ref.current.scrollIntoView({ block: 'nearest', behavior: 'smooth' });\n }\n }, [isSelected]);\n\n return (\n <Card.Root\n ref={ref}\n role='button'\n fullWidth\n tabIndex={-1} // TODO(burdon): Use Mosaic.Focus.\n data-selected={isSelected}\n classNames={mx('dx-focus-ring cursor-pointer', isSelected && 'bg-selected-surface')}\n onClick={handleSelect}\n >\n <Card.Toolbar>\n <Avatar.Root>\n <Avatar.Content\n hue={data.properties.hue}\n icon={data.properties.icon}\n hueVariant='transparent'\n variant='square'\n size={8}\n fallback={name}\n />\n <Avatar.Label>{name}</Avatar.Label>\n <Icon icon='ph--caret-right--regular' />\n </Avatar.Root>\n </Card.Toolbar>\n </Card.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,q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C;;EAAI,CAAA,GACpE;IAAC4C;IAAeD,KAAK3C;GAAG;AAI1B2D,EAAAA,WAAU,MAAA;AACR,QAAIb,IAAIc,SAAS;AACfX,mBAAaN,KAAK3C,IAAI8C,IAAIc,SAASN,YAAAA;IACrC;AAEA,WAAO,MAAMJ,eAAeP,KAAK3C,EAAE;EACrC,GAAG;IAAC2C,KAAK3C;IAAIsD;IAAcL;IAAcC;GAAe;AAGxDS,EAAAA,WAAU,MAAA;AACR,QAAIP,cAAcN,IAAIc,SAAS;AAC7Bd,UAAIc,QAAQC,eAAe;QAAEC,OAAO;QAAWC,UAAU;MAAS,CAAA;IACpE;EACF,GAAG;IAACX;GAAW;AAEf,SACE,gBAAA7B,QAAA,cAACyC,MAAKlC,MAAI;IACRgB;IACAmB,MAAK;IACLC,WAAAA;IACAC,UAAU;IACVC,iBAAehB;IACfhB,YAAYiC,IAAG,gCAAgCjB,cAAc,qBAAA;IAC7DkB,SAAShB;KAET,gBAAA/B,QAAA,cAACyC,MAAKO,SAAO,MACX,gBAAAhD,QAAA,cAACiD,QAAO1C,MAAI,MACV,gBAAAP,QAAA,cAACiD,QAAOC,SAAO;IACbC,KAAK/B,KAAK9B,WAAW6D;IACrBC,MAAMhC,KAAK9B,WAAW8D;IACtBC,YAAW;IACXC,SAAQ;IACRC,MAAM;IACNC,UAAU1B;MAEZ,gBAAA9B,QAAA,cAACiD,QAAOQ,OAAK,MAAE3B,IAAAA,GACf,gBAAA9B,QAAA,cAAC0D,OAAAA;IAAKN,MAAK;;AAKrB;",
|
|
6
|
+
"names": ["createContext", "React", "useCallback", "useRef", "DEBUG_OVERLAY_NAME", "DebugOverlayProvider", "useDebugLog", "dbg", "DebugOverlayRoot", "children", "enabled", "maxLines", "overlayRef", "msg", "current", "line", "document", "createElement", "textContent", "performance", "now", "toFixed", "padStart", "prepend", "length", "lastChild", "remove", "div", "ref", "style", "position", "bottom", "left", "right", "background", "color", "fontSize", "fontFamily", "padding", "borderRadius", "zIndex", "pointerEvents", "DebugOverlay", "Root", "React", "useCallback", "useEffect", "useMemo", "useRef", "useOperationInvoker", "LayoutOperation", "useAppGraph", "Node", "useConnections", "Avatar", "Icon", "ScrollArea", "toLocalizedString", "useTranslation", "Card", "Mosaic", "SearchPanel", "useSearchListItem", "useSearchListResults", "mx", "byPosition", "getHostPlatform", "isTauri", "meta", "useEffect", "useAppGraph", "Graph", "expandAttendableId", "useExpandPath", "nodeId", "graph", "prefix", "expand", "Home", "_", "t", "useTranslation", "meta", "id", "userAccountItem", "useItemsByDisposition", "pinnedItems", "workspaceItems", "useExpandPath", "Node", "RootId", "items", "useMemo", "results", "handleSearch", "useSearchListResults", "extract", "node", "toLocalizedString", "properties", "label", "autoFocus", "isTauri", "getHostPlatform", "React", "SearchPanel", "onSearch", "Mosaic", "Container", "asChild", "ScrollArea", "Root", "centered", "padding", "thin", "Viewport", "Stack", "classNames", "draggable", "getId", "item", "Tile", "WorkspaceTile", "props", "data", "invokePromise", "useOperationInvoker", "selectedValue", "registerItem", "unregisterItem", "useSearchListItem", "name", "isSelected", "cardRef", "useRef", "handleSelect", "useCallback", "LayoutOperation", "SwitchWorkspace", "subject", "useEffect", "current", "scrollIntoView", "block", "behavior", "Card", "role", "fullWidth", "tabIndex", "data-selected", "mx", "onClick", "ref", "Toolbar", "density", "Avatar", "Content", "icon", "hue", "hueVariant", "variant", "size", "fallback", "Label", "Icon", "filterItems", "disposition", "sort", "graph", "useAppGraph", "connections", "useConnections", "filtered", "filter", "toSorted", "a", "b", "byPosition", "React", "Loading", "div", "className", "createContext", "React", "forwardRef", "useEffect", "useLayoutEffect", "useState", "addEventListener", "combine", "log", "mx", "MOBILE_LAYOUT_NAME", "MOBILE_LAYOUT_PANEL_NAME", "useMobileLayout", "useLockBodyScroll", "keyboardOpen", "useAutoScroll", "onKeyboardOpenChange", "React", "div", "transition", "className", "ref", "children", "MobileLayoutRoot", "paddingBottom", "classNames", "MobileLayoutPanel", "Panel", "useDebugLog", "resetScroll", "window", "scrollTo", "documentElement", "combine", "addEventListener", "visualViewport", "capture", "focusingWithPreventScroll", "target", "focus", "dbg", "style", "getComputedStyle", "axis", "overflow", "overflowY", "el", "touchStartX", "document", "clientX", "touchStartY", "touch", "clientY", "passive", "Math", "dy", "isScrollable", "event", "dx", "preventDefault", "enabled", "useState", "height", "setHeight", "duration", "setDuration", "useEffect", "viewport", "setOpen", "keyboardOpen", "keyboardHeight", "animationDuration", "vvh", "initialHeight", "setProperty", "log", "rafId", "durationMs", "vp", "info", "type", "updateState", "prevScrollY", "scrollY", "monitorFrame", "offsetTop", "prevOffsetTop", "performance", "end", "cancelAnimationFrame", "createContext", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Surface", "AppSurface", "Popover", "toLocalizedString", "useTranslation", "Card", "useSimpleLayoutState", "meta", "DEBOUNCE_DELAY", "LayoutPopoverProvider", "useLayoutPopoverContext", "PopoverRoot", "children", "state", "open", "setOpen", "virtualRef", "virtualIter", "setVirtualIter", "debounceRef", "popoverOpen", "current", "clearTimeout", "popoverAnchor", "iter", "setTimeout", "popoverAnchorId", "popoverContent", "Root", "modal", "VirtualTrigger", "key", "PopoverContent", "t", "id", "updateState", "handleClose", "s", "undefined", "popoverSide", "handleInteractOutside", "event", "type", "currentTarget", "classList", "contains", "preventDefault", "collisionBoundaries", "closest", "Portal", "Content", "side", "sticky", "hideWhenDetached", "collisionBoundary", "onInteractOutside", "onEscapeKeyDown", "Viewport", "popoverKind", "data", "limit", "border", "classNames", "Toolbar", "span", "popoverTitle", "Title", "CloseIconButton", "onClick", "Arrow", "useAtomValue", "React", "Fragment", "DensityProvider", "IconButton", "Popover", "Toolbar", "useTranslation", "Menu", "useMenuActions", "composable", "composableProps", "osTranslations", "meta", "APP_BAR_NAME", "AppBar", "composable", "classNames", "title", "actions", "showBackButton", "popoverAnchorId", "onAction", "onBack", "props", "forwardedRef", "t", "useTranslation", "meta", "id", "menuActions", "useMenuActions", "actionsValue", "useAtomValue", "hasActions", "nodes", "length", "keyboardOpen", "useMobileLayout", "displayTitle", "ns", "osTranslations", "AnchorRoot", "Popover", "Anchor", "Fragment", "React", "DensityProvider", "density", "Toolbar", "Root", "composableProps", "role", "ref", "IconButton", "variant", "icon", "iconOnly", "label", "onClick", "div", "h1", "className", "Menu", "caller", "Trigger", "asChild", "Content", "span", "displayName", "React", "useMemo", "Surface", "AppSurface", "useAppGraph", "useNode", "ErrorFallback", "Panel", "useAttentionAttributes", "useAppBarProps", "useNavbarActions", "useSimpleLayoutState", "React", "Menu", "useMenuActions", "composable", "composableProps", "NAVBAR_NAME", "NavBar", "actions", "onAction", "props", "forwardedRef", "menuActions", "Root", "alwaysActive", "Toolbar", "ref", "displayName", "MAIN_NAME", "Main", "state", "useSimpleLayoutState", "id", "active", "workspace", "attentionAttrs", "useAttentionAttributes", "keyboardOpen", "useMobileLayout", "actions", "onAction", "useNavbarActions", "appBarProps", "useAppBarProps", "placeholder", "useMemo", "React", "Loading", "graph", "useAppGraph", "node", "useNode", "data", "attendableId", "subject", "properties", "popoverAnchorId", "useExpandPath", "showNavBar", "isPopover", "drawerState", "Panel", "Root", "className", "Toolbar", "asChild", "AppBar", "Content", "role", "Surface", "key", "type", "AppSurface", "Article", "limit", "fallback", "ErrorFallback", "Statusbar", "NavBar", "displayName", "React", "useLayoutEffect", "useRef", "useState", "Splitter", "Mosaic", "useSimpleLayoutState", "React", "Surface", "AppSurface", "AlertDialog", "Dialog", "NaturalDialog", "ErrorFallback", "useSimpleLayoutState", "state", "updateState", "DialogRoot", "dialogType", "Root", "DialogOverlay", "Overlay", "modal", "dialogBlockAlign", "open", "dialogOpen", "onOpenChange", "nextOpen", "type", "data", "dialogContent", "undefined", "limit", "fallback", "blockAlign", "classNames", "dialogOverlayClasses", "style", "dialogOverlayStyle", "React", "useMemo", "Surface", "AppSurface", "useAppGraph", "useNode", "ErrorFallback", "Panel", "getLinkedVariant", "Menu", "useMenuActions", "useCompanions", "useDrawerActions", "useSimpleLayoutState", "DRAWER_NAME", "Drawer", "graph", "useAppGraph", "state", "layoutState", "useSimpleLayoutState", "placeholder", "useMemo", "React", "Loading", "activeId", "active", "workspace", "companions", "useCompanions", "companionId", "variant", "useSelectedCompanion", "companionVariant", "node", "useNode", "parentNode", "data", "undefined", "attendableId", "subject", "companionTo", "properties", "actions", "onAction", "useDrawerActions", "menuActions", "useMenuActions", "Panel", "Root", "Toolbar", "Menu", "alwaysActive", "Content", "Surface", "type", "AppSurface", "Article", "limit", "fallback", "ErrorFallback", "displayName", "preferredVariant", "selectedCompanion", "length", "preferred", "find", "c", "getLinkedVariant", "id", "SimpleLayout", "state", "useSimpleLayoutState", "keyboardOpen", "setKeyboardOpen", "useState", "splitterMode", "setSplitterMode", "drawerRef", "useRef", "useLayoutEffect", "drawerState", "React", "DebugOverlay", "Root", "enabled", "PopoverRoot", "Mosaic", "MobileLayout", "classNames", "onKeyboardOpenChange", "nextKeyboardOpen", "Panel", "safe", "top", "bottom", "Splitter", "mode", "ratio", "position", "Main", "ref", "Drawer", "Dialog", "PopoverContent", "React", "useCallback", "useEffect", "useMemo", "useRef", "useOperationInvoker", "LayoutOperation", "useAppGraph", "useConnections", "Avatar", "Icon", "ScrollArea", "toLocalizedString", "useTranslation", "Card", "Mosaic", "SearchPanel", "useSearchListItem", "useSearchListResults", "mx", "meta", "NavBranch", "id", "t", "useTranslation", "meta", "graph", "useAppGraph", "useExpandPath", "children", "useConnections", "visibleChildren", "useMemo", "filter", "node", "properties", "disposition", "results", "handleSearch", "useSearchListResults", "items", "extract", "child", "toLocalizedString", "label", "React", "SearchPanel", "onSearch", "Mosaic", "Container", "asChild", "ScrollArea", "Root", "centered", "padding", "thin", "Viewport", "Stack", "classNames", "draggable", "getId", "item", "Tile", "NavBranchTile", "props", "data", "invokePromise", "useOperationInvoker", "ref", "useRef", "selectedValue", "registerItem", "unregisterItem", "useSearchListItem", "isSelected", "name", "handleSelect", "useCallback", "LayoutOperation", "Open", "subject", "useEffect", "current", "scrollIntoView", "block", "behavior", "Card", "role", "fullWidth", "tabIndex", "data-selected", "mx", "onClick", "Toolbar", "Avatar", "Content", "hue", "icon", "hueVariant", "variant", "size", "fallback", "Label", "Icon"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/hooks/useAppBarProps.ts
|
|
4
|
+
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
6
|
+
import { useCallback, useMemo } from "react";
|
|
7
|
+
import { useCapability, useOperationInvoker } from "@dxos/app-framework/ui";
|
|
8
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
9
|
+
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
10
|
+
import { Graph, Node, useActionRunner, useNode } from "@dxos/plugin-graph";
|
|
11
|
+
import { toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
12
|
+
import { meta } from "#meta";
|
|
13
|
+
import { SimpleLayoutCapabilities } from "#types";
|
|
14
|
+
var useAppBarProps = () => {
|
|
15
|
+
const { t } = useTranslation(meta.id);
|
|
16
|
+
const stateAtom = useCapability(SimpleLayoutCapabilities.State);
|
|
17
|
+
const state = useAtomValue(stateAtom);
|
|
18
|
+
const { graph } = useAppGraph();
|
|
19
|
+
const { invokePromise } = useOperationInvoker();
|
|
20
|
+
const runAction = useActionRunner();
|
|
21
|
+
const activeId = state.active ?? state.workspace;
|
|
22
|
+
const node = useNode(graph, activeId);
|
|
23
|
+
const title = node ? toLocalizedString(node.properties.label, t) : void 0;
|
|
24
|
+
const actionsAtom = useMemo(() => Atom.make((get) => {
|
|
25
|
+
const state2 = get(stateAtom);
|
|
26
|
+
const activeId2 = state2.active ?? state2.workspace;
|
|
27
|
+
const allActions = activeId2 ? get(graph.actions(activeId2)) : [];
|
|
28
|
+
const filtered = allActions.filter((action) => [
|
|
29
|
+
"list-item",
|
|
30
|
+
"list-item-primary",
|
|
31
|
+
"heading-list-item"
|
|
32
|
+
].includes(action.properties.disposition));
|
|
33
|
+
const nodes = filtered;
|
|
34
|
+
const edges = filtered.map((action) => ({
|
|
35
|
+
source: "root",
|
|
36
|
+
target: action.id,
|
|
37
|
+
relation: "child"
|
|
38
|
+
}));
|
|
39
|
+
return {
|
|
40
|
+
nodes,
|
|
41
|
+
edges
|
|
42
|
+
};
|
|
43
|
+
}), [
|
|
44
|
+
graph,
|
|
45
|
+
stateAtom
|
|
46
|
+
]);
|
|
47
|
+
const showBackButton = activeId !== void 0 && activeId !== Node.RootId;
|
|
48
|
+
const onBack = useCallback(() => {
|
|
49
|
+
if (state.active) {
|
|
50
|
+
const isWorkspace = Graph.getNode(graph, state.active).pipe(Option.map((node2) => node2.properties.disposition === "workspace"), Option.getOrElse(() => false));
|
|
51
|
+
if (state.history.length === 0 && isWorkspace) {
|
|
52
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, {
|
|
53
|
+
subject: Node.RootId
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
void invokePromise(LayoutOperation.Close, {
|
|
57
|
+
subject: [
|
|
58
|
+
state.active
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
void invokePromise(LayoutOperation.SwitchWorkspace, {
|
|
64
|
+
subject: Node.RootId
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}, [
|
|
68
|
+
graph,
|
|
69
|
+
invokePromise,
|
|
70
|
+
state.active,
|
|
71
|
+
state.history.length
|
|
72
|
+
]);
|
|
73
|
+
const popoverAnchorId = node && state.popoverAnchorId === `${meta.id}:${node.id}` ? state.popoverAnchorId : void 0;
|
|
74
|
+
return {
|
|
75
|
+
title,
|
|
76
|
+
actions: actionsAtom,
|
|
77
|
+
showBackButton,
|
|
78
|
+
popoverAnchorId,
|
|
79
|
+
onBack,
|
|
80
|
+
onAction: runAction
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/hooks/useCompanions.ts
|
|
85
|
+
import { useMemo as useMemo2 } from "react";
|
|
86
|
+
import { useAppGraph as useAppGraph2 } from "@dxos/app-toolkit/ui";
|
|
87
|
+
import { useConnections } from "@dxos/plugin-graph";
|
|
88
|
+
import { byPosition as byPosition2 } from "@dxos/util";
|
|
89
|
+
|
|
90
|
+
// src/hooks/actions.ts
|
|
91
|
+
import * as Effect from "effect/Effect";
|
|
92
|
+
import { Node as Node2 } from "@dxos/plugin-graph";
|
|
93
|
+
import { getLinkedVariant } from "@dxos/react-ui-attention";
|
|
94
|
+
import { byPosition } from "@dxos/util";
|
|
95
|
+
var PLANK_COMPANION_TYPE = "org.dxos.plugin.deck.plank-companion";
|
|
96
|
+
var createCompanionActions = (graph, stateAtom, get, config) => {
|
|
97
|
+
const { idPrefix, selectedVariant, updateState } = config;
|
|
98
|
+
const state = get(stateAtom);
|
|
99
|
+
const activeId = state.active ?? state.workspace;
|
|
100
|
+
const activeConnections = activeId ? get(graph.connections(activeId, "child")) : [];
|
|
101
|
+
const companions = activeConnections.filter((node) => node.type === PLANK_COMPANION_TYPE).toSorted((a, b) => byPosition(a.properties, b.properties));
|
|
102
|
+
const nodes = [];
|
|
103
|
+
const edges = [];
|
|
104
|
+
companions.forEach((companion) => {
|
|
105
|
+
const companionVariant = getLinkedVariant(companion.id);
|
|
106
|
+
const companionAction = {
|
|
107
|
+
id: `${idPrefix}-companion-${companion.id}`,
|
|
108
|
+
type: Node2.ActionType,
|
|
109
|
+
properties: {
|
|
110
|
+
icon: companion.properties.icon ?? "ph--placeholder--regular",
|
|
111
|
+
label: companion.properties.label,
|
|
112
|
+
iconOnly: true,
|
|
113
|
+
...selectedVariant !== void 0 && {
|
|
114
|
+
variant: selectedVariant === companionVariant ? "primary" : "ghost"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
data: () => Effect.sync(() => updateState((current) => {
|
|
118
|
+
const closing = current.companionVariant === companionVariant && current.drawerState !== "closed";
|
|
119
|
+
return {
|
|
120
|
+
...current,
|
|
121
|
+
companionVariant: closing ? void 0 : companionVariant,
|
|
122
|
+
drawerState: closing ? "closed" : "open"
|
|
123
|
+
};
|
|
124
|
+
}))
|
|
125
|
+
};
|
|
126
|
+
nodes.push(companionAction);
|
|
127
|
+
edges.push({
|
|
128
|
+
source: "root",
|
|
129
|
+
target: companionAction.id,
|
|
130
|
+
relation: "child"
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
nodes,
|
|
135
|
+
edges
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// src/hooks/useCompanions.ts
|
|
140
|
+
var useCompanions = (nodeId) => {
|
|
141
|
+
const { graph } = useAppGraph2();
|
|
142
|
+
const nodes = useConnections(graph, nodeId, "child");
|
|
143
|
+
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
144
|
+
return useMemo2(() => companions.toSorted((a, b) => byPosition2(a.properties, b.properties)), [
|
|
145
|
+
companions
|
|
146
|
+
]);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// src/hooks/useDrawerActions.ts
|
|
150
|
+
import { Atom as Atom2 } from "@effect-atom/atom-react";
|
|
151
|
+
import * as Effect2 from "effect/Effect";
|
|
152
|
+
import { useMemo as useMemo3 } from "react";
|
|
153
|
+
import { useCapability as useCapability3 } from "@dxos/app-framework/ui";
|
|
154
|
+
import { useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
|
|
155
|
+
import { Node as Node3, useActionRunner as useActionRunner2 } from "@dxos/plugin-graph";
|
|
156
|
+
import { useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
157
|
+
import { createGapSeparator } from "@dxos/react-ui-menu";
|
|
158
|
+
import { useMobileLayout } from "#components";
|
|
159
|
+
import { meta as meta2 } from "#meta";
|
|
160
|
+
import { SimpleLayoutCapabilities as SimpleLayoutCapabilities3 } from "#types";
|
|
161
|
+
|
|
162
|
+
// src/hooks/useSimpleLayoutState.ts
|
|
163
|
+
import { RegistryContext, useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
|
|
164
|
+
import { useCallback as useCallback2, useContext } from "react";
|
|
165
|
+
import { useCapability as useCapability2 } from "@dxos/app-framework/ui";
|
|
166
|
+
import { SimpleLayoutCapabilities as SimpleLayoutCapabilities2 } from "#types";
|
|
167
|
+
var useSimpleLayoutState = () => {
|
|
168
|
+
const registry = useContext(RegistryContext);
|
|
169
|
+
const stateAtom = useCapability2(SimpleLayoutCapabilities2.State);
|
|
170
|
+
const state = useAtomValue2(stateAtom);
|
|
171
|
+
const updateState = useCallback2((fn) => {
|
|
172
|
+
registry.set(stateAtom, fn(registry.get(stateAtom)));
|
|
173
|
+
}, [
|
|
174
|
+
registry,
|
|
175
|
+
stateAtom
|
|
176
|
+
]);
|
|
177
|
+
return {
|
|
178
|
+
state,
|
|
179
|
+
updateState
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// src/hooks/useDrawerActions.ts
|
|
184
|
+
var useDrawerActions = (consumerName) => {
|
|
185
|
+
const { t } = useTranslation2(meta2.id);
|
|
186
|
+
const stateAtom = useCapability3(SimpleLayoutCapabilities3.State);
|
|
187
|
+
const { graph } = useAppGraph3();
|
|
188
|
+
const runAction = useActionRunner2();
|
|
189
|
+
const { updateState } = useSimpleLayoutState();
|
|
190
|
+
const { keyboardOpen } = useMobileLayout(consumerName);
|
|
191
|
+
const actionsAtom = useMemo3(() => Atom2.make((get) => {
|
|
192
|
+
const state = get(stateAtom);
|
|
193
|
+
const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {
|
|
194
|
+
idPrefix: "drawer",
|
|
195
|
+
selectedVariant: state.drawerState !== "closed" ? state.companionVariant : void 0,
|
|
196
|
+
updateState
|
|
197
|
+
});
|
|
198
|
+
const gapSeparator = createGapSeparator("drawer-gap");
|
|
199
|
+
nodes.push(...gapSeparator.nodes);
|
|
200
|
+
edges.push(...gapSeparator.edges);
|
|
201
|
+
if (!keyboardOpen) {
|
|
202
|
+
const isExpanded = state.drawerState === "expanded";
|
|
203
|
+
const toggleExpandAction = {
|
|
204
|
+
id: "drawer-toggle-expand",
|
|
205
|
+
type: Node3.ActionType,
|
|
206
|
+
properties: {
|
|
207
|
+
icon: isExpanded ? "ph--arrow-down--regular" : "ph--arrow-up--regular",
|
|
208
|
+
label: isExpanded ? t("collapse-drawer.label") : t("expand-drawer.label"),
|
|
209
|
+
iconOnly: true
|
|
210
|
+
},
|
|
211
|
+
data: () => Effect2.sync(() => updateState((state2) => ({
|
|
212
|
+
...state2,
|
|
213
|
+
drawerState: isExpanded ? "open" : "expanded"
|
|
214
|
+
})))
|
|
215
|
+
};
|
|
216
|
+
nodes.push(toggleExpandAction);
|
|
217
|
+
edges.push({
|
|
218
|
+
source: "root",
|
|
219
|
+
target: toggleExpandAction.id,
|
|
220
|
+
relation: "child"
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
const closeAction = {
|
|
224
|
+
id: "drawer-close",
|
|
225
|
+
type: Node3.ActionType,
|
|
226
|
+
properties: {
|
|
227
|
+
icon: "ph--x--regular",
|
|
228
|
+
label: t("close-drawer.label"),
|
|
229
|
+
iconOnly: true
|
|
230
|
+
},
|
|
231
|
+
data: () => Effect2.sync(() => updateState((state2) => ({
|
|
232
|
+
...state2,
|
|
233
|
+
drawerState: "closed",
|
|
234
|
+
companionVariant: void 0
|
|
235
|
+
})))
|
|
236
|
+
};
|
|
237
|
+
nodes.push(closeAction);
|
|
238
|
+
edges.push({
|
|
239
|
+
source: "root",
|
|
240
|
+
target: closeAction.id,
|
|
241
|
+
relation: "child"
|
|
242
|
+
});
|
|
243
|
+
return {
|
|
244
|
+
nodes,
|
|
245
|
+
edges
|
|
246
|
+
};
|
|
247
|
+
}), [
|
|
248
|
+
graph,
|
|
249
|
+
stateAtom,
|
|
250
|
+
updateState,
|
|
251
|
+
keyboardOpen,
|
|
252
|
+
t
|
|
253
|
+
]);
|
|
254
|
+
return {
|
|
255
|
+
actions: actionsAtom,
|
|
256
|
+
onAction: runAction
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/hooks/useNavbarActions.ts
|
|
261
|
+
import { Atom as Atom3 } from "@effect-atom/atom-react";
|
|
262
|
+
import { useMemo as useMemo4 } from "react";
|
|
263
|
+
import { useCapability as useCapability4 } from "@dxos/app-framework/ui";
|
|
264
|
+
import { useAppGraph as useAppGraph4 } from "@dxos/app-toolkit/ui";
|
|
265
|
+
import { Node as Node4, useActionRunner as useActionRunner3 } from "@dxos/plugin-graph";
|
|
266
|
+
import { useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
267
|
+
import { createGapSeparator as createGapSeparator2, createMenuItemGroup } from "@dxos/react-ui-menu";
|
|
268
|
+
import { meta as meta3 } from "#meta";
|
|
269
|
+
import { SimpleLayoutCapabilities as SimpleLayoutCapabilities4 } from "#types";
|
|
270
|
+
var MAIN_MENU_GROUP_ID = "navbar-main-menu";
|
|
271
|
+
var useNavbarActions = () => {
|
|
272
|
+
const { t } = useTranslation3(meta3.id);
|
|
273
|
+
const { graph } = useAppGraph4();
|
|
274
|
+
const runAction = useActionRunner3();
|
|
275
|
+
const stateAtom = useCapability4(SimpleLayoutCapabilities4.State);
|
|
276
|
+
const { updateState } = useSimpleLayoutState();
|
|
277
|
+
const actionsAtom = useMemo4(() => Atom3.make((get) => {
|
|
278
|
+
const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {
|
|
279
|
+
idPrefix: "navbar",
|
|
280
|
+
updateState
|
|
281
|
+
});
|
|
282
|
+
const gapSeparator = createGapSeparator2("navbar-gap");
|
|
283
|
+
nodes.push(...gapSeparator.nodes);
|
|
284
|
+
edges.push(...gapSeparator.edges);
|
|
285
|
+
const mainMenuGroup = createMenuItemGroup(MAIN_MENU_GROUP_ID, {
|
|
286
|
+
variant: "dropdownMenu",
|
|
287
|
+
icon: "ph--list--regular",
|
|
288
|
+
iconOnly: true,
|
|
289
|
+
label: t("main-menu.label"),
|
|
290
|
+
testId: "simpleLayoutPlugin.addSpace"
|
|
291
|
+
});
|
|
292
|
+
nodes.push(mainMenuGroup);
|
|
293
|
+
edges.push({
|
|
294
|
+
source: "root",
|
|
295
|
+
target: mainMenuGroup.id,
|
|
296
|
+
relation: "child"
|
|
297
|
+
});
|
|
298
|
+
const rootActions = get(graph.actions(Node4.RootId));
|
|
299
|
+
const menuActions = rootActions.filter((node) => node.properties.disposition === "menu");
|
|
300
|
+
menuActions.forEach((menuAction) => {
|
|
301
|
+
nodes.push(menuAction);
|
|
302
|
+
edges.push({
|
|
303
|
+
source: MAIN_MENU_GROUP_ID,
|
|
304
|
+
target: menuAction.id,
|
|
305
|
+
relation: "child"
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
return {
|
|
309
|
+
nodes,
|
|
310
|
+
edges
|
|
311
|
+
};
|
|
312
|
+
}), [
|
|
313
|
+
graph,
|
|
314
|
+
stateAtom,
|
|
315
|
+
updateState,
|
|
316
|
+
t
|
|
317
|
+
]);
|
|
318
|
+
return {
|
|
319
|
+
actions: actionsAtom,
|
|
320
|
+
onAction: runAction
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
export {
|
|
324
|
+
PLANK_COMPANION_TYPE,
|
|
325
|
+
createCompanionActions,
|
|
326
|
+
useAppBarProps,
|
|
327
|
+
useCompanions,
|
|
328
|
+
useDrawerActions,
|
|
329
|
+
useNavbarActions,
|
|
330
|
+
useSimpleLayoutState
|
|
331
|
+
};
|
|
332
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/hooks/useAppBarProps.ts", "../../../../src/hooks/useCompanions.ts", "../../../../src/hooks/actions.ts", "../../../../src/hooks/useDrawerActions.ts", "../../../../src/hooks/useSimpleLayoutState.ts", "../../../../src/hooks/useNavbarActions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\nimport { useCallback, useMemo } from 'react';\n\nimport { useCapability, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Graph, Node, useActionRunner, useNode } from '@dxos/plugin-graph';\nimport { toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { type ActionGraphProps } from '@dxos/react-ui-menu';\n\nimport { type AppBarProps } from '#components';\nimport { meta } from '#meta';\nimport { SimpleLayoutCapabilities } from '#types';\n\n/**\n * Hook that computes all AppBar props from the app graph.\n * Derives activeId from state atom. Returns props ready to spread into the AppBar component.\n */\nexport const useAppBarProps = (): Omit<AppBarProps, 'classNames'> => {\n const { t } = useTranslation(meta.id);\n const stateAtom = useCapability(SimpleLayoutCapabilities.State);\n const state = useAtomValue(stateAtom);\n const { graph } = useAppGraph();\n const { invokePromise } = useOperationInvoker();\n const runAction = useActionRunner();\n\n // Derive activeId from state.\n const activeId = state.active ?? state.workspace;\n const node = useNode(graph, activeId);\n\n // Compute title from node label.\n const title = node ? toLocalizedString(node.properties.label, t) : undefined;\n\n // Build actions atom filtering by disposition.\n // Derive activeId from state atom so we don't need to recreate this atom when it changes.\n const actionsAtom = useMemo(\n () =>\n Atom.make((get): ActionGraphProps => {\n const state = get(stateAtom);\n const activeId = state.active ?? state.workspace;\n const allActions = activeId ? get(graph.actions(activeId)) : [];\n const filtered = allActions.filter((action) =>\n ['list-item', 'list-item-primary', 'heading-list-item'].includes(action.properties.disposition),\n );\n const nodes: ActionGraphProps['nodes'] = filtered as ActionGraphProps['nodes'];\n const edges: ActionGraphProps['edges'] = filtered.map((action) => ({\n source: 'root',\n target: action.id,\n relation: 'child',\n }));\n\n return { nodes, edges };\n }),\n [graph, stateAtom],\n );\n\n // Back button logic.\n const showBackButton = activeId !== undefined && activeId !== Node.RootId;\n\n const onBack = useCallback(() => {\n if (state.active) {\n const isWorkspace = Graph.getNode(graph, state.active).pipe(\n Option.map((node) => node.properties.disposition === 'workspace'),\n Option.getOrElse(() => false),\n );\n\n // If history is empty and this is a workspace, go to home.\n if (state.history.length === 0 && isWorkspace) {\n void invokePromise(LayoutOperation.SwitchWorkspace, { subject: Node.RootId });\n } else {\n // Otherwise, close (which will pop from history or clear active).\n void invokePromise(LayoutOperation.Close, { subject: [state.active] });\n }\n } else {\n void invokePromise(LayoutOperation.SwitchWorkspace, { subject: Node.RootId });\n }\n }, [graph, invokePromise, state.active, state.history.length]);\n\n // Compute popover anchor ID.\n const popoverAnchorId = node && state.popoverAnchorId === `${meta.id}:${node.id}` ? state.popoverAnchorId : undefined;\n\n return {\n title,\n actions: actionsAtom,\n showBackButton,\n popoverAnchorId,\n onBack: onBack,\n onAction: runAction,\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { PLANK_COMPANION_TYPE } from './actions';\n\n/**\n * @deprecated Adopt the pattern from useNavbarActions (deriving from graph atoms)\n * or merge the Drawer companion display into the NavBar component.\n */\nexport const useCompanions = (nodeId?: string) => {\n const { graph } = useAppGraph();\n const nodes = useConnections(graph, nodeId, 'child');\n const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);\n return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Node } from '@dxos/plugin-graph';\nimport { getLinkedVariant } from '@dxos/react-ui-attention';\nimport { type ActionGraphProps } from '@dxos/react-ui-menu';\nimport { byPosition } from '@dxos/util';\n\nimport { SimpleLayoutCapabilities } from '#types';\n\n// TODO(wittjosiah): Factor out to shared location with plugin-deck.\nexport const PLANK_COMPANION_TYPE = 'org.dxos.plugin.deck.plank-companion';\n\nexport type CompanionActionsConfig = {\n /** Prefix for companion action IDs (e.g. 'navbar' or 'drawer') */\n idPrefix: string;\n /** Optional: highlight companion with this variant */\n selectedVariant?: string;\n /** State updater for toggling the drawer. */\n updateState: (\n fn: (state: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,\n ) => void;\n};\n\n/**\n * Creates action graph nodes and edges for companion actions.\n * Shared logic between useNavbarActions and useDrawerActions.\n */\n// TODO(burdon): Use builder pattern.\nexport const createCompanionActions = (\n graph: AppCapabilities.AppGraph['graph'],\n stateAtom: Atom.Atom<SimpleLayoutCapabilities.SimpleLayoutState>,\n get: (atom: Atom.Atom<any>) => any,\n config: CompanionActionsConfig,\n): Pick<ActionGraphProps, 'nodes' | 'edges'> => {\n const { idPrefix, selectedVariant, updateState } = config;\n\n // Derive activeId from state atom.\n const state = get(stateAtom);\n const activeId = state.active ?? state.workspace;\n\n // Get companions from graph connections for activeId.\n const activeConnections = activeId ? get(graph.connections(activeId, 'child')) : [];\n const companions = activeConnections\n .filter((node: Node.Node) => node.type === PLANK_COMPANION_TYPE)\n .toSorted((a: Node.Node, b: Node.Node) => byPosition(a.properties, b.properties));\n\n const nodes: ActionGraphProps['nodes'] = [];\n const edges: ActionGraphProps['edges'] = [];\n\n companions.forEach((companion: Node.Node) => {\n const companionVariant = getLinkedVariant(companion.id);\n const companionAction = {\n id: `${idPrefix}-companion-${companion.id}`,\n type: Node.ActionType,\n properties: {\n icon: companion.properties.icon ?? 'ph--placeholder--regular',\n label: companion.properties.label,\n iconOnly: true,\n ...(selectedVariant !== undefined && {\n variant: selectedVariant === companionVariant ? 'primary' : 'ghost',\n }),\n },\n data: () =>\n Effect.sync(() =>\n updateState((current) => {\n const closing = current.companionVariant === companionVariant && current.drawerState !== 'closed';\n return {\n ...current,\n companionVariant: closing ? undefined : companionVariant,\n drawerState: closing ? 'closed' : 'open',\n };\n }),\n ),\n };\n nodes.push(companionAction);\n edges.push({ source: 'root', target: companionAction.id, relation: 'child' });\n });\n\n return { nodes, edges };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport { useMemo } from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Node, useActionRunner } from '@dxos/plugin-graph';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type ActionExecutor, type ActionGraphProps, createGapSeparator } from '@dxos/react-ui-menu';\n\nimport { useMobileLayout } from '#components';\nimport { meta } from '#meta';\nimport { SimpleLayoutCapabilities } from '#types';\n\nimport { createCompanionActions } from './actions';\nimport { useSimpleLayoutState } from './useSimpleLayoutState';\n\nexport type DrawerActions = {\n /** Action graph atom for the drawer. */\n actions: Atom.Atom<ActionGraphProps>;\n /** Action executor callback. */\n onAction: ActionExecutor;\n};\n\n/**\n * Builds the drawer actions including companion tabs and toolbar buttons.\n */\nexport const useDrawerActions = (consumerName: string): DrawerActions => {\n const { t } = useTranslation(meta.id);\n const stateAtom = useCapability(SimpleLayoutCapabilities.State);\n const { graph } = useAppGraph();\n const runAction = useActionRunner();\n const { updateState } = useSimpleLayoutState();\n const { keyboardOpen } = useMobileLayout(consumerName);\n\n // Create a computed atom that derives everything from graph connections and state.\n const actionsAtom = useMemo(\n () =>\n Atom.make((get): ActionGraphProps => {\n // Derive drawer state from state atom.\n const state = get(stateAtom);\n\n // Add companion tab actions.\n const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {\n idPrefix: 'drawer',\n selectedVariant: state.drawerState !== 'closed' ? state.companionVariant : undefined,\n updateState,\n });\n\n // Add gap separator before toolbar buttons.\n const gapSeparator = createGapSeparator('drawer-gap');\n nodes.push(...gapSeparator.nodes);\n edges.push(...gapSeparator.edges);\n\n // Add expand/collapse toggle button (hidden when keyboard is open).\n if (!keyboardOpen) {\n const isExpanded = state.drawerState === 'expanded';\n const toggleExpandAction = {\n id: 'drawer-toggle-expand',\n type: Node.ActionType,\n properties: {\n icon: isExpanded ? 'ph--arrow-down--regular' : 'ph--arrow-up--regular',\n label: isExpanded ? t('collapse-drawer.label') : t('expand-drawer.label'),\n iconOnly: true,\n },\n data: () =>\n Effect.sync(() => updateState((state) => ({ ...state, drawerState: isExpanded ? 'open' : 'expanded' }))),\n };\n nodes.push(toggleExpandAction);\n edges.push({ source: 'root', target: toggleExpandAction.id, relation: 'child' });\n }\n\n // Add close button.\n const closeAction = {\n id: 'drawer-close',\n type: Node.ActionType,\n properties: {\n icon: 'ph--x--regular',\n label: t('close-drawer.label'),\n iconOnly: true,\n },\n data: () =>\n Effect.sync(() =>\n updateState((state) => ({ ...state, drawerState: 'closed', companionVariant: undefined })),\n ),\n };\n nodes.push(closeAction);\n edges.push({ source: 'root', target: closeAction.id, relation: 'child' });\n\n return { nodes, edges };\n }),\n [graph, stateAtom, updateState, keyboardOpen, t],\n );\n\n return { actions: actionsAtom, onAction: runAction };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { RegistryContext, useAtomValue } from '@effect-atom/atom-react';\nimport { useCallback, useContext } from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\n\nimport { SimpleLayoutCapabilities } from '#types';\n\nexport type UseSimpleLayoutState = {\n state: SimpleLayoutCapabilities.SimpleLayoutState;\n updateState: (\n fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState,\n ) => void;\n};\n\nexport const useSimpleLayoutState = (): UseSimpleLayoutState => {\n const registry = useContext(RegistryContext);\n const stateAtom = useCapability(SimpleLayoutCapabilities.State);\n const state = useAtomValue(stateAtom);\n\n const updateState = useCallback(\n (fn: (current: SimpleLayoutCapabilities.SimpleLayoutState) => SimpleLayoutCapabilities.SimpleLayoutState) => {\n registry.set(stateAtom, fn(registry.get(stateAtom)));\n },\n [registry, stateAtom],\n );\n\n return { state, updateState };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport { useMemo } from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Node, useActionRunner } from '@dxos/plugin-graph';\nimport { useTranslation } from '@dxos/react-ui';\nimport {\n type ActionExecutor,\n type ActionGraphProps,\n createGapSeparator,\n createMenuItemGroup,\n} from '@dxos/react-ui-menu';\n\nimport { meta } from '#meta';\nimport { SimpleLayoutCapabilities } from '#types';\n\nimport { createCompanionActions } from './actions';\nimport { useSimpleLayoutState } from './useSimpleLayoutState';\n\nconst MAIN_MENU_GROUP_ID = 'navbar-main-menu';\n\nexport type NavbarActions = {\n /** Action graph atom for the navbar. */\n actions: Atom.Atom<ActionGraphProps>;\n /** Action executor callback. */\n onAction: ActionExecutor;\n};\n\n/**\n * Builds the navbar actions including companion icons, separator, and main menu dropdown.\n * Derives everything from graph connection atoms for proper reactivity.\n */\nexport const useNavbarActions = (): NavbarActions => {\n const { t } = useTranslation(meta.id);\n const { graph } = useAppGraph();\n const runAction = useActionRunner();\n const stateAtom = useCapability(SimpleLayoutCapabilities.State);\n const { updateState } = useSimpleLayoutState();\n\n // Create a computed atom that derives everything from graph connections and state.\n const actionsAtom = useMemo(\n () =>\n Atom.make((get): ActionGraphProps => {\n // Add companion actions.\n const { nodes, edges } = createCompanionActions(graph, stateAtom, get, {\n idPrefix: 'navbar',\n updateState,\n });\n\n // Add gap separator.\n const gapSeparator = createGapSeparator('navbar-gap');\n nodes.push(...gapSeparator.nodes);\n edges.push(...gapSeparator.edges);\n\n // Add main menu dropdown group.\n const mainMenuGroup = createMenuItemGroup(MAIN_MENU_GROUP_ID, {\n variant: 'dropdownMenu',\n icon: 'ph--list--regular',\n iconOnly: true,\n label: t('main-menu.label'),\n testId: 'simpleLayoutPlugin.addSpace',\n });\n nodes.push(mainMenuGroup);\n edges.push({ source: 'root', target: mainMenuGroup.id, relation: 'child' });\n\n // Get menu actions from root actions (on 'action' edge relation).\n const rootActions = get(graph.actions(Node.RootId));\n const menuActions = rootActions.filter((node) => node.properties.disposition === 'menu');\n\n // Add menu actions as children of the dropdown group.\n menuActions.forEach((menuAction) => {\n nodes.push(menuAction as ActionGraphProps['nodes'][number]);\n edges.push({ source: MAIN_MENU_GROUP_ID, target: menuAction.id, relation: 'child' });\n });\n\n return { nodes, edges };\n }),\n [graph, stateAtom, updateState, t],\n );\n\n return { actions: actionsAtom, onAction: runAction };\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,MAAMC,oBAAoB;AACnC,YAAYC,YAAY;AACxB,SAASC,aAAaC,eAAe;AAErC,SAASC,eAAeC,2BAA2B;AACnD,SAASC,uBAAuB;AAChC,SAASC,mBAAmB;AAC5B,SAASC,OAAOC,MAAMC,iBAAiBC,eAAe;AACtD,SAASC,mBAAmBC,sBAAsB;AAIlD,SAASC,YAAY;AACrB,SAASC,gCAAgC;AAMlC,IAAMC,iBAAiB,MAAA;AAC5B,QAAM,EAAEC,EAAC,IAAKJ,eAAeC,KAAKI,EAAE;AACpC,QAAMC,YAAYf,cAAcW,yBAAyBK,KAAK;AAC9D,QAAMC,QAAQrB,aAAamB,SAAAA;AAC3B,QAAM,EAAEG,MAAK,IAAKf,YAAAA;AAClB,QAAM,EAAEgB,cAAa,IAAKlB,oBAAAA;AAC1B,QAAMmB,YAAYd,gBAAAA;AAGlB,QAAMe,WAAWJ,MAAMK,UAAUL,MAAMM;AACvC,QAAMC,OAAOjB,QAAQW,OAAOG,QAAAA;AAG5B,QAAMI,QAAQD,OAAOhB,kBAAkBgB,KAAKE,WAAWC,OAAOd,CAAAA,IAAKe;AAInE,QAAMC,cAAc9B,QAClB,MACEJ,KAAKmC,KAAK,CAACC,QAAAA;AACT,UAAMd,SAAQc,IAAIhB,SAAAA;AAClB,UAAMM,YAAWJ,OAAMK,UAAUL,OAAMM;AACvC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AeC,oBAAmB,YAAA;AACxCL,UAAMM,KAAI,GAAIF,aAAaJ,KAAK;AAChCC,UAAMK,KAAI,GAAIF,aAAaH,KAAK;AAGhC,UAAMM,gBAAgBC,oBAAoB7B,oBAAoB;MAC5D8B,SAAS;MACTC,MAAM;MACNC,UAAU;MACVC,OAAO/B,EAAE,iBAAA;MACTgC,QAAQ;IACV,CAAA;AACAb,UAAMM,KAAKC,aAAAA;AACXN,UAAMK,KAAK;MAAEQ,QAAQ;MAAQC,QAAQR,cAAcvB;MAAIgC,UAAU;IAAQ,CAAA;AAGzE,UAAMC,cAAclB,IAAId,MAAMiC,QAAQC,MAAKC,MAAM,CAAA;AACjD,UAAMC,cAAcJ,YAAYK,OAAO,CAACC,SAASA,KAAKC,WAAWC,gBAAgB,MAAA;AAGjFJ,gBAAYK,QAAQ,CAACC,eAAAA;AACnB3B,YAAMM,KAAKqB,UAAAA;AACX1B,YAAMK,KAAK;QAAEQ,QAAQnC;QAAoBoC,QAAQY,WAAW3C;QAAIgC,UAAU;MAAQ,CAAA;IACpF,CAAA;AAEA,WAAO;MAAEhB;MAAOC;IAAM;EACxB,CAAA,GACF;IAAChB;IAAOI;IAAWI;IAAaZ;GAAE;AAGpC,SAAO;IAAEqC,SAASvB;IAAaiC,UAAUzC;EAAU;AACrD;",
|
|
6
|
+
"names": ["Atom", "useAtomValue", "Option", "useCallback", "useMemo", "useCapability", "useOperationInvoker", "LayoutOperation", "useAppGraph", "Graph", "Node", "useActionRunner", "useNode", "toLocalizedString", "useTranslation", "meta", "SimpleLayoutCapabilities", "useAppBarProps", "t", "id", "stateAtom", "State", "state", "graph", "invokePromise", "runAction", "activeId", "active", "workspace", "node", "title", "properties", "label", "undefined", "actionsAtom", "make", "get", "allActions", "actions", "filtered", "filter", "action", "includes", "disposition", "nodes", "edges", "map", "source", "target", "relation", "showBackButton", "RootId", "onBack", "isWorkspace", "getNode", "pipe", "getOrElse", "history", "length", "SwitchWorkspace", "subject", "Close", "popoverAnchorId", "onAction", "useMemo", "useAppGraph", "useConnections", "byPosition", "Effect", "Node", "getLinkedVariant", "byPosition", "PLANK_COMPANION_TYPE", "createCompanionActions", "graph", "stateAtom", "get", "config", "idPrefix", "selectedVariant", "updateState", "state", "activeId", "active", "workspace", "activeConnections", "connections", "companions", "filter", "node", "type", "toSorted", "a", "b", "properties", "nodes", "edges", "forEach", "companion", "companionVariant", "id", "companionAction", "ActionType", "icon", "label", "iconOnly", "undefined", "variant", "data", "sync", "current", "closing", "drawerState", "push", "source", "target", "relation", "useCompanions", "nodeId", "graph", "useAppGraph", "nodes", "useConnections", "companions", "filter", "node", "type", "PLANK_COMPANION_TYPE", "useMemo", "toSorted", "a", "b", "byPosition", "properties", "Atom", "Effect", "useMemo", "useCapability", "useAppGraph", "Node", "useActionRunner", "useTranslation", "createGapSeparator", "useMobileLayout", "meta", "SimpleLayoutCapabilities", "RegistryContext", "useAtomValue", "useCallback", "useContext", "useCapability", "SimpleLayoutCapabilities", "useSimpleLayoutState", "registry", "stateAtom", "State", "state", "updateState", "fn", "set", "get", "useDrawerActions", "consumerName", "t", "useTranslation", "meta", "id", "stateAtom", "useCapability", "SimpleLayoutCapabilities", "State", "graph", "useAppGraph", "runAction", "useActionRunner", "updateState", "useSimpleLayoutState", "keyboardOpen", "useMobileLayout", "actionsAtom", "useMemo", "Atom", "make", "get", "state", "nodes", "edges", "createCompanionActions", "idPrefix", "selectedVariant", "drawerState", "companionVariant", "undefined", "gapSeparator", "createGapSeparator", "push", "isExpanded", "toggleExpandAction", "type", "Node", "ActionType", "properties", "icon", "label", "iconOnly", "data", "sync", "source", "target", "relation", "closeAction", "actions", "onAction", "Atom", "useMemo", "useCapability", "useAppGraph", "Node", "useActionRunner", "useTranslation", "createGapSeparator", "createMenuItemGroup", "meta", "SimpleLayoutCapabilities", "MAIN_MENU_GROUP_ID", "useNavbarActions", "t", "useTranslation", "meta", "id", "graph", "useAppGraph", "runAction", "useActionRunner", "stateAtom", "useCapability", "SimpleLayoutCapabilities", "State", "updateState", "useSimpleLayoutState", "actionsAtom", "useMemo", "Atom", "make", "get", "nodes", "edges", "createCompanionActions", "idPrefix", "gapSeparator", "createGapSeparator", "push", "mainMenuGroup", "createMenuItemGroup", "variant", "icon", "iconOnly", "label", "testId", "source", "target", "relation", "rootActions", "actions", "Node", "RootId", "menuActions", "filter", "node", "properties", "disposition", "forEach", "menuAction", "onAction"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SimpleLayoutCapabilities_exports,
|
|
3
|
+
SimpleLayoutEvents_exports
|
|
4
|
+
} from "./chunk-FD2CAY4Q.mjs";
|
|
5
|
+
import {
|
|
6
|
+
meta
|
|
7
|
+
} from "./chunk-AMTEDJHG.mjs";
|
|
8
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
9
|
+
export {
|
|
10
|
+
SimpleLayoutCapabilities_exports as SimpleLayoutCapabilities,
|
|
11
|
+
SimpleLayoutEvents_exports as SimpleLayoutEvents,
|
|
12
|
+
meta
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|