@dxos/plugin-simple-layout 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/chunk-MDPEKLKR.mjs +1163 -0
- package/dist/lib/browser/chunk-MDPEKLKR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CLPGTNWJ.mjs → chunk-MRR7PXSM.mjs} +5 -5
- package/dist/lib/browser/chunk-MRR7PXSM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +27 -20
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-LTB63NKP.mjs → operation-resolver-VTZ6HZ4B.mjs} +45 -19
- package/dist/lib/browser/operation-resolver-VTZ6HZ4B.mjs.map +7 -0
- package/dist/lib/browser/{react-root-6ARAPH3O.mjs → react-root-WVQYY2JA.mjs} +5 -5
- package/dist/lib/browser/react-root-WVQYY2JA.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-SO7B23GS.mjs → react-surface-VLBR37ED.mjs} +18 -13
- package/dist/lib/browser/react-surface-VLBR37ED.mjs.map +7 -0
- package/dist/lib/browser/{spotlight-dismiss-VSNOPETH.mjs → spotlight-dismiss-67PHYS5B.mjs} +3 -3
- package/dist/lib/browser/spotlight-dismiss-67PHYS5B.mjs.map +7 -0
- package/dist/lib/browser/{state-H4IGICBB.mjs → state-TXSMUWYI.mjs} +8 -5
- package/dist/lib/browser/state-TXSMUWYI.mjs.map +7 -0
- package/dist/lib/browser/url-handler-RBRONH7S.mjs +151 -0
- package/dist/lib/browser/url-handler-RBRONH7S.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DCKASLMP.mjs +1164 -0
- package/dist/lib/node-esm/chunk-DCKASLMP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MUVVYBUE.mjs → chunk-WMNTJ2MK.mjs} +5 -5
- package/dist/lib/node-esm/chunk-WMNTJ2MK.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +27 -20
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-7O6O7T4Q.mjs → operation-resolver-R7CQ6ERU.mjs} +45 -19
- package/dist/lib/node-esm/operation-resolver-R7CQ6ERU.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-2CPA2ZUS.mjs → react-root-XBNDM7BE.mjs} +5 -5
- package/dist/lib/node-esm/react-root-XBNDM7BE.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-FKAV56MO.mjs → react-surface-U5NHA367.mjs} +18 -13
- package/dist/lib/node-esm/react-surface-U5NHA367.mjs.map +7 -0
- package/dist/lib/node-esm/{spotlight-dismiss-L5PCWIJG.mjs → spotlight-dismiss-RMLRZUVY.mjs} +3 -3
- package/dist/lib/node-esm/spotlight-dismiss-RMLRZUVY.mjs.map +7 -0
- package/dist/lib/node-esm/{state-QIU2LMLT.mjs → state-JMX6FAG4.mjs} +8 -5
- package/dist/lib/node-esm/state-JMX6FAG4.mjs.map +7 -0
- package/dist/lib/node-esm/url-handler-QSMCH3JB.mjs +152 -0
- package/dist/lib/node-esm/url-handler-QSMCH3JB.mjs.map +7 -0
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/index.d.ts +1 -1
- package/dist/types/src/capabilities/state/state.d.ts +1 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -3
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/ContentError.stories.d.ts +7 -3
- package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
- package/dist/types/src/components/ContentLoading/ContentLoading.d.ts.map +1 -0
- package/dist/types/src/components/ContentLoading/ContentLoading.stories.d.ts.map +1 -0
- package/dist/types/src/components/ContentLoading/index.d.ts +2 -0
- package/dist/types/src/components/ContentLoading/index.d.ts.map +1 -0
- package/dist/types/src/components/Home/Home.d.ts.map +1 -1
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts +35 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.d.ts.map +1 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts +7 -0
- package/dist/types/src/components/MobileLayout/MobileLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/MobileLayout/index.d.ts +2 -0
- package/dist/types/src/components/MobileLayout/index.d.ts.map +1 -0
- package/dist/types/src/components/NavBranch/NavBranch.d.ts +11 -0
- package/dist/types/src/components/NavBranch/NavBranch.d.ts.map +1 -0
- package/dist/types/src/components/NavBranch/index.d.ts +2 -0
- package/dist/types/src/components/NavBranch/index.d.ts.map +1 -0
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts +26 -0
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +47 -0
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts +9 -0
- package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/Main.d.ts +1 -1
- package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts +13 -3
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +13 -9
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +10 -0
- package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/index.d.ts +3 -0
- package/dist/types/src/components/SimpleLayout/index.d.ts.map +1 -1
- package/dist/types/src/components/hooks.d.ts +4 -2
- package/dist/types/src/components/hooks.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/actions.d.ts +19 -0
- package/dist/types/src/hooks/actions.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAppBarProps.d.ts +7 -0
- package/dist/types/src/hooks/useAppBarProps.d.ts.map +1 -0
- package/dist/types/src/hooks/useCompanions.d.ts +12 -0
- package/dist/types/src/hooks/useCompanions.d.ts.map +1 -0
- package/dist/types/src/hooks/useDrawerActions.d.ts +13 -0
- package/dist/types/src/hooks/useDrawerActions.d.ts.map +1 -0
- package/dist/types/src/hooks/useNavbarActions.d.ts +14 -0
- package/dist/types/src/hooks/useNavbarActions.d.ts.map +1 -0
- 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/translations.d.ts +6 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +8 -3
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -30
- package/src/SimpleLayoutPlugin.ts +10 -9
- package/src/capabilities/operation-resolver/operation-resolver.ts +43 -19
- package/src/capabilities/react-root/react-root.tsx +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +14 -11
- package/src/capabilities/spotlight-dismiss/spotlight-dismiss.ts +2 -2
- package/src/capabilities/state/state.tsx +6 -3
- package/src/capabilities/url-handler/url-handler.ts +98 -45
- package/src/components/ContentError.stories.tsx +8 -7
- package/src/components/{ContentLoading.stories.tsx → ContentLoading/ContentLoading.stories.tsx} +2 -2
- package/src/components/{ContentLoading.tsx → ContentLoading/ContentLoading.tsx} +1 -1
- package/src/components/ContentLoading/index.ts +5 -0
- package/src/components/Dialog/Dialog.tsx +5 -5
- package/src/components/Home/Home.tsx +43 -35
- package/src/components/MobileLayout/MobileLayout.stories.tsx +129 -0
- package/src/components/MobileLayout/MobileLayout.tsx +305 -0
- package/src/components/MobileLayout/index.ts +5 -0
- package/src/components/NavBranch/NavBranch.tsx +130 -0
- package/src/components/{Workspace → NavBranch}/index.ts +1 -1
- package/src/components/Popover/Popover.tsx +17 -7
- package/src/components/SimpleLayout/AppBar.stories.tsx +144 -0
- package/src/components/SimpleLayout/AppBar.tsx +94 -0
- package/src/components/SimpleLayout/Drawer.tsx +96 -0
- package/src/components/SimpleLayout/Main.tsx +46 -45
- package/src/components/SimpleLayout/NavBar.stories.tsx +131 -26
- package/src/components/SimpleLayout/NavBar.tsx +18 -58
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +24 -11
- package/src/components/SimpleLayout/SimpleLayout.tsx +45 -6
- package/src/components/SimpleLayout/index.ts +3 -0
- package/src/components/hooks.ts +10 -14
- package/src/components/index.ts +2 -1
- package/src/hooks/actions.ts +83 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useAppBarProps.ts +115 -0
- package/src/hooks/useCompanions.ts +22 -0
- package/src/hooks/useDrawerActions.ts +100 -0
- package/src/hooks/useNavbarActions.ts +87 -0
- package/src/hooks/useSimpleLayoutState.ts +5 -5
- package/src/meta.ts +1 -1
- package/src/translations.ts +6 -0
- package/src/types/capabilities.ts +13 -4
- package/src/types/events.ts +3 -2
- package/dist/lib/browser/chunk-CLPGTNWJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FK4M7GJV.mjs +0 -613
- package/dist/lib/browser/chunk-FK4M7GJV.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-LTB63NKP.mjs.map +0 -7
- package/dist/lib/browser/react-root-6ARAPH3O.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SO7B23GS.mjs.map +0 -7
- package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs.map +0 -7
- package/dist/lib/browser/state-H4IGICBB.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7CFGTLNG.mjs +0 -54
- package/dist/lib/browser/url-handler-7CFGTLNG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EGFZAVBD.mjs +0 -614
- package/dist/lib/node-esm/chunk-EGFZAVBD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MUVVYBUE.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-2CPA2ZUS.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FKAV56MO.mjs.map +0 -7
- package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs.map +0 -7
- package/dist/lib/node-esm/state-QIU2LMLT.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-4LYP3JM7.mjs +0 -55
- package/dist/lib/node-esm/url-handler-4LYP3JM7.mjs.map +0 -7
- package/dist/types/src/components/ContentError.d.ts +0 -5
- package/dist/types/src/components/ContentError.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading.d.ts.map +0 -1
- package/dist/types/src/components/ContentLoading.stories.d.ts.map +0 -1
- package/dist/types/src/components/SimpleLayout/Banner.d.ts +0 -8
- package/dist/types/src/components/SimpleLayout/Banner.d.ts.map +0 -1
- package/dist/types/src/components/Workspace/Workspace.d.ts +0 -9
- package/dist/types/src/components/Workspace/Workspace.d.ts.map +0 -1
- package/dist/types/src/components/Workspace/index.d.ts +0 -2
- package/dist/types/src/components/Workspace/index.d.ts.map +0 -1
- package/src/components/ContentError.tsx +0 -23
- package/src/components/SimpleLayout/Banner.tsx +0 -82
- package/src/components/Workspace/Workspace.tsx +0 -115
- /package/dist/types/src/components/{ContentLoading.d.ts → ContentLoading/ContentLoading.d.ts} +0 -0
- /package/dist/types/src/components/{ContentLoading.stories.d.ts → ContentLoading/ContentLoading.stories.d.ts} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Home/Home.tsx", "../../../src/components/hooks.ts", "../../../src/components/SimpleLayout/SimpleLayout.tsx", "../../../src/components/Dialog/Dialog.tsx", "../../../src/hooks/useSimpleLayoutState.ts", "../../../src/components/ContentError.tsx", "../../../src/components/Popover/Popover.tsx", "../../../src/components/SimpleLayout/Main.tsx", "../../../src/components/ContentLoading.tsx", "../../../src/components/SimpleLayout/Banner.tsx", "../../../src/components/SimpleLayout/NavBar.tsx", "../../../src/components/Workspace/Workspace.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { Common } from '@dxos/app-framework';\nimport { useAppGraph, useOperationInvoker } from '@dxos/app-framework/react';\nimport { Node, useConnections } from '@dxos/plugin-graph';\nimport { Avatar, Icon, Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Card, Layout, Mosaic, type StackTileComponent } from '@dxos/react-ui-mosaic';\nimport { SearchList, useSearchListItem, useSearchListResults } from '@dxos/react-ui-searchlist';\nimport { mx } from '@dxos/ui-theme';\nimport { byPosition } from '@dxos/util';\n\nimport { meta } from '../../meta';\nimport { useLoadDescendents } 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 useLoadDescendents(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 return (\n <Layout.Main toolbar>\n <SearchList.Root onSearch={handleSearch}>\n <Toolbar.Root>\n <SearchList.Input placeholder={t('search placeholder')} autoFocus />\n </Toolbar.Root>\n <SearchList.Content>\n <Mosaic.Container asChild>\n <Mosaic.Viewport padding>\n <Mosaic.Stack items={results} getId={(node) => node.id} Tile={WorkspaceTile} />\n </Mosaic.Viewport>\n </Mosaic.Container>\n </SearchList.Content>\n </SearchList.Root>\n </Layout.Main>\n );\n};\n\nconst WorkspaceTile: StackTileComponent<Node.Node> = ({ data }) => {\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const { selectedValue, registerItem, unregisterItem } = useSearchListItem();\n const ref = useRef<HTMLDivElement>(null);\n\n const handleSelect = useCallback(\n () => invokePromise(Common.LayoutOperation.SwitchWorkspace, { subject: data.id }),\n [invokePromise, data.id],\n );\n\n useLoadDescendents(data.id);\n\n const name = toLocalizedString(data.properties.label, t);\n const isSelected = selectedValue === data.id;\n\n // Register this workspace 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', isSelected && 'bg-hoverOverlay')}\n onClick={handleSelect}\n >\n <Card.Toolbar density='coarse'>\n <Avatar.Root>\n <Avatar.Content\n icon={data.properties.icon}\n hue={data.properties.hue}\n hueVariant='transparent'\n variant='square'\n size={12}\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\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);\n const filtered = connections.filter((node) => filterItems(node, disposition));\n return sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { useAppGraph } from '@dxos/app-framework/react';\nimport { Graph } from '@dxos/plugin-graph';\n\n/**\n * Hook to expand graph nodes two levels deep when directly linked to.\n */\nexport const useLoadDescendents = (nodeId?: string) => {\n const { graph } = useAppGraph();\n\n useEffect(() => {\n const frame = requestAnimationFrame(() => {\n if (nodeId) {\n // First level: expand the node itself.\n Graph.expand(graph, nodeId, 'outbound');\n // Second level: expand each child.\n Graph.getConnections(graph, nodeId, 'outbound').forEach((child) => {\n Graph.expand(graph, child.id, 'outbound');\n });\n }\n });\n\n return () => cancelAnimationFrame(frame);\n }, [nodeId, graph]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Dialog } from '../Dialog';\nimport { PopoverContent, PopoverRoot } from '../Popover';\n\nimport { Main } from './Main';\n\nexport const SimpleLayout = () => {\n return (\n <PopoverRoot>\n <Main />\n <Dialog />\n <PopoverContent />\n </PopoverRoot>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework/react';\nimport { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';\n\nimport { useSimpleLayoutState } from '../../hooks';\nimport { ContentError } from '../ContentError';\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((s) => ({ ...s, dialogOpen: nextOpen }))}\n >\n {state.dialogBlockAlign === 'end' ? (\n <Surface role='dialog' data={state.dialogContent} limit={1} fallback={ContentError} />\n ) : (\n <DialogOverlay\n blockAlign={state.dialogBlockAlign}\n classNames={state.dialogOverlayClasses}\n style={state.dialogOverlayStyle}\n >\n <Surface role='dialog' data={state.dialogContent} limit={1} fallback={ContentError} />\n </DialogOverlay>\n )}\n </DialogRoot>\n );\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/react';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../types';\n\nexport type SimpleLayoutStateHook = {\n state: SimpleLayoutState;\n updateState: (fn: (current: SimpleLayoutState) => SimpleLayoutState) => void;\n};\n\nexport const useSimpleLayoutState = (): SimpleLayoutStateHook => {\n const registry = useContext(RegistryContext);\n const stateAtom = useCapability(SimpleLayoutStateCapability);\n const state = useAtomValue(stateAtom);\n\n const updateState = useCallback(\n (fn: (current: SimpleLayoutState) => SimpleLayoutState) => {\n registry.set(stateAtom, fn(registry.get(stateAtom)));\n },\n [registry, stateAtom],\n );\n\n return { state, updateState };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { descriptionMessage, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\n\n// TODO(burdon): Factor out.\nexport const ContentError = ({ error }: { error?: Error }) => {\n const { t } = useTranslation(meta.id);\n const errorString = error?.toString() ?? '';\n return (\n <div role='none' className='grid place-items-center overflow-y-auto attention-surface'>\n <p role='alert' className={mx(descriptionMessage, 'p-2 break-all rounded-sm')}>\n {error ? errorString : t('error fallback message')}\n </p>\n </div>\n );\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/react';\nimport { Popover, type PopoverContentInteractOutsideEvent, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui-mosaic';\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\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 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 === 'card' && (\n <Card.Root>\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.Close onClick={handleClose} />\n </Card.Toolbar>\n <Surface role='card--content' data={state.popoverContent} limit={1} />\n </Card.Root>\n )}\n {state.popoverKind === 'base' && <Surface role='popover' data={state.popoverContent} limit={1} />}\n </Popover.Viewport>\n <Popover.Arrow />\n </Popover.Content>\n </Popover.Portal>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Surface, useAppGraph } from '@dxos/app-framework/react';\nimport { log } from '@dxos/log';\nimport { useNode } from '@dxos/plugin-graph';\nimport { Main as NaturalMain } from '@dxos/react-ui';\nimport { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';\nimport { Mosaic } from '@dxos/react-ui-mosaic';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useSimpleLayoutState } from '../../hooks';\nimport { ContentError } from '../ContentError';\nimport { ContentLoading } from '../ContentLoading';\n\nimport { Banner } from './Banner';\nimport { NavBar } from './NavBar';\n\n/**\n * Main root component.\n */\nexport const Main = () => {\n const { state } = useSimpleLayoutState();\n const id = state.active ?? state.workspace;\n const showNavBar = !state.isPopover;\n const { graph } = useAppGraph();\n const node = useNode(graph, id);\n\n const placeholder = useMemo(() => <ContentLoading />, []);\n\n const data = useMemo(() => {\n const { variant } = parseEntryId(id);\n return (\n node && {\n attendableId: id,\n subject: node.data,\n properties: node.properties,\n popoverAnchorId: state.popoverAnchorId,\n variant,\n }\n );\n }, [id, node, node?.data, node?.properties, state.popoverAnchorId]);\n\n const handleActiveIdChange = useCallback((nextActiveId: string | null) => {\n log.info('navigate', { nextActiveId });\n }, []);\n\n return (\n <Mosaic.Root>\n <NaturalMain.Root complementarySidebarState='closed' navigationSidebarState='closed'>\n <NaturalMain.Content\n bounce\n classNames={mx(\n 'dx-mobile-main dx-mobile-main-scroll-area--flush',\n 'grid bs-full overflow-hidden',\n showNavBar ? 'grid-rows-[min-content_1fr_min-content]' : 'grid-rows-[min-content_1fr]',\n )}\n >\n <Banner classNames='border-be border-separator' node={node} />\n <article className='contents'>\n <Surface key={id} role='article' data={data} limit={1} fallback={ContentError} placeholder={placeholder} />\n </article>\n {showNavBar && (\n <NavBar classNames='border-bs border-separator' activeId={id} onActiveIdChange={handleActiveIdChange} />\n )}\n </NaturalMain.Content>\n </NaturalMain.Root>\n </Mosaic.Root>\n );\n};\n\n// TODO(wittjosiah): Factor out. Copied from deck plugin.\nconst parseEntryId = (entryId: string) => {\n const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);\n return { id, variant };\n};\n\nMain.displayName = 'SimpleLayout.Main';\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 ContentLoading = () => {\n return <div role='none' className='grid place-items-center attention-surface' />;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Common } from '@dxos/app-framework';\nimport { useAppGraph, useOperationInvoker } from '@dxos/app-framework/react';\nimport { Graph, Node } from '@dxos/plugin-graph';\nimport { IconButton, type ThemedClassName, Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { mx, osTranslations } from '@dxos/ui-theme';\n\nimport { useSimpleLayoutState } from '../../hooks';\nimport { meta } from '../../meta';\n\n/**\n * Check if an item is a direct child of a workspace or collection.\n * Returns true if any parent node has disposition 'workspace' or 'collection'.\n */\nconst isWorkspaceOrCollectionChild = (graph: Graph.ReadableGraph, itemId: string): boolean => {\n const parents = Graph.getConnections(graph, itemId, 'inbound');\n return parents.some(\n (node) => node.properties.disposition === 'workspace' || node.properties.disposition === 'collection',\n );\n};\n\nexport type BannerProps = ThemedClassName<{\n node?: Node.Node;\n}>;\n\nexport const Banner = ({ node, classNames }: BannerProps) => {\n const { t } = useTranslation(meta.id);\n const { state } = useSimpleLayoutState();\n const { invokePromise } = useOperationInvoker();\n const { graph } = useAppGraph();\n\n const label = (node && toLocalizedString(node.properties.label, t)) ?? t('current app name', { ns: osTranslations });\n\n // Check if current active item is a top-level workspace/collection child.\n const isTopLevelItem = useMemo(() => {\n if (!state.active) {\n return false;\n }\n return isWorkspaceOrCollectionChild(graph, state.active);\n }, [graph, state.active]);\n\n const handleClick = useCallback(async () => {\n if (state.active) {\n // If history is empty and this is a top-level item, go to home.\n if (state.history.length === 0 && isTopLevelItem) {\n await invokePromise(Common.LayoutOperation.SwitchWorkspace, { subject: Node.RootId });\n } else {\n // Otherwise, close (which will pop from history or clear active).\n await invokePromise(Common.LayoutOperation.Close, { subject: [state.active] });\n }\n } else {\n await invokePromise(Common.LayoutOperation.SwitchWorkspace, { subject: Node.RootId });\n }\n }, [invokePromise, state.active, state.history.length, isTopLevelItem]);\n\n if (!node) {\n return null;\n }\n\n return (\n <Toolbar.Root role='banner' classNames={mx('grid grid-cols-[var(--rail-size)_1fr_var(--rail-size)]', classNames)}>\n {node.id !== Node.RootId ? (\n <IconButton\n iconOnly\n variant='ghost'\n icon='ph--caret-left--regular'\n label={t('back label')}\n onClick={handleClick}\n />\n ) : (\n <div />\n )}\n <h1 className={'grow text-center truncate font-medium'}>{label}</h1>\n <IconButton iconOnly variant='ghost' icon='ph--dots-three-vertical--regular' label={t('menu label')} />\n </Toolbar.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useAppGraph } from '@dxos/app-framework/react';\nimport { Node, useActionRunner, useConnections } from '@dxos/plugin-graph';\nimport { IconButton, type ThemedClassName, Toolbar, Tooltip, useTranslation } from '@dxos/react-ui';\nimport { DropdownMenu, MenuProvider } from '@dxos/react-ui-menu';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\n\nexport type NavBarProps = ThemedClassName<{\n activeId?: string;\n onActiveIdChange?: (nextActiveId: string | null) => void;\n}>;\n\nexport const NavBar = ({ classNames, activeId, onActiveIdChange }: NavBarProps) => {\n const { t } = useTranslation(meta.id);\n const { graph } = useAppGraph();\n const runAction = useActionRunner();\n\n const connections = useConnections(graph, Node.RootId);\n const menuActions = connections.filter((node) => node.properties.disposition === 'menu');\n\n const isBrowseActive = activeId !== 'notifications' && activeId !== 'profile';\n\n return (\n <Toolbar.Root classNames={mx('justify-center', classNames)}>\n <MenuProvider onAction={runAction}>\n <DropdownMenu.Root items={menuActions}>\n <Tooltip.Trigger asChild content={t('app menu label')}>\n <DropdownMenu.Trigger asChild data-testid='spacePlugin.addSpace'>\n <IconButton icon='ph--plus--regular' iconOnly label={t('main menu label')} />\n </DropdownMenu.Trigger>\n </Tooltip.Trigger>\n </DropdownMenu.Root>\n </MenuProvider>\n {/*\n <ButtonGroup>\n <IconButton\n {...buttonProps}\n label={t('browse label')}\n icon='ph--squares-four--regular'\n onClick={() => onActiveIdChange?.(null)}\n variant={isBrowseActive ? 'primary' : 'default'}\n {...(isBrowseActive && { 'aria-current': 'location' })}\n />\n <IconButton\n {...buttonProps}\n label={t('notifications label')}\n icon='ph--bell-simple--regular'\n onClick={() => onActiveIdChange?.('notifications')}\n variant={activeId === 'notifications' ? 'primary' : 'default'}\n {...(activeId === 'notifications' && { 'aria-current': 'location' })}\n />\n <Button\n variant={activeId === 'profile' ? 'primary' : 'default'}\n onClick={() => onActiveIdChange?.('profile')}\n classNames={buttonProps.classNames}\n >\n <span className='sr-only'>{t('profile label')}</span>\n <Avatar.Root>\n <Avatar.Label classNames='sr-only'>Profile display name</Avatar.Label>\n <Avatar.Content size={8} status='active' hue='cyan' fallback='🗿' />\n </Avatar.Root>\n </Button>\n </ButtonGroup>\n */}\n </Toolbar.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useRef } from 'react';\n\nimport { Common } from '@dxos/app-framework';\nimport { useAppGraph, useOperationInvoker } from '@dxos/app-framework/react';\nimport { type Node, useConnections } from '@dxos/plugin-graph';\nimport { Avatar, Icon, Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Card, Layout, Mosaic, type StackTileComponent } from '@dxos/react-ui-mosaic';\nimport { SearchList, useSearchListItem, useSearchListResults } from '@dxos/react-ui-searchlist';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { useLoadDescendents } from '../hooks';\n\nexport type WorkspaceProps = {\n id: string;\n};\n\n/**\n *\n */\n// TODO(burdon): Rename or motivate name in comment.\nexport const Workspace = ({ id }: WorkspaceProps) => {\n const { t } = useTranslation(meta.id);\n const { graph } = useAppGraph();\n\n // Expand the workspace node to load its children.\n useLoadDescendents(id);\n\n // Get direct children of the workspace node.\n const children = useConnections(graph, id, 'outbound');\n\n const { results, handleSearch } = useSearchListResults({\n items: children,\n extract: (child) => toLocalizedString(child.properties.label, t),\n });\n\n return (\n <Layout.Main toolbar>\n <SearchList.Root onSearch={handleSearch}>\n <Toolbar.Root>\n <SearchList.Input placeholder={t('search placeholder')} autoFocus />\n </Toolbar.Root>\n <SearchList.Content>\n <Mosaic.Container asChild>\n <Mosaic.Viewport padding>\n <Mosaic.Stack items={results} getId={(child) => child.id} Tile={WorkspaceChildTile} />\n </Mosaic.Viewport>\n </Mosaic.Container>\n </SearchList.Content>\n </SearchList.Root>\n </Layout.Main>\n );\n};\n\nconst WorkspaceChildTile: StackTileComponent<Node.Node> = ({ data }) => {\n const { t } = useTranslation(meta.id);\n const { invokeSync } = 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 () => invokeSync(Common.LayoutOperation.Open, { subject: [data.id] }),\n [invokeSync, 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', isSelected && 'bg-hoverOverlay')}\n onClick={handleSelect}\n >\n <Card.Toolbar density='coarse'>\n <Avatar.Root>\n <Avatar.Content\n hue={data.properties.hue}\n icon={data.properties.icon}\n hueVariant='transparent'\n variant='square'\n size={12}\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,OAAOA,SAASC,aAAaC,aAAAA,YAAWC,SAASC,cAAc;AAE/D,SAASC,cAAc;AACvB,SAASC,eAAAA,cAAaC,2BAA2B;AACjD,SAASC,MAAMC,sBAAsB;AACrC,SAASC,QAAQC,MAAMC,SAASC,mBAAmBC,sBAAsB;AACzE,SAASC,MAAMC,QAAQC,cAAuC;AAC9D,SAASC,YAAYC,mBAAmBC,4BAA4B;AACpE,SAASC,UAAU;AACnB,SAASC,kBAAkB;;;ACT3B,SAASC,iBAAiB;AAE1B,SAASC,mBAAmB;AAC5B,SAASC,aAAa;AAKf,IAAMC,qBAAqB,CAACC,WAAAA;AACjC,QAAM,EAAEC,MAAK,IAAKC,YAAAA;AAElBC,YAAU,MAAA;AACR,UAAMC,QAAQC,sBAAsB,MAAA;AAClC,UAAIL,QAAQ;AAEVM,cAAMC,OAAON,OAAOD,QAAQ,UAAA;AAE5BM,cAAME,eAAeP,OAAOD,QAAQ,UAAA,EAAYS,QAAQ,CAACC,UAAAA;AACvDJ,gBAAMC,O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AW;IACXC,SAAQ;IACRC,MAAM;IACNC,UAAU3B;MAEZ,gBAAA/B,QAAA,cAACoD,QAAOO,OAAK,MAAE5B,IAAAA,GACf,gBAAA/B,QAAA,cAAC4D,OAAAA;IAAKN,MAAK;;AAKrB;",
|
|
6
|
-
"names": ["React", "useCallback", "useEffect", "useMemo", "useRef", "Common", "useAppGraph", "useOperationInvoker", "Node", "useConnections", "Avatar", "Icon", "Toolbar", "toLocalizedString", "useTranslation", "Card", "Layout", "Mosaic", "SearchList", "useSearchListItem", "useSearchListResults", "mx", "byPosition", "useEffect", "useAppGraph", "Graph", "useLoadDescendents", "nodeId", "graph", "useAppGraph", "useEffect", "frame", "requestAnimationFrame", "Graph", "expand", "getConnections", "forEach", "child", "id", "cancelAnimationFrame", "Home", "_", "t", "useTranslation", "meta", "id", "userAccountItem", "useItemsByDisposition", "pinnedItems", "workspaceItems", "useLoadDescendents", "Node", "RootId", "items", "useMemo", "results", "handleSearch", "useSearchListResults", "extract", "node", "toLocalizedString", "properties", "label", "Layout", "Main", "toolbar", "SearchList", "Root", "onSearch", "Toolbar", "Input", "placeholder", "autoFocus", "Content", "Mosaic", "Container", "asChild", "Viewport", "padding", "Stack", "getId", "Tile", "WorkspaceTile", "data", "invokePromise", "useOperationInvoker", "selectedValue", "registerItem", "unregisterItem", "useSearchListItem", "ref", "useRef", "handleSelect", "useCallback", "Common", "LayoutOperation", "SwitchWorkspace", "subject", "name", "isSelected", "useEffect", "current", "scrollIntoView", "block", "behavior", "Card", "role", "fullWidth", "tabIndex", "data-selected", "classNames", "mx", "onClick", "density", "Avatar", "icon", "hue", "hueVariant", "variant", "size", "fallback", "Label", "Icon", "filterItems", "disposition", "sort", "graph", "useAppGraph", "connections", "useConnections", "filtered", "filter", "toSorted", "a", "b", "byPosition", "React", "React", "Surface", "AlertDialog", "Dialog", "NaturalDialog", "RegistryContext", "useAtomValue", "useCallback", "useContext", "useCapability", "useSimpleLayoutState", "registry", "useContext", "RegistryContext", "stateAtom", "useCapability", "SimpleLayoutStateCapability", "state", "useAtomValue", "updateState", "useCallback", "fn", "set", "get", "React", "useTranslation", "descriptionMessage", "mx", "ContentError", "error", "t", "useTranslation", "meta", "id", "errorString", "toString", "React", "div", "role", "className", "p", "mx", "descriptionMessage", "Dialog", "state", "updateState", "useSimpleLayoutState", "DialogRoot", "dialogType", "AlertDialog", "Root", "NaturalDialog", "DialogOverlay", "Overlay", "React", "modal", "dialogBlockAlign", "open", "dialogOpen", "onOpenChange", "nextOpen", "s", "Surface", "role", "data", "dialogContent", "limit", "fallback", "ContentError", "blockAlign", "classNames", "dialogOverlayClasses", "style", "dialogOverlayStyle", "createContext", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Surface", "Popover", "toLocalizedString", "useTranslation", "Card", "DEBOUNCE_DELAY", "LayoutPopoverProvider", "useLayoutPopoverContext", "createContext", "PopoverRoot", "children", "state", "useSimpleLayoutState", "open", "setOpen", "useState", "virtualRef", "useRef", "virtualIter", "setVirtualIter", "debounceRef", "useEffect", "popoverOpen", "current", "clearTimeout", "popoverAnchor", "iter", "setTimeout", "popoverAnchorId", "popoverContent", "React", "Popover", "Root", "modal", "VirtualTrigger", "key", "PopoverContent", "t", "useTranslation", "meta", "id", "updateState", "handleClose", "useCallback", "s", "undefined", "popoverSide", "handleInteractOutside", "event", "type", "currentTarget", "classList", "contains", "preventDefault", "collisionBoundaries", "useMemo", "closest", "Portal", "Content", "side", "sticky", "hideWhenDetached", "collisionBoundary", "onInteractOutside", "onEscapeKeyDown", "Viewport", "popoverKind", "Card", "Toolbar", "span", "popoverTitle", "Title", "toLocalizedString", "Close", "onClick", "Surface", "role", "data", "limit", "Arrow", "React", "useCallback", "useMemo", "Surface", "useAppGraph", "log", "useNode", "Main", "NaturalMain", "ATTENDABLE_PATH_SEPARATOR", "Mosaic", "mx", "React", "ContentLoading", "React", "div", "role", "className", "React", "useCallback", "useMemo", "Common", "useAppGraph", "useOperationInvoker", "Graph", "Node", "IconButton", "Toolbar", "toLocalizedString", "useTranslation", "mx", "osTranslations", "isWorkspaceOrCollectionChild", "graph", "itemId", "parents", "Graph", "getConnections", "some", "node", "properties", "disposition", "Banner", "classNames", "t", "useTranslation", "meta", "id", "state", "useSimpleLayoutState", "invokePromise", "useOperationInvoker", "useAppGraph", "label", "toLocalizedString", "ns", "osTranslations", "isTopLevelItem", "useMemo", "active", "handleClick", "useCallback", "history", "length", "Common", "LayoutOperation", "SwitchWorkspace", "subject", "Node", "RootId", "Close", "React", "Toolbar", "Root", "role", "mx", "IconButton", "iconOnly", "variant", "icon", "onClick", "div", "h1", "className", "React", "useAppGraph", "Node", "useActionRunner", "useConnections", "IconButton", "Toolbar", "Tooltip", "useTranslation", "DropdownMenu", "MenuProvider", "mx", "NavBar", "classNames", "activeId", "onActiveIdChange", "t", "useTranslation", "meta", "id", "graph", "useAppGraph", "runAction", "useActionRunner", "connections", "useConnections", "Node", "RootId", "menuActions", "filter", "node", "properties", "disposition", "isBrowseActive", "React", "Toolbar", "Root", "mx", "MenuProvider", "onAction", "DropdownMenu", "items", "Tooltip", "Trigger", "asChild", "content", "data-testid", "IconButton", "icon", "iconOnly", "label", "Main", "state", "useSimpleLayoutState", "id", "active", "workspace", "showNavBar", "isPopover", "graph", "useAppGraph", "node", "useNode", "placeholder", "useMemo", "React", "ContentLoading", "data", "variant", "parseEntryId", "attendableId", "subject", "properties", "popoverAnchorId", "handleActiveIdChange", "useCallback", "nextActiveId", "log", "info", "Mosaic", "Root", "NaturalMain", "complementarySidebarState", "navigationSidebarState", "Content", "bounce", "classNames", "mx", "Banner", "article", "className", "Surface", "key", "role", "limit", "fallback", "ContentError", "NavBar", "activeId", "onActiveIdChange", "entryId", "split", "ATTENDABLE_PATH_SEPARATOR", "displayName", "SimpleLayout", "React", "PopoverRoot", "Main", "Dialog", "PopoverContent", "React", "useCallback", "useEffect", "useRef", "Common", "useAppGraph", "useOperationInvoker", "useConnections", "Avatar", "Icon", "Toolbar", "toLocalizedString", "useTranslation", "Card", "Layout", "Mosaic", "SearchList", "useSearchListItem", "useSearchListResults", "mx", "Workspace", "id", "t", "useTranslation", "meta", "graph", "useAppGraph", "useLoadDescendents", "children", "useConnections", "results", "handleSearch", "useSearchListResults", "items", "extract", "child", "toLocalizedString", "properties", "label", "React", "Layout", "Main", "toolbar", "SearchList", "Root", "onSearch", "Toolbar", "Input", "placeholder", "autoFocus", "Content", "Mosaic", "Container", "asChild", "Viewport", "padding", "Stack", "getId", "Tile", "WorkspaceChildTile", "data", "invokeSync", "useOperationInvoker", "ref", "useRef", "selectedValue", "registerItem", "unregisterItem", "useSearchListItem", "isSelected", "name", "handleSelect", "useCallback", "Common", "LayoutOperation", "Open", "subject", "useEffect", "current", "scrollIntoView", "block", "behavior", "Card", "role", "fullWidth", "tabIndex", "data-selected", "classNames", "mx", "onClick", "density", "Avatar", "hue", "icon", "hueVariant", "variant", "size", "fallback", "Label", "Icon"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts", "../../../src/types/capabilities.ts", "../../../src/types/events.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/simple-layout',\n name: 'Simple Layout',\n description: trim`\n Minimal layout plugin for simplified UI contexts like popover windows.\n Provides basic content rendering without sidebars or complex navigation.\n `,\n icon: 'ph--layout--regular',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type Label } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\n// TODO(wittjosiah): Handle toasts.\nexport type SimpleLayoutState = {\n /** Data to be passed to the main content Surface. */\n content?: any;\n\n dialogOpen: boolean;\n dialogType?: 'default' | 'alert';\n dialogBlockAlign?: 'start' | 'center' | 'end';\n dialogOverlayClasses?: string;\n dialogOverlayStyle?: Record<string, any>;\n /** Data to be passed to the dialog Surface. */\n dialogContent?: any;\n\n popoverOpen?: boolean;\n popoverSide?: 'top' | 'right' | 'bottom' | 'left';\n popoverVariant?: 'virtual' | 'react';\n popoverAnchor?: HTMLButtonElement;\n popoverAnchorId?: string;\n popoverKind?: 'base' | 'card';\n popoverTitle?: Label;\n popoverContent?: any;\n\n workspace: string;\n previousWorkspace: string;\n active?: string;\n /** Stack of previously active item IDs for back navigation. */\n history: string[];\n\n /** Whether running in popover window context (hides mobile-specific UI). */\n isPopover?: boolean;\n};\n\nexport const SimpleLayoutState = Capability.make<Atom.Writable<SimpleLayoutState>>(`${meta.id}/state`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ActivationEvent, Common } from '@dxos/app-framework';\n\nimport { SimpleLayoutState } from './capabilities';\n\nexport namespace SimpleLayoutEvents {\n /** Fired when SimpleLayoutState capability is ready. */\n export const StateReady: ActivationEvent.ActivationEvent = Common.ActivationEvent.createStateEvent(\n SimpleLayoutState.identifier,\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;AACR;;;ACTA,SAASC,kBAAkB;AAqCpB,IAAMC,oBAAoBC,WAAWC,KAAuC,GAAGC,KAAKC,EAAE,QAAQ;;;ACvCrG,SAA+BC,cAAc;UAI5BC,qBAAAA;sBAEFC,aAA8CC,OAAOC,gBAAgBC,iBAChFC,kBAAkBC,UAAU;AAEhC,GALiBN,uBAAAA,qBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "Capability", "SimpleLayoutState", "Capability", "make", "meta", "id", "Common", "SimpleLayoutEvents", "StateReady", "Common", "ActivationEvent", "createStateEvent", "SimpleLayoutState", "identifier"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Operation, OperationResolver } from '@dxos/operation';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\n/** Maximum number of items to keep in navigation history. */\nconst MAX_HISTORY_LENGTH = 50;\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Common.Capability.AtomRegistry);\n const stateAtom = yield* Capability.get(SimpleLayoutStateCapability);\n\n const getState = () => registry.get(stateAtom);\n const updateState = (fn: (current: SimpleLayoutState) => SimpleLayoutState) => {\n registry.set(stateAtom, fn(getState()));\n };\n\n return Capability.contributes(Common.Capability.OperationResolver, [\n //\n // UpdateSidebar - No-op for simple layout.\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateSidebar,\n handler: () => Effect.void,\n }),\n\n //\n // UpdateComplementary - No-op for simple layout.\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateComplementary,\n handler: () => Effect.void,\n }),\n\n //\n // UpdateDialog\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateDialog,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n dialogOpen: input.state ?? Boolean(input.subject),\n dialogType: input.type ?? 'default',\n dialogBlockAlign: input.blockAlign ?? 'center',\n dialogOverlayClasses: input.overlayClasses,\n dialogOverlayStyle: input.overlayStyle,\n dialogContent: input.subject ? { component: input.subject, props: input.props } : undefined,\n }));\n }),\n }),\n\n //\n // UpdatePopover\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdatePopover,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n popoverOpen: input.state ?? Boolean(input.subject),\n popoverKind: input.kind ?? 'base',\n popoverTitle: input.kind === 'card' ? input.title : undefined,\n popoverContent:\n typeof input.subject === 'string'\n ? { component: input.subject, props: input.props }\n : input.subject\n ? { subject: input.subject }\n : undefined,\n popoverSide: input.side,\n popoverVariant: input.variant,\n popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,\n popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,\n }));\n }),\n }),\n\n //\n // SwitchWorkspace\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.SwitchWorkspace,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n previousWorkspace: !state.workspace.startsWith('!') ? state.workspace : state.previousWorkspace,\n workspace: input.subject,\n active: undefined,\n // Clear history when switching workspaces.\n history: [],\n }));\n }),\n }),\n\n //\n // RevertWorkspace\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.RevertWorkspace,\n handler: Effect.fnUntraced(function* () {\n const state = getState();\n yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, {\n subject: state.previousWorkspace,\n });\n }),\n }),\n\n //\n // Open\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.Open,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => {\n // Push current active to history if it exists.\n const newHistory = state.active ? [...state.history, state.active] : state.history;\n // Limit history length to prevent memory issues.\n const trimmedHistory =\n newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;\n return {\n ...state,\n active: input.subject[0],\n history: trimmedHistory,\n };\n });\n }),\n }),\n\n //\n // Close\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.Close,\n handler: Effect.fnUntraced(function* () {\n updateState((state) => {\n // Pop from history if available.\n if (state.history.length > 0) {\n const newHistory = [...state.history];\n const previousActive = newHistory.pop();\n return {\n ...state,\n active: previousActive,\n history: newHistory,\n };\n }\n // No history, just clear active.\n return {\n ...state,\n active: undefined,\n };\n });\n }),\n }),\n\n //\n // Set\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.Set,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n active: input.subject[0],\n }));\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAWC,yBAAyB;AAK7C,IAAMC,qBAAqB;AAE3B,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,YAAY;AACrE,QAAMC,YAAY,OAAOP,WAAWI,IAAII,iBAAAA;AAExC,QAAMC,WAAW,MAAMN,SAASC,IAAIG,SAAAA;AACpC,QAAMG,cAAc,CAACC,OAAAA;AACnBR,aAASS,IAAIL,WAAWI,GAAGF,SAAAA,CAAAA,CAAAA;EAC7B;AAEA,SAAOT,WAAWa,YAAYR,OAAOL,WAAWc,mBAAmB;;;;IAIjEA,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgBC;MAClCC,SAAS,MAAaC;IACxB,CAAA;;;;IAKAN,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgBI;MAClCF,SAAS,MAAaC;IACxB,CAAA;;;;IAKAN,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgBK;MAClCH,SAAgBjB,kBAAW,WAAWqB,OAAK;AACzCb,oBAAY,CAACc,WAAW;UACtB,GAAGA;UACHC,YAAYF,MAAMC,SAASE,QAAQH,MAAMI,OAAO;UAChDC,YAAYL,MAAMM,QAAQ;UAC1BC,kBAAkBP,MAAMQ,cAAc;UACtCC,sBAAsBT,MAAMU;UAC5BC,oBAAoBX,MAAMY;UAC1BC,eAAeb,MAAMI,UAAU;YAAEU,WAAWd,MAAMI;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A;MACF,CAAA;IACF,CAAA;;;;IAKA1C,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgB+C;MAClC7C,SAAgBjB,kBAAW,WAAWqB,OAAK;AACzCb,oBAAY,CAACc,UAAAA;AAEX,gBAAMyC,aAAazC,MAAMmC,SAAS;eAAInC,MAAMoC;YAASpC,MAAMmC;cAAUnC,MAAMoC;AAE3E,gBAAMM,iBACJD,WAAWE,SAASpE,qBAAqBkE,WAAWG,MAAM,CAACrE,kBAAAA,IAAsBkE;AACnF,iBAAO;YACL,GAAGzC;YACHmC,QAAQpC,MAAMI,QAAQ,CAAA;YACtBiC,SAASM;UACX;QACF,CAAA;MACF,CAAA;IACF,CAAA;;;;IAKApD,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgBoD;MAClClD,SAAgBjB,kBAAW,aAAA;AACzBQ,oBAAY,CAACc,UAAAA;AAEX,cAAIA,MAAMoC,QAAQO,SAAS,GAAG;AAC5B,kBAAMF,aAAa;iBAAIzC,MAAMoC;;AAC7B,kBAAMU,iBAAiBL,WAAWM,IAAG;AACrC,mBAAO;cACL,GAAG/C;cACHmC,QAAQW;cACRV,SAASK;YACX;UACF;AAEA,iBAAO;YACL,GAAGzC;YACHmC,QAAQpB;UACV;QACF,CAAA;MACF,CAAA;IACF,CAAA;;;;IAKAzB,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgBuD;MAClCrD,SAAgBjB,kBAAW,WAAWqB,OAAK;AACzCb,oBAAY,CAACc,WAAW;UACtB,GAAGA;UACHmC,QAAQpC,MAAMI,QAAQ,CAAA;QACxB,EAAA;MACF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "Operation", "OperationResolver", "MAX_HISTORY_LENGTH", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "stateAtom", "SimpleLayoutStateCapability", "getState", "updateState", "fn", "set", "contributes", "OperationResolver", "make", "operation", "LayoutOperation", "UpdateSidebar", "handler", "void", "UpdateComplementary", "UpdateDialog", "input", "state", "dialogOpen", "Boolean", "subject", "dialogType", "type", "dialogBlockAlign", "blockAlign", "dialogOverlayClasses", "overlayClasses", "dialogOverlayStyle", "overlayStyle", "dialogContent", "component", "props", "undefined", "UpdatePopover", "popoverOpen", "popoverKind", "kind", "popoverTitle", "title", "popoverContent", "popoverSide", "side", "popoverVariant", "variant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId", "SwitchWorkspace", "previousWorkspace", "workspace", "startsWith", "active", "history", "RevertWorkspace", "Operation", "invoke", "Open", "newHistory", "trimmedHistory", "length", "slice", "Close", "previousActive", "pop", "Set"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-root/react-root.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\n\nimport { SimpleLayout } from '../../components';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactRoot, {\n id: meta.id,\n root: () => {\n return <SimpleLayout />;\n },\n }),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AAKnC,IAAA,qBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,WAAW;EAClDC,IAAIC,KAAKD;EACTE,MAAM,MAAA;AACJ,WAAO,sBAAA,cAACC,cAAAA,IAAAA;EACV;AACF,CAAA,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactRoot", "id", "meta", "root", "SimpleLayout"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { Home, Workspace } from '../../components';\nimport { meta } from '../../meta';\n\ntype SurfaceData = {\n attendableId: string;\n properties: Record<string, any>;\n};\n\nconst ALLOWED_DISPOSITIONS = ['workspace', 'user-account', 'pin-end'];\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.createSurface({\n id: `${meta.id}/home`,\n role: 'article',\n filter: (data): data is SurfaceData => data.attendableId === Node.RootId,\n component: () => <Home />,\n }),\n Common.createSurface({\n id: `${meta.id}/workspace-article`,\n role: 'article',\n position: 'fallback',\n filter: (data): data is SurfaceData =>\n ALLOWED_DISPOSITIONS.includes((data.properties as Record<string, any>)?.disposition),\n component: ({ data }) => <Workspace id={data.attendableId} />,\n }),\n ]),\n ),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,YAAY;AAUrB,IAAMC,uBAAuB;EAAC;EAAa;EAAgB;;AAE3D,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAA8BA,KAAKC,iBAAiBC,KAAKC;IAClEC,WAAW,MAAM,sBAAA,cAACC,MAAAA,IAAAA;EACpB,CAAA;EACAZ,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNQ,UAAU;IACVP,QAAQ,CAACC,SACPZ,qBAAqBmB,SAAUP,KAAKQ,YAAoCC,WAAAA;IAC1EL,WAAW,CAAC,EAAEJ,KAAI,MAAO,sBAAA,cAACU,WAAAA;MAAUd,IAAII,KAAKC;;EAC/C,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "Capability", "Common", "Node", "ALLOWED_DISPOSITIONS", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "attendableId", "Node", "RootId", "component", "Home", "position", "includes", "properties", "disposition", "Workspace"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/spotlight-dismiss/spotlight-dismiss.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\n// Based on the frontend-driven dismiss pattern from:\n// https://github.com/Jedliu/tauri-template-demo\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { log } from '@dxos/log';\nimport { isTauri } from '@dxos/util';\n\n/**\n * Get the Tauri window API from the global object.\n */\nconst getTauriWindow = (): any => {\n const tauri = (globalThis as any).__TAURI__;\n return tauri?.window;\n};\n\n/**\n * Get the Tauri core API (invoke) from the global object.\n */\nconst getTauriCore = (): any => {\n const tauri = (globalThis as any).__TAURI__;\n return tauri?.core;\n};\n\nexport type SpotlightDismissOptions = {\n /** Whether running in popover window context. */\n isPopover?: boolean;\n};\n\n/**\n * Capability that sets up spotlight panel dismiss behavior.\n * When running in Tauri popover mode, listens for focus loss and Escape key\n * to dismiss the spotlight panel. Runs at startup before React renders.\n */\nexport default Capability.makeModule(({ isPopover = false }: SpotlightDismissOptions = {}) =>\n Effect.promise(async () => {\n if (!isPopover || !isTauri()) {\n return [];\n }\n\n // Set up focus listener.\n let focusCleanup: (() => void) | undefined;\n try {\n const tauriWindow = getTauriWindow();\n const tauriCore = getTauriCore();\n if (tauriWindow && tauriCore) {\n const win = tauriWindow.getCurrentWindow();\n focusCleanup = await win.onFocusChanged(async ({ payload }: { payload: boolean }) => {\n if (!payload) {\n await tauriCore.invoke('hide_spotlight');\n }\n });\n }\n } catch (err) {\n log.catch(err);\n }\n\n // Set up Escape key listener.\n const handleKeyDown = async (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n try {\n const tauriCore = getTauriCore();\n if (tauriCore) {\n await tauriCore.invoke('hide_spotlight');\n }\n } catch (err) {\n log.catch(err);\n }\n }\n };\n window.addEventListener('keydown', handleKeyDown);\n\n return Capability.contributes(Common.Capability.Null, null, () =>\n Effect.sync(() => {\n focusCleanup?.();\n window.removeEventListener('keydown', handleKeyDown);\n }),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;AAOA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;AACpB,SAASC,eAAe;;AAKxB,IAAMC,iBAAiB,MAAA;AACrB,QAAMC,QAASC,WAAmBC;AAClC,SAAOF,OAAOG;AAChB;AAKA,IAAMC,eAAe,MAAA;AACnB,QAAMJ,QAASC,WAAmBC;AAClC,SAAOF,OAAOK;AAChB;AAYA,IAAA,4BAAeV,WAAWW,WAAW,CAAC,EAAEC,YAAY,MAAK,IAA8B,CAAC,MAC/EC,eAAQ,YAAA;AACb,MAAI,CAACD,aAAa,CAACT,QAAAA,GAAW;AAC5B,WAAO,CAAA;EACT;AAGA,MAAIW;AACJ,MAAI;AACF,UAAMC,cAAcX,eAAAA;AACpB,UAAMY,YAAYP,aAAAA;AAClB,QAAIM,eAAeC,WAAW;AAC5B,YAAMC,MAAMF,YAAYG,iBAAgB;AACxCJ,qBAAe,MAAMG,IAAIE,eAAe,OAAO,EAAEC,QAAO,MAAwB;AAC9E,YAAI,CAACA,SAAS;AACZ,gBAAMJ,UAAUK,OAAO,gBAAA;QACzB;MACF,CAAA;IACF;EACF,SAASC,KAAK;AACZpB,QAAIqB,MAAMD,KAAAA,QAAAA;;;;;;EACZ;AAGA,QAAME,gBAAgB,OAAOC,UAAAA;AAC3B,QAAIA,MAAMC,QAAQ,UAAU;AAC1BD,YAAME,eAAc;AACpB,UAAI;AACF,cAAMX,YAAYP,aAAAA;AAClB,YAAIO,WAAW;AACb,gBAAMA,UAAUK,OAAO,gBAAA;QACzB;MACF,SAASC,KAAK;AACZpB,YAAIqB,MAAMD,KAAAA,QAAAA;;;;;;MACZ;IACF;EACF;AACAd,SAAOoB,iBAAiB,WAAWJ,aAAAA;AAEnC,SAAOxB,WAAW6B,YAAY5B,OAAOD,WAAW8B,MAAM,MAAM,MACnDC,YAAK,MAAA;AACVjB,mBAAAA;AACAN,WAAOwB,oBAAoB,WAAWR,aAAAA;EACxC,CAAA,CAAA;AAEJ,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "log", "isTauri", "getTauriWindow", "tauri", "globalThis", "__TAURI__", "window", "getTauriCore", "core", "makeModule", "isPopover", "promise", "focusCleanup", "tauriWindow", "tauriCore", "win", "getCurrentWindow", "onFocusChanged", "payload", "invoke", "err", "catch", "handleKeyDown", "event", "key", "preventDefault", "addEventListener", "contributes", "Null", "sync", "removeEventListener"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/state/state.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { type SimpleLayoutState } from '../../types';\nimport { SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\nconst defaultState: SimpleLayoutState = {\n dialogOpen: false,\n workspace: Node.RootId,\n previousWorkspace: Node.RootId,\n history: [],\n isPopover: false,\n};\n\nexport type SimpleLayoutStateOptions = {\n initialState?: Partial<SimpleLayoutState>;\n};\n\nexport default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions = {}) =>\n Effect.sync(() => {\n const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): Common.Capability.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'simple',\n dialogOpen: state.dialogOpen,\n sidebarOpen: false,\n complementarySidebarOpen: false,\n workspace: state.workspace,\n active: state.active ? [state.active] : [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [\n Capability.contributes(SimpleLayoutStateCapability, stateAtom),\n Capability.contributes(Common.Capability.Layout, layoutAtom),\n ];\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,YAAY;AAKrB,IAAMC,eAAkC;EACtCC,YAAY;EACZC,WAAWC,KAAKC;EAChBC,mBAAmBF,KAAKC;EACxBE,SAAS,CAAA;EACTC,WAAW;AACb;AAMA,IAAA,gBAAeC,WAAWC,WAAW,CAAC,EAAEC,aAAY,IAA+B,CAAC,MAC3EC,YAAK,MAAA;AACV,QAAMC,YAAYC,KAAKC,KAAwB;IAAE,GAAGd;IAAc,GAAGU;EAAa,CAAA;AAElF,QAAMK,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNjB,YAAYgB,MAAMhB;MAClBkB,aAAa;MACbC,0BAA0B;MAC1BlB,WAAWe,MAAMf;MACjBmB,QAAQJ,MAAMI,SAAS;QAACJ,MAAMI;UAAU,CAAA;MACxCC,UAAU,CAAA;MACVC,gBAAgBC;IAClB;EACF,CAAA;AAEA,SAAO;IACLhB,WAAWiB,YAAYC,mBAA6Bd,SAAAA;IACpDJ,WAAWiB,YAAYE,OAAOnB,WAAWoB,QAAQb,UAAAA;;AAErD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Atom", "Effect", "Capability", "Common", "Node", "defaultState", "dialogOpen", "workspace", "Node", "RootId", "previousWorkspace", "history", "isPopover", "Capability", "makeModule", "initialState", "sync", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "undefined", "contributes", "SimpleLayoutStateCapability", "Common", "Layout"]
|
|
7
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SimpleLayoutState
|
|
4
|
-
} from "./chunk-MUVVYBUE.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/url-handler/url-handler.ts
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
9
|
-
import { Node } from "@dxos/plugin-graph";
|
|
10
|
-
var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
11
|
-
const { invokeSync } = yield* Capability.get(Common.Capability.OperationInvoker);
|
|
12
|
-
const handleNavigation = () => {
|
|
13
|
-
const pathname = window.location.pathname;
|
|
14
|
-
const [_, nextWorkspace, nextActive] = pathname.split("/");
|
|
15
|
-
const targetWorkspace = !nextWorkspace || nextWorkspace === "root" ? Node.RootId : nextWorkspace;
|
|
16
|
-
invokeSync(Common.LayoutOperation.SwitchWorkspace, {
|
|
17
|
-
subject: targetWorkspace
|
|
18
|
-
});
|
|
19
|
-
if (nextActive) {
|
|
20
|
-
invokeSync(Common.LayoutOperation.Open, {
|
|
21
|
-
subject: [
|
|
22
|
-
nextActive
|
|
23
|
-
]
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
yield* Effect.sync(() => handleNavigation());
|
|
28
|
-
window.addEventListener("popstate", handleNavigation);
|
|
29
|
-
let lastWorkspace;
|
|
30
|
-
let lastActive;
|
|
31
|
-
const unsubscribe = yield* Common.Capability.subscribeAtom(SimpleLayoutState, (state) => {
|
|
32
|
-
const { workspace, active } = state;
|
|
33
|
-
if (workspace !== lastWorkspace || active !== lastActive) {
|
|
34
|
-
lastWorkspace = workspace;
|
|
35
|
-
lastActive = active;
|
|
36
|
-
let path;
|
|
37
|
-
if (workspace === Node.RootId) {
|
|
38
|
-
path = active ? `/${Node.RootId}/${active}` : "/";
|
|
39
|
-
} else {
|
|
40
|
-
path = active ? `/${workspace}/${active}` : `/${workspace}`;
|
|
41
|
-
}
|
|
42
|
-
if (window.location.pathname !== path) {
|
|
43
|
-
history.pushState(null, "", `${path}${window.location.search}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => {
|
|
48
|
-
window.removeEventListener("popstate", handleNavigation);
|
|
49
|
-
unsubscribe();
|
|
50
|
-
}));
|
|
51
|
-
}));
|
|
52
|
-
export {
|
|
53
|
-
url_handler_default as default
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=url-handler-4LYP3JM7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/url-handler/url-handler.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\n/**\n * URL handler for simple layout that syncs browser URL with layout state.\n * URL format: /{workspace} or /{workspace}/{active}\n * Root is represented as / or /root.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const { invokeSync } = yield* Capability.get(Common.Capability.OperationInvoker);\n\n /**\n * Handle navigation events (initial load and popstate).\n * Parses URL and updates state accordingly.\n */\n const handleNavigation = () => {\n const pathname = window.location.pathname;\n\n // Parse URL segments: /{workspace}/{active}\n const [_, nextWorkspace, nextActive] = pathname.split('/');\n\n // Determine target workspace (empty or 'root' means Node.RootId).\n const targetWorkspace = !nextWorkspace || nextWorkspace === 'root' ? Node.RootId : nextWorkspace;\n\n // Navigate via operations (they will update state accordingly).\n invokeSync(Common.LayoutOperation.SwitchWorkspace, { subject: targetWorkspace });\n if (nextActive) {\n invokeSync(Common.LayoutOperation.Open, { subject: [nextActive] });\n }\n };\n\n // Handle initial URL and listen for browser navigation.\n yield* Effect.sync(() => handleNavigation());\n window.addEventListener('popstate', handleNavigation);\n\n // Subscribe to state changes to update the URL.\n let lastWorkspace: string | undefined;\n let lastActive: string | undefined;\n const unsubscribe = yield* Common.Capability.subscribeAtom(\n SimpleLayoutStateCapability,\n (state: SimpleLayoutState) => {\n const { workspace, active } = state;\n\n // Only update URL if relevant state changed.\n if (workspace !== lastWorkspace || active !== lastActive) {\n lastWorkspace = workspace;\n lastActive = active;\n\n // Build path: root is represented as /, other workspaces as /{workspace}.\n let path: string;\n if (workspace === Node.RootId) {\n path = active ? `/${Node.RootId}/${active}` : '/';\n } else {\n path = active ? `/${workspace}/${active}` : `/${workspace}`;\n }\n\n if (window.location.pathname !== path) {\n history.pushState(null, '', `${path}${window.location.search}`);\n }\n }\n },\n );\n\n return Capability.contributes(Common.Capability.Null, null, () =>\n Effect.sync(() => {\n window.removeEventListener('popstate', handleNavigation);\n unsubscribe();\n }),\n );\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,YAAY;AASrB,IAAA,sBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAM,EAAEC,WAAU,IAAK,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,gBAAgB;AAM/E,QAAMC,mBAAmB,MAAA;AACvB,UAAMC,WAAWC,OAAOC,SAASF;AAGjC,UAAM,CAACG,GAAGC,eAAeC,UAAAA,IAAcL,SAASM,MAAM,GAAA;AAGtD,UAAMC,kBAAkB,CAACH,iBAAiBA,kBAAkB,SAASI,KAAKC,SAASL;AAGnFT,eAAWE,OAAOa,gBAAgBC,iBAAiB;MAAEC,SAASL;IAAgB,CAAA;AAC9E,QAAIF,YAAY;AACdV,iBAAWE,OAAOa,gBAAgBG,MAAM;QAAED,SAAS;UAACP;;MAAY,CAAA;IAClE;EACF;AAGA,SAAcS,YAAK,MAAMf,iBAAAA,CAAAA;AACzBE,SAAOc,iBAAiB,YAAYhB,gBAAAA;AAGpC,MAAIiB;AACJ,MAAIC;AACJ,QAAMC,cAAc,OAAOrB,OAAOL,WAAW2B,cAC3CC,mBACA,CAACC,UAAAA;AACC,UAAM,EAAEC,WAAWC,OAAM,IAAKF;AAG9B,QAAIC,cAAcN,iBAAiBO,WAAWN,YAAY;AACxDD,sBAAgBM;AAChBL,mBAAaM;AAGb,UAAIC;AACJ,UAAIF,cAAcd,KAAKC,QAAQ;AAC7Be,eAAOD,SAAS,IAAIf,KAAKC,MAAM,IAAIc,MAAAA,KAAW;MAChD,OAAO;AACLC,eAAOD,SAAS,IAAID,SAAAA,IAAaC,MAAAA,KAAW,IAAID,SAAAA;MAClD;AAEA,UAAIrB,OAAOC,SAASF,aAAawB,MAAM;AACrCC,gBAAQC,UAAU,MAAM,IAAI,GAAGF,IAAAA,GAAOvB,OAAOC,SAASyB,MAAM,EAAE;MAChE;IACF;EACF,CAAA;AAGF,SAAOnC,WAAWoC,YAAY/B,OAAOL,WAAWqC,MAAM,MAAM,MACnDf,YAAK,MAAA;AACVb,WAAO6B,oBAAoB,YAAY/B,gBAAAA;AACvCmB,gBAAAA;EACF,CAAA,CAAA;AAEJ,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "Capability", "Common", "Node", "Capability", "makeModule", "fnUntraced", "invokeSync", "get", "Common", "OperationInvoker", "handleNavigation", "pathname", "window", "location", "_", "nextWorkspace", "nextActive", "split", "targetWorkspace", "Node", "RootId", "LayoutOperation", "SwitchWorkspace", "subject", "Open", "sync", "addEventListener", "lastWorkspace", "lastActive", "unsubscribe", "subscribeAtom", "SimpleLayoutStateCapability", "state", "workspace", "active", "path", "history", "pushState", "search", "contributes", "Null", "removeEventListener"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentError.d.ts","sourceRoot":"","sources":["../../../../src/components/ContentError.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,YAAY,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,sBAUxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLoading.d.ts","sourceRoot":"","sources":["../../../../src/components/ContentLoading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,cAAc,yBAE1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLoading.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ContentLoading.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjE,QAAA,MAAM,IAAI;;;;;;;CAO6B,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Node } from '@dxos/plugin-graph';
|
|
3
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
-
export type BannerProps = ThemedClassName<{
|
|
5
|
-
node?: Node.Node;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const Banner: ({ node, classNames }: BannerProps) => React.JSX.Element | null;
|
|
8
|
-
//# sourceMappingURL=Banner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../../../src/components/SimpleLayout/Banner.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,EAAS,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAc,KAAK,eAAe,EAA8C,MAAM,gBAAgB,CAAC;AAiB9G,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;IACxC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,MAAM,GAAI,sBAAsB,WAAW,6BAmDvD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Workspace.d.ts","sourceRoot":"","sources":["../../../../../src/components/Workspace/Workspace.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAa9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,SAAS,GAAI,QAAQ,cAAc,sBA+B/C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Workspace/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
9
|
-
|
|
10
|
-
import { meta } from '../meta';
|
|
11
|
-
|
|
12
|
-
// TODO(burdon): Factor out.
|
|
13
|
-
export const ContentError = ({ error }: { error?: Error }) => {
|
|
14
|
-
const { t } = useTranslation(meta.id);
|
|
15
|
-
const errorString = error?.toString() ?? '';
|
|
16
|
-
return (
|
|
17
|
-
<div role='none' className='grid place-items-center overflow-y-auto attention-surface'>
|
|
18
|
-
<p role='alert' className={mx(descriptionMessage, 'p-2 break-all rounded-sm')}>
|
|
19
|
-
{error ? errorString : t('error fallback message')}
|
|
20
|
-
</p>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Common } from '@dxos/app-framework';
|
|
8
|
-
import { useAppGraph, useOperationInvoker } from '@dxos/app-framework/react';
|
|
9
|
-
import { Graph, Node } from '@dxos/plugin-graph';
|
|
10
|
-
import { IconButton, type ThemedClassName, Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { mx, osTranslations } from '@dxos/ui-theme';
|
|
12
|
-
|
|
13
|
-
import { useSimpleLayoutState } from '../../hooks';
|
|
14
|
-
import { meta } from '../../meta';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Check if an item is a direct child of a workspace or collection.
|
|
18
|
-
* Returns true if any parent node has disposition 'workspace' or 'collection'.
|
|
19
|
-
*/
|
|
20
|
-
const isWorkspaceOrCollectionChild = (graph: Graph.ReadableGraph, itemId: string): boolean => {
|
|
21
|
-
const parents = Graph.getConnections(graph, itemId, 'inbound');
|
|
22
|
-
return parents.some(
|
|
23
|
-
(node) => node.properties.disposition === 'workspace' || node.properties.disposition === 'collection',
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type BannerProps = ThemedClassName<{
|
|
28
|
-
node?: Node.Node;
|
|
29
|
-
}>;
|
|
30
|
-
|
|
31
|
-
export const Banner = ({ node, classNames }: BannerProps) => {
|
|
32
|
-
const { t } = useTranslation(meta.id);
|
|
33
|
-
const { state } = useSimpleLayoutState();
|
|
34
|
-
const { invokePromise } = useOperationInvoker();
|
|
35
|
-
const { graph } = useAppGraph();
|
|
36
|
-
|
|
37
|
-
const label = (node && toLocalizedString(node.properties.label, t)) ?? t('current app name', { ns: osTranslations });
|
|
38
|
-
|
|
39
|
-
// Check if current active item is a top-level workspace/collection child.
|
|
40
|
-
const isTopLevelItem = useMemo(() => {
|
|
41
|
-
if (!state.active) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
return isWorkspaceOrCollectionChild(graph, state.active);
|
|
45
|
-
}, [graph, state.active]);
|
|
46
|
-
|
|
47
|
-
const handleClick = useCallback(async () => {
|
|
48
|
-
if (state.active) {
|
|
49
|
-
// If history is empty and this is a top-level item, go to home.
|
|
50
|
-
if (state.history.length === 0 && isTopLevelItem) {
|
|
51
|
-
await invokePromise(Common.LayoutOperation.SwitchWorkspace, { subject: Node.RootId });
|
|
52
|
-
} else {
|
|
53
|
-
// Otherwise, close (which will pop from history or clear active).
|
|
54
|
-
await invokePromise(Common.LayoutOperation.Close, { subject: [state.active] });
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
await invokePromise(Common.LayoutOperation.SwitchWorkspace, { subject: Node.RootId });
|
|
58
|
-
}
|
|
59
|
-
}, [invokePromise, state.active, state.history.length, isTopLevelItem]);
|
|
60
|
-
|
|
61
|
-
if (!node) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<Toolbar.Root role='banner' classNames={mx('grid grid-cols-[var(--rail-size)_1fr_var(--rail-size)]', classNames)}>
|
|
67
|
-
{node.id !== Node.RootId ? (
|
|
68
|
-
<IconButton
|
|
69
|
-
iconOnly
|
|
70
|
-
variant='ghost'
|
|
71
|
-
icon='ph--caret-left--regular'
|
|
72
|
-
label={t('back label')}
|
|
73
|
-
onClick={handleClick}
|
|
74
|
-
/>
|
|
75
|
-
) : (
|
|
76
|
-
<div />
|
|
77
|
-
)}
|
|
78
|
-
<h1 className={'grow text-center truncate font-medium'}>{label}</h1>
|
|
79
|
-
<IconButton iconOnly variant='ghost' icon='ph--dots-three-vertical--regular' label={t('menu label')} />
|
|
80
|
-
</Toolbar.Root>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Common } from '@dxos/app-framework';
|
|
8
|
-
import { useAppGraph, useOperationInvoker } from '@dxos/app-framework/react';
|
|
9
|
-
import { type Node, useConnections } from '@dxos/plugin-graph';
|
|
10
|
-
import { Avatar, Icon, Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
11
|
-
import { Card, Layout, Mosaic, type StackTileComponent } from '@dxos/react-ui-mosaic';
|
|
12
|
-
import { SearchList, useSearchListItem, useSearchListResults } from '@dxos/react-ui-searchlist';
|
|
13
|
-
import { mx } from '@dxos/ui-theme';
|
|
14
|
-
|
|
15
|
-
import { meta } from '../../meta';
|
|
16
|
-
import { useLoadDescendents } from '../hooks';
|
|
17
|
-
|
|
18
|
-
export type WorkspaceProps = {
|
|
19
|
-
id: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
// TODO(burdon): Rename or motivate name in comment.
|
|
26
|
-
export const Workspace = ({ id }: WorkspaceProps) => {
|
|
27
|
-
const { t } = useTranslation(meta.id);
|
|
28
|
-
const { graph } = useAppGraph();
|
|
29
|
-
|
|
30
|
-
// Expand the workspace node to load its children.
|
|
31
|
-
useLoadDescendents(id);
|
|
32
|
-
|
|
33
|
-
// Get direct children of the workspace node.
|
|
34
|
-
const children = useConnections(graph, id, 'outbound');
|
|
35
|
-
|
|
36
|
-
const { results, handleSearch } = useSearchListResults({
|
|
37
|
-
items: children,
|
|
38
|
-
extract: (child) => toLocalizedString(child.properties.label, t),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Layout.Main toolbar>
|
|
43
|
-
<SearchList.Root onSearch={handleSearch}>
|
|
44
|
-
<Toolbar.Root>
|
|
45
|
-
<SearchList.Input placeholder={t('search placeholder')} autoFocus />
|
|
46
|
-
</Toolbar.Root>
|
|
47
|
-
<SearchList.Content>
|
|
48
|
-
<Mosaic.Container asChild>
|
|
49
|
-
<Mosaic.Viewport padding>
|
|
50
|
-
<Mosaic.Stack items={results} getId={(child) => child.id} Tile={WorkspaceChildTile} />
|
|
51
|
-
</Mosaic.Viewport>
|
|
52
|
-
</Mosaic.Container>
|
|
53
|
-
</SearchList.Content>
|
|
54
|
-
</SearchList.Root>
|
|
55
|
-
</Layout.Main>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const WorkspaceChildTile: StackTileComponent<Node.Node> = ({ data }) => {
|
|
60
|
-
const { t } = useTranslation(meta.id);
|
|
61
|
-
const { invokeSync } = useOperationInvoker();
|
|
62
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
63
|
-
const { selectedValue, registerItem, unregisterItem } = useSearchListItem();
|
|
64
|
-
const isSelected = selectedValue === data.id;
|
|
65
|
-
|
|
66
|
-
const name = toLocalizedString(data.properties.label, t);
|
|
67
|
-
|
|
68
|
-
const handleSelect = useCallback(
|
|
69
|
-
() => invokeSync(Common.LayoutOperation.Open, { subject: [data.id] }),
|
|
70
|
-
[invokeSync, data.id],
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
// Register this item with the search context.
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (ref.current) {
|
|
76
|
-
registerItem(data.id, ref.current, handleSelect);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return () => unregisterItem(data.id);
|
|
80
|
-
}, [data.id, handleSelect, registerItem, unregisterItem]);
|
|
81
|
-
|
|
82
|
-
// Scroll into view when selected.
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
if (isSelected && ref.current) {
|
|
85
|
-
ref.current.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
|
86
|
-
}
|
|
87
|
-
}, [isSelected]);
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<Card.Root
|
|
91
|
-
ref={ref}
|
|
92
|
-
role='button'
|
|
93
|
-
fullWidth
|
|
94
|
-
tabIndex={-1} // TODO(burdon): Use Mosaic.Focus.
|
|
95
|
-
data-selected={isSelected}
|
|
96
|
-
classNames={mx('dx-focus-ring', isSelected && 'bg-hoverOverlay')}
|
|
97
|
-
onClick={handleSelect}
|
|
98
|
-
>
|
|
99
|
-
<Card.Toolbar density='coarse'>
|
|
100
|
-
<Avatar.Root>
|
|
101
|
-
<Avatar.Content
|
|
102
|
-
hue={data.properties.hue}
|
|
103
|
-
icon={data.properties.icon}
|
|
104
|
-
hueVariant='transparent'
|
|
105
|
-
variant='square'
|
|
106
|
-
size={12}
|
|
107
|
-
fallback={name}
|
|
108
|
-
/>
|
|
109
|
-
<Avatar.Label>{name}</Avatar.Label>
|
|
110
|
-
<Icon icon='ph--caret-right--regular' />
|
|
111
|
-
</Avatar.Root>
|
|
112
|
-
</Card.Toolbar>
|
|
113
|
-
</Card.Root>
|
|
114
|
-
);
|
|
115
|
-
};
|
/package/dist/types/src/components/{ContentLoading.d.ts → ContentLoading/ContentLoading.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|