@dxos/plugin-simple-layout 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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/index.mjs +44 -58
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +44 -57
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/SimpleLayoutPlugin.d.ts +1 -1
- package/dist/types/src/SimpleLayoutPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +21 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{spotlight-dismiss/spotlight-dismiss.d.ts → spotlight-dismiss.d.ts} +1 -1
- package/dist/types/src/capabilities/spotlight-dismiss.d.ts.map +1 -0
- package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts +12 -0
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/ContentError.stories.d.ts +26 -15
- package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts +19 -0
- package/dist/types/src/components/DebugOverlay/DebugOverlay.d.ts.map +1 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts +2 -0
- package/dist/types/src/components/DebugOverlay/index.d.ts.map +1 -0
- package/dist/types/src/components/Home/Home.d.ts.map +1 -1
- package/dist/types/src/components/Loading/Loading.d.ts +3 -0
- package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/types/src/components/{ContentLoading.stories.d.ts → Loading/Loading.stories.d.ts} +1 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/types/src/components/Loading/index.d.ts +2 -0
- package/dist/types/src/components/Loading/index.d.ts.map +1 -0
- 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 +24 -0
- package/dist/types/src/components/SimpleLayout/AppBar.d.ts.map +1 -0
- package/dist/types/src/components/SimpleLayout/AppBar.stories.d.ts +54 -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 +14 -6
- package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
- package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +31 -21
- 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 +26 -15
- 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 +4 -2
- 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/operations/close.d.ts +5 -0
- package/dist/types/src/operations/close.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/revert-workspace.d.ts +5 -0
- package/dist/types/src/operations/revert-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/set-layout-mode.d.ts +5 -0
- package/dist/types/src/operations/set-layout-mode.d.ts.map +1 -0
- package/dist/types/src/operations/set.d.ts +5 -0
- package/dist/types/src/operations/set.d.ts.map +1 -0
- package/dist/types/src/operations/state-access.d.ts +8 -0
- package/dist/types/src/operations/state-access.d.ts.map +1 -0
- package/dist/types/src/operations/switch-workspace.d.ts +5 -0
- package/dist/types/src/operations/switch-workspace.d.ts.map +1 -0
- package/dist/types/src/operations/update-complementary.d.ts +5 -0
- package/dist/types/src/operations/update-complementary.d.ts.map +1 -0
- package/dist/types/src/operations/update-dialog.d.ts +5 -0
- package/dist/types/src/operations/update-dialog.d.ts.map +1 -0
- package/dist/types/src/operations/update-popover.d.ts +5 -0
- package/dist/types/src/operations/update-popover.d.ts.map +1 -0
- package/dist/types/src/operations/update-sidebar.d.ts +5 -0
- package/dist/types/src/operations/update-sidebar.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +26 -13
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +18 -5
- 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 +46 -30
- package/src/SimpleLayoutPlugin.ts +24 -13
- package/src/capabilities/app-graph-builder.ts +21 -0
- package/src/capabilities/index.ts +13 -6
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +4 -4
- package/src/capabilities/react-surface.tsx +50 -0
- package/src/capabilities/{spotlight-dismiss/spotlight-dismiss.ts → spotlight-dismiss.ts} +2 -2
- package/src/capabilities/{state/state.tsx → state.tsx} +8 -5
- package/src/capabilities/url-handler.ts +161 -0
- package/src/components/ContentError.stories.tsx +8 -7
- package/src/components/DebugOverlay/DebugOverlay.tsx +96 -0
- package/src/components/DebugOverlay/index.ts +5 -0
- package/src/components/Dialog/Dialog.tsx +6 -6
- package/src/components/Home/Home.tsx +51 -43
- package/src/components/{ContentLoading.stories.tsx → Loading/Loading.stories.tsx} +5 -5
- package/src/components/{ContentLoading.tsx → Loading/Loading.tsx} +2 -2
- package/src/components/Loading/index.ts +5 -0
- package/src/components/MobileLayout/MobileLayout.stories.tsx +133 -0
- package/src/components/MobileLayout/MobileLayout.tsx +374 -0
- package/src/components/MobileLayout/index.ts +5 -0
- package/src/components/NavBranch/NavBranch.tsx +128 -0
- package/src/components/{Workspace → NavBranch}/index.ts +1 -1
- package/src/components/Popover/Popover.tsx +10 -9
- package/src/components/SimpleLayout/AppBar.stories.tsx +143 -0
- package/src/components/SimpleLayout/AppBar.tsx +94 -0
- package/src/components/SimpleLayout/Drawer.tsx +98 -0
- package/src/components/SimpleLayout/Main.tsx +45 -48
- package/src/components/SimpleLayout/NavBar.stories.tsx +131 -27
- package/src/components/SimpleLayout/NavBar.tsx +21 -62
- package/src/components/SimpleLayout/SimpleLayout.stories.tsx +45 -55
- package/src/components/SimpleLayout/SimpleLayout.tsx +45 -7
- package/src/components/SimpleLayout/index.ts +3 -0
- package/src/components/hooks.ts +10 -14
- package/src/components/index.ts +4 -2
- package/src/hooks/actions.ts +84 -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/operations/close.ts +34 -0
- package/src/operations/index.ts +16 -0
- package/src/operations/open.ts +63 -0
- package/src/operations/revert-workspace.ts +22 -0
- package/src/operations/set-layout-mode.ts +12 -0
- package/src/operations/set.ts +23 -0
- package/src/operations/state-access.ts +19 -0
- package/src/operations/switch-workspace.ts +26 -0
- package/src/operations/update-complementary.ts +35 -0
- package/src/operations/update-dialog.ts +28 -0
- package/src/operations/update-popover.ts +35 -0
- package/src/operations/update-sidebar.ts +12 -0
- package/src/translations.ts +21 -13
- package/src/types/capabilities.ts +16 -7
- package/src/types/events.ts +3 -2
- package/dist/lib/browser/chunk-CLPGTNWJ.mjs +0 -29
- 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 +0 -168
- package/dist/lib/browser/operation-resolver-LTB63NKP.mjs.map +0 -7
- package/dist/lib/browser/react-root-6ARAPH3O.mjs +0 -21
- package/dist/lib/browser/react-root-6ARAPH3O.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SO7B23GS.mjs +0 -39
- package/dist/lib/browser/react-surface-SO7B23GS.mjs.map +0 -7
- package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs +0 -66
- package/dist/lib/browser/spotlight-dismiss-VSNOPETH.mjs.map +0 -7
- package/dist/lib/browser/state-H4IGICBB.mjs +0 -45
- 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 +0 -31
- package/dist/lib/node-esm/chunk-MUVVYBUE.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs +0 -169
- package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-2CPA2ZUS.mjs +0 -22
- package/dist/lib/node-esm/react-root-2CPA2ZUS.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-FKAV56MO.mjs +0 -40
- package/dist/lib/node-esm/react-surface-FKAV56MO.mjs.map +0 -7
- package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs +0 -68
- package/dist/lib/node-esm/spotlight-dismiss-L5PCWIJG.mjs.map +0 -7
- package/dist/lib/node-esm/state-QIU2LMLT.mjs +0 -46
- 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/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
- package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts +0 -3
- package/dist/types/src/capabilities/spotlight-dismiss/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/spotlight-dismiss/spotlight-dismiss.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/index.d.ts +0 -13
- package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +0 -10
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +0 -1
- 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 +0 -3
- 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/capabilities/operation-resolver/index.ts +0 -10
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -178
- package/src/capabilities/react-root/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -40
- package/src/capabilities/spotlight-dismiss/index.ts +0 -7
- package/src/capabilities/state/index.ts +0 -9
- package/src/capabilities/url-handler/index.ts +0 -7
- package/src/capabilities/url-handler/url-handler.ts +0 -80
- package/src/components/ContentError.tsx +0 -23
- package/src/components/SimpleLayout/Banner.tsx +0 -82
- package/src/components/Workspace/Workspace.tsx +0 -115
|
@@ -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;AA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O/C,MAAI,MACV,gBAAAL,QAAA,cAACoD,QAAOzC,SAAO;IACb0C,KAAKhC,KAAKvB,WAAWuD;IACrBC,MAAMjC,KAAKvB,WAAWwD;IACtBC,YAAW;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,31 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/meta.ts
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var meta = {
|
|
6
|
-
id: "dxos.org/plugin/simple-layout",
|
|
7
|
-
name: "Simple Layout",
|
|
8
|
-
description: trim`
|
|
9
|
-
Minimal layout plugin for simplified UI contexts like popover windows.
|
|
10
|
-
Provides basic content rendering without sidebars or complex navigation.
|
|
11
|
-
`,
|
|
12
|
-
icon: "ph--layout--regular"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// src/types/capabilities.ts
|
|
16
|
-
import { Capability } from "@dxos/app-framework";
|
|
17
|
-
var SimpleLayoutState = Capability.make(`${meta.id}/state`);
|
|
18
|
-
|
|
19
|
-
// src/types/events.ts
|
|
20
|
-
import { Common } from "@dxos/app-framework";
|
|
21
|
-
(function(SimpleLayoutEvents2) {
|
|
22
|
-
SimpleLayoutEvents2.StateReady = Common.ActivationEvent.createStateEvent(SimpleLayoutState.identifier);
|
|
23
|
-
})(SimpleLayoutEvents || (SimpleLayoutEvents = {}));
|
|
24
|
-
var SimpleLayoutEvents;
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
meta,
|
|
28
|
-
SimpleLayoutState,
|
|
29
|
-
SimpleLayoutEvents
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=chunk-MUVVYBUE.mjs.map
|
|
@@ -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,169 +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/operation-resolver/operation-resolver.ts
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
9
|
-
import { Operation, OperationResolver } from "@dxos/operation";
|
|
10
|
-
var MAX_HISTORY_LENGTH = 50;
|
|
11
|
-
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
12
|
-
const registry = yield* Capability.get(Common.Capability.AtomRegistry);
|
|
13
|
-
const stateAtom = yield* Capability.get(SimpleLayoutState);
|
|
14
|
-
const getState = () => registry.get(stateAtom);
|
|
15
|
-
const updateState = (fn) => {
|
|
16
|
-
registry.set(stateAtom, fn(getState()));
|
|
17
|
-
};
|
|
18
|
-
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
19
|
-
//
|
|
20
|
-
// UpdateSidebar - No-op for simple layout.
|
|
21
|
-
//
|
|
22
|
-
OperationResolver.make({
|
|
23
|
-
operation: Common.LayoutOperation.UpdateSidebar,
|
|
24
|
-
handler: () => Effect.void
|
|
25
|
-
}),
|
|
26
|
-
//
|
|
27
|
-
// UpdateComplementary - No-op for simple layout.
|
|
28
|
-
//
|
|
29
|
-
OperationResolver.make({
|
|
30
|
-
operation: Common.LayoutOperation.UpdateComplementary,
|
|
31
|
-
handler: () => Effect.void
|
|
32
|
-
}),
|
|
33
|
-
//
|
|
34
|
-
// UpdateDialog
|
|
35
|
-
//
|
|
36
|
-
OperationResolver.make({
|
|
37
|
-
operation: Common.LayoutOperation.UpdateDialog,
|
|
38
|
-
handler: Effect.fnUntraced(function* (input) {
|
|
39
|
-
updateState((state) => ({
|
|
40
|
-
...state,
|
|
41
|
-
dialogOpen: input.state ?? Boolean(input.subject),
|
|
42
|
-
dialogType: input.type ?? "default",
|
|
43
|
-
dialogBlockAlign: input.blockAlign ?? "center",
|
|
44
|
-
dialogOverlayClasses: input.overlayClasses,
|
|
45
|
-
dialogOverlayStyle: input.overlayStyle,
|
|
46
|
-
dialogContent: input.subject ? {
|
|
47
|
-
component: input.subject,
|
|
48
|
-
props: input.props
|
|
49
|
-
} : void 0
|
|
50
|
-
}));
|
|
51
|
-
})
|
|
52
|
-
}),
|
|
53
|
-
//
|
|
54
|
-
// UpdatePopover
|
|
55
|
-
//
|
|
56
|
-
OperationResolver.make({
|
|
57
|
-
operation: Common.LayoutOperation.UpdatePopover,
|
|
58
|
-
handler: Effect.fnUntraced(function* (input) {
|
|
59
|
-
updateState((state) => ({
|
|
60
|
-
...state,
|
|
61
|
-
popoverOpen: input.state ?? Boolean(input.subject),
|
|
62
|
-
popoverKind: input.kind ?? "base",
|
|
63
|
-
popoverTitle: input.kind === "card" ? input.title : void 0,
|
|
64
|
-
popoverContent: typeof input.subject === "string" ? {
|
|
65
|
-
component: input.subject,
|
|
66
|
-
props: input.props
|
|
67
|
-
} : input.subject ? {
|
|
68
|
-
subject: input.subject
|
|
69
|
-
} : void 0,
|
|
70
|
-
popoverSide: input.side,
|
|
71
|
-
popoverVariant: input.variant,
|
|
72
|
-
popoverAnchor: input.variant === "virtual" ? input.anchor : state.popoverAnchor,
|
|
73
|
-
popoverAnchorId: input.variant !== "virtual" ? input.anchorId : state.popoverAnchorId
|
|
74
|
-
}));
|
|
75
|
-
})
|
|
76
|
-
}),
|
|
77
|
-
//
|
|
78
|
-
// SwitchWorkspace
|
|
79
|
-
//
|
|
80
|
-
OperationResolver.make({
|
|
81
|
-
operation: Common.LayoutOperation.SwitchWorkspace,
|
|
82
|
-
handler: Effect.fnUntraced(function* (input) {
|
|
83
|
-
updateState((state) => ({
|
|
84
|
-
...state,
|
|
85
|
-
// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
|
|
86
|
-
// Ideally this should be worked into the data model in a generic way.
|
|
87
|
-
previousWorkspace: !state.workspace.startsWith("!") ? state.workspace : state.previousWorkspace,
|
|
88
|
-
workspace: input.subject,
|
|
89
|
-
active: void 0,
|
|
90
|
-
// Clear history when switching workspaces.
|
|
91
|
-
history: []
|
|
92
|
-
}));
|
|
93
|
-
})
|
|
94
|
-
}),
|
|
95
|
-
//
|
|
96
|
-
// RevertWorkspace
|
|
97
|
-
//
|
|
98
|
-
OperationResolver.make({
|
|
99
|
-
operation: Common.LayoutOperation.RevertWorkspace,
|
|
100
|
-
handler: Effect.fnUntraced(function* () {
|
|
101
|
-
const state = getState();
|
|
102
|
-
yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, {
|
|
103
|
-
subject: state.previousWorkspace
|
|
104
|
-
});
|
|
105
|
-
})
|
|
106
|
-
}),
|
|
107
|
-
//
|
|
108
|
-
// Open
|
|
109
|
-
//
|
|
110
|
-
OperationResolver.make({
|
|
111
|
-
operation: Common.LayoutOperation.Open,
|
|
112
|
-
handler: Effect.fnUntraced(function* (input) {
|
|
113
|
-
updateState((state) => {
|
|
114
|
-
const newHistory = state.active ? [
|
|
115
|
-
...state.history,
|
|
116
|
-
state.active
|
|
117
|
-
] : state.history;
|
|
118
|
-
const trimmedHistory = newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;
|
|
119
|
-
return {
|
|
120
|
-
...state,
|
|
121
|
-
active: input.subject[0],
|
|
122
|
-
history: trimmedHistory
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
})
|
|
126
|
-
}),
|
|
127
|
-
//
|
|
128
|
-
// Close
|
|
129
|
-
//
|
|
130
|
-
OperationResolver.make({
|
|
131
|
-
operation: Common.LayoutOperation.Close,
|
|
132
|
-
handler: Effect.fnUntraced(function* () {
|
|
133
|
-
updateState((state) => {
|
|
134
|
-
if (state.history.length > 0) {
|
|
135
|
-
const newHistory = [
|
|
136
|
-
...state.history
|
|
137
|
-
];
|
|
138
|
-
const previousActive = newHistory.pop();
|
|
139
|
-
return {
|
|
140
|
-
...state,
|
|
141
|
-
active: previousActive,
|
|
142
|
-
history: newHistory
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
...state,
|
|
147
|
-
active: void 0
|
|
148
|
-
};
|
|
149
|
-
});
|
|
150
|
-
})
|
|
151
|
-
}),
|
|
152
|
-
//
|
|
153
|
-
// Set
|
|
154
|
-
//
|
|
155
|
-
OperationResolver.make({
|
|
156
|
-
operation: Common.LayoutOperation.Set,
|
|
157
|
-
handler: Effect.fnUntraced(function* (input) {
|
|
158
|
-
updateState((state) => ({
|
|
159
|
-
...state,
|
|
160
|
-
active: input.subject[0]
|
|
161
|
-
}));
|
|
162
|
-
})
|
|
163
|
-
})
|
|
164
|
-
]);
|
|
165
|
-
}));
|
|
166
|
-
export {
|
|
167
|
-
operation_resolver_default as default
|
|
168
|
-
};
|
|
169
|
-
//# sourceMappingURL=operation-resolver-7O6O7T4Q.mjs.map
|
|
@@ -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;;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F,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,22 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SimpleLayout
|
|
4
|
-
} from "./chunk-EGFZAVBD.mjs";
|
|
5
|
-
import {
|
|
6
|
-
meta
|
|
7
|
-
} from "./chunk-MUVVYBUE.mjs";
|
|
8
|
-
|
|
9
|
-
// src/capabilities/react-root/react-root.tsx
|
|
10
|
-
import * as Effect from "effect/Effect";
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
13
|
-
var react_root_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactRoot, {
|
|
14
|
-
id: meta.id,
|
|
15
|
-
root: () => {
|
|
16
|
-
return /* @__PURE__ */ React.createElement(SimpleLayout, null);
|
|
17
|
-
}
|
|
18
|
-
})));
|
|
19
|
-
export {
|
|
20
|
-
react_root_default as default
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=react-root-2CPA2ZUS.mjs.map
|
|
@@ -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,40 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
Home,
|
|
4
|
-
Workspace
|
|
5
|
-
} from "./chunk-EGFZAVBD.mjs";
|
|
6
|
-
import {
|
|
7
|
-
meta
|
|
8
|
-
} from "./chunk-MUVVYBUE.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
14
|
-
import { Node } from "@dxos/plugin-graph";
|
|
15
|
-
var ALLOWED_DISPOSITIONS = [
|
|
16
|
-
"workspace",
|
|
17
|
-
"user-account",
|
|
18
|
-
"pin-end"
|
|
19
|
-
];
|
|
20
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
|
|
21
|
-
Common.createSurface({
|
|
22
|
-
id: `${meta.id}/home`,
|
|
23
|
-
role: "article",
|
|
24
|
-
filter: (data) => data.attendableId === Node.RootId,
|
|
25
|
-
component: () => /* @__PURE__ */ React.createElement(Home, null)
|
|
26
|
-
}),
|
|
27
|
-
Common.createSurface({
|
|
28
|
-
id: `${meta.id}/workspace-article`,
|
|
29
|
-
role: "article",
|
|
30
|
-
position: "fallback",
|
|
31
|
-
filter: (data) => ALLOWED_DISPOSITIONS.includes(data.properties?.disposition),
|
|
32
|
-
component: ({ data }) => /* @__PURE__ */ React.createElement(Workspace, {
|
|
33
|
-
id: data.attendableId
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
])));
|
|
37
|
-
export {
|
|
38
|
-
react_surface_default as default
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=react-surface-FKAV56MO.mjs.map
|
|
@@ -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,68 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/capabilities/spotlight-dismiss/spotlight-dismiss.ts
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
6
|
-
import { log } from "@dxos/log";
|
|
7
|
-
import { isTauri } from "@dxos/util";
|
|
8
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-simple-layout/src/capabilities/spotlight-dismiss/spotlight-dismiss.ts";
|
|
9
|
-
var getTauriWindow = () => {
|
|
10
|
-
const tauri = globalThis.__TAURI__;
|
|
11
|
-
return tauri?.window;
|
|
12
|
-
};
|
|
13
|
-
var getTauriCore = () => {
|
|
14
|
-
const tauri = globalThis.__TAURI__;
|
|
15
|
-
return tauri?.core;
|
|
16
|
-
};
|
|
17
|
-
var spotlight_dismiss_default = Capability.makeModule(({ isPopover = false } = {}) => Effect.promise(async () => {
|
|
18
|
-
if (!isPopover || !isTauri()) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
let focusCleanup;
|
|
22
|
-
try {
|
|
23
|
-
const tauriWindow = getTauriWindow();
|
|
24
|
-
const tauriCore = getTauriCore();
|
|
25
|
-
if (tauriWindow && tauriCore) {
|
|
26
|
-
const win = tauriWindow.getCurrentWindow();
|
|
27
|
-
focusCleanup = await win.onFocusChanged(async ({ payload }) => {
|
|
28
|
-
if (!payload) {
|
|
29
|
-
await tauriCore.invoke("hide_spotlight");
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
} catch (err) {
|
|
34
|
-
log.catch(err, void 0, {
|
|
35
|
-
F: __dxlog_file,
|
|
36
|
-
L: 60,
|
|
37
|
-
S: void 0,
|
|
38
|
-
C: (f, a) => f(...a)
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
const handleKeyDown = async (event) => {
|
|
42
|
-
if (event.key === "Escape") {
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
try {
|
|
45
|
-
const tauriCore = getTauriCore();
|
|
46
|
-
if (tauriCore) {
|
|
47
|
-
await tauriCore.invoke("hide_spotlight");
|
|
48
|
-
}
|
|
49
|
-
} catch (err) {
|
|
50
|
-
log.catch(err, void 0, {
|
|
51
|
-
F: __dxlog_file,
|
|
52
|
-
L: 73,
|
|
53
|
-
S: void 0,
|
|
54
|
-
C: (f, a) => f(...a)
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
60
|
-
return Capability.contributes(Common.Capability.Null, null, () => Effect.sync(() => {
|
|
61
|
-
focusCleanup?.();
|
|
62
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
63
|
-
}));
|
|
64
|
-
}));
|
|
65
|
-
export {
|
|
66
|
-
spotlight_dismiss_default as default
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=spotlight-dismiss-L5PCWIJG.mjs.map
|
|
@@ -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,46 +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/state/state.tsx
|
|
7
|
-
import { Atom } from "@effect-atom/atom-react";
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import { Capability, Common } from "@dxos/app-framework";
|
|
10
|
-
import { Node } from "@dxos/plugin-graph";
|
|
11
|
-
var defaultState = {
|
|
12
|
-
dialogOpen: false,
|
|
13
|
-
workspace: Node.RootId,
|
|
14
|
-
previousWorkspace: Node.RootId,
|
|
15
|
-
history: [],
|
|
16
|
-
isPopover: false
|
|
17
|
-
};
|
|
18
|
-
var state_default = Capability.makeModule(({ initialState } = {}) => Effect.sync(() => {
|
|
19
|
-
const stateAtom = Atom.make({
|
|
20
|
-
...defaultState,
|
|
21
|
-
...initialState
|
|
22
|
-
});
|
|
23
|
-
const layoutAtom = Atom.make((get) => {
|
|
24
|
-
const state = get(stateAtom);
|
|
25
|
-
return {
|
|
26
|
-
mode: "simple",
|
|
27
|
-
dialogOpen: state.dialogOpen,
|
|
28
|
-
sidebarOpen: false,
|
|
29
|
-
complementarySidebarOpen: false,
|
|
30
|
-
workspace: state.workspace,
|
|
31
|
-
active: state.active ? [
|
|
32
|
-
state.active
|
|
33
|
-
] : [],
|
|
34
|
-
inactive: [],
|
|
35
|
-
scrollIntoView: void 0
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
return [
|
|
39
|
-
Capability.contributes(SimpleLayoutState, stateAtom),
|
|
40
|
-
Capability.contributes(Common.Capability.Layout, layoutAtom)
|
|
41
|
-
];
|
|
42
|
-
}));
|
|
43
|
-
export {
|
|
44
|
-
state_default as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=state-QIU2LMLT.mjs.map
|
|
@@ -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
|
-
}
|