@dxos/plugin-stack 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea
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/{StackMain-XB2KQL47.mjs → StackContainer-HXD7C5GX.mjs} +23 -24
- package/dist/lib/browser/StackContainer-HXD7C5GX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-IRTROCUQ.mjs → chunk-NHMDZYOB.mjs} +3 -3
- package/dist/lib/browser/chunk-NHMDZYOB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-MS4QSWEZ.mjs → chunk-UIKFKRFJ.mjs} +6 -2
- package/dist/lib/browser/chunk-UIKFKRFJ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-DEADYQ54.mjs → react-surface-IV2S35VD.mjs} +5 -11
- package/dist/lib/browser/react-surface-IV2S35VD.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{StackMain-BXSBDAF5.mjs → StackContainer-OTSCVZKK.mjs} +23 -24
- package/dist/lib/node-esm/StackContainer-OTSCVZKK.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5FDDKAPB.mjs → chunk-BGVQYUYP.mjs} +6 -2
- package/dist/lib/node-esm/chunk-BGVQYUYP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LRAZXJ65.mjs → chunk-ZZFA7HIV.mjs} +3 -3
- package/dist/lib/node-esm/chunk-ZZFA7HIV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-VDFOPDUT.mjs → react-surface-3W7REXUX.mjs} +5 -11
- package/dist/lib/node-esm/react-surface-3W7REXUX.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/StackContainer.d.ts +9 -0
- package/dist/types/src/components/StackContainer.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +3 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/stack.d.ts +3 -3
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -26
- package/src/capabilities/react-surface.tsx +2 -6
- package/src/components/{StackMain.tsx → StackContainer.tsx} +36 -29
- package/src/components/index.ts +1 -1
- package/src/meta.ts +5 -1
- package/src/types/stack.ts +2 -2
- package/dist/lib/browser/StackMain-XB2KQL47.mjs.map +0 -7
- package/dist/lib/browser/chunk-IRTROCUQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-MS4QSWEZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-DEADYQ54.mjs.map +0 -7
- package/dist/lib/node-esm/StackMain-BXSBDAF5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5FDDKAPB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LRAZXJ65.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-VDFOPDUT.mjs.map +0 -7
- package/dist/types/src/components/StackMain.d.ts +0 -9
- package/dist/types/src/components/StackMain.d.ts.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UIKFKRFJ.mjs";
|
|
4
4
|
|
|
5
|
-
// src/components/
|
|
5
|
+
// src/components/StackContainer.tsx
|
|
6
6
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import
|
|
7
|
+
import * as Option from "effect/Option";
|
|
8
8
|
import React3, { useCallback, useState as useState2 } from "react";
|
|
9
9
|
import { Capabilities, LayoutAction, createIntent, useAppGraph, useCapabilities, useIntentDispatcher } from "@dxos/app-framework";
|
|
10
10
|
import { fullyQualifiedId, isLiveObject } from "@dxos/client/echo";
|
|
11
11
|
import { Obj } from "@dxos/echo";
|
|
12
12
|
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
13
|
-
import {
|
|
13
|
+
import { Toolbar, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
14
14
|
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
15
|
-
import { Stack } from "@dxos/react-ui-stack";
|
|
15
|
+
import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
16
16
|
import { isNonNullable } from "@dxos/util";
|
|
17
17
|
|
|
18
18
|
// src/components/StackContext.tsx
|
|
@@ -179,8 +179,8 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
// src/components/
|
|
183
|
-
var
|
|
182
|
+
// src/components/StackContainer.tsx
|
|
183
|
+
var StackContainer = ({ id, collection }) => {
|
|
184
184
|
var _effect = _useSignals3();
|
|
185
185
|
try {
|
|
186
186
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -259,7 +259,16 @@ var StackMain = ({ id, collection }) => {
|
|
|
259
259
|
collection,
|
|
260
260
|
dispatch
|
|
261
261
|
]);
|
|
262
|
-
return /* @__PURE__ */ React3.createElement(
|
|
262
|
+
return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
|
|
263
|
+
toolbar: true,
|
|
264
|
+
classNames: "container-max-width overflow-hidden border-l border-r border-subduedSeparator"
|
|
265
|
+
}, /* @__PURE__ */ React3.createElement(Toolbar.Root, null, /* @__PURE__ */ React3.createElement(Toolbar.IconButton, {
|
|
266
|
+
icon: "ph--plus--regular",
|
|
267
|
+
iconOnly: true,
|
|
268
|
+
label: "Add section",
|
|
269
|
+
"data-testid": "stack.addSection",
|
|
270
|
+
onClick: handleAddSection
|
|
271
|
+
})), /* @__PURE__ */ React3.createElement(AttentionProvider, {
|
|
263
272
|
id
|
|
264
273
|
}, /* @__PURE__ */ React3.createElement(StackContext.Provider, {
|
|
265
274
|
value: {
|
|
@@ -272,28 +281,18 @@ var StackMain = ({ id, collection }) => {
|
|
|
272
281
|
orientation: "vertical",
|
|
273
282
|
size: "intrinsic",
|
|
274
283
|
id,
|
|
275
|
-
"data-testid": "main.stack"
|
|
284
|
+
"data-testid": "main.stack",
|
|
285
|
+
classNames: "overflow-y-auto"
|
|
276
286
|
}, items.map((item) => /* @__PURE__ */ React3.createElement(StackSection, {
|
|
277
287
|
key: item.id,
|
|
278
288
|
...item
|
|
279
|
-
})))
|
|
280
|
-
role: "none",
|
|
281
|
-
className: "flex mlb-2 pli-2 justify-center"
|
|
282
|
-
}, /* @__PURE__ */ React3.createElement(Button, {
|
|
283
|
-
"data-testid": "stack.createSection",
|
|
284
|
-
classNames: "gap-2",
|
|
285
|
-
onClick: handleAddSection
|
|
286
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
287
|
-
icon: "ph--plus"
|
|
288
|
-
}), /* @__PURE__ */ React3.createElement("span", {
|
|
289
|
-
className: "sr-only"
|
|
290
|
-
}, t("add section label"))))));
|
|
289
|
+
}))))));
|
|
291
290
|
} finally {
|
|
292
291
|
_effect.f();
|
|
293
292
|
}
|
|
294
293
|
};
|
|
295
|
-
var
|
|
294
|
+
var StackContainer_default = StackContainer;
|
|
296
295
|
export {
|
|
297
|
-
|
|
296
|
+
StackContainer_default as default
|
|
298
297
|
};
|
|
299
|
-
//# sourceMappingURL=
|
|
298
|
+
//# sourceMappingURL=StackContainer-HXD7C5GX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport {\n Capabilities,\n LayoutAction,\n createIntent,\n useAppGraph,\n useCapabilities,\n useIntentDispatcher,\n} from '@dxos/app-framework';\nimport { fullyQualifiedId, isLiveObject } from '@dxos/client/echo';\nimport { Obj } from '@dxos/echo';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { Stack, StackItem } from '@dxos/react-ui-stack';\nimport { type DataType } from '@dxos/schema';\nimport { isNonNullable } from '@dxos/util';\n\nimport { meta } from '../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../types';\n\nimport { StackContext } from './StackContext';\nimport { StackSection } from './StackSection';\n\ntype StackContainerProps = {\n id: string;\n collection: DataType.Collection;\n};\n\nconst StackContainer = ({ id, collection }: StackContainerProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const allMetadata = useCapabilities(Capabilities.Metadata);\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n // TODO(wittjosiah): Re-implement stack views with relations.\n // const defaultStack = useMemo(() => Obj.make(StackViewType, { sections: {} }), [collection]);\n // const stack = (collection.views[StackViewType.typename]?.target as StackViewType | undefined) ?? defaultStack;\n // useEffect(() => {\n // if (!collection.views[StackViewType.typename]) {\n // collection.views[StackViewType.typename] = Ref.make(stack);\n // }\n // }, [collection, stack]);\n\n const items =\n collection.objects\n // TODO(wittjosiah): Should the database handle this differently?\n // TODO(wittjosiah): Render placeholders for missing objects so they can be removed from the stack?\n .map((object) => object.target)\n .filter(isNonNullable)\n .map((object) => {\n const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? 'never'))\n ?.metadata as StackSectionMetadata;\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[fullyQualifiedId(object)],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(graph.getNode(fullyQualifiedId(object)).pipe(Option.getOrNull)?.properties.label, t),\n } as StackSectionView;\n return { id: fullyQualifiedId(object), object, metadata, view } satisfies StackSectionItem;\n }) ?? [];\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(isNonNullable)\n .findIndex((section) => fullyQualifiedId(section) === id);\n const object = collection.objects[index].target;\n if (isLiveObject(object)) {\n await dispatch(createIntent(SpaceAction.RemoveObjects, { objects: [object], target: collection }));\n\n // TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.\n // delete stack.sections[Path.last(path)];\n }\n },\n [collection, dispatch],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n await dispatch?.(\n // TODO(wittjosiah): Use object creation dialog.\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: `${meta.id}/AddSectionDialog`,\n options: {\n blockAlign: 'start',\n props: {\n path: id,\n position,\n collection,\n },\n },\n }),\n );\n },\n [collection, dispatch],\n );\n\n const handleNavigate = useCallback(\n async (id: string) => {\n await dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [id] }));\n },\n [dispatch],\n );\n\n const handleCollapse = useCallback(\n (id: string, collapsed: boolean) => setCollapsedSections((prev) => ({ ...prev, [id]: collapsed })),\n [],\n );\n\n const handleAddSection = useCallback(\n () => dispatch?.(createIntent(SpaceAction.OpenCreateObject, { target: collection, navigable: false })),\n [collection, dispatch],\n );\n\n return (\n <StackItem.Content\n toolbar\n classNames='container-max-width overflow-hidden border-l border-r border-subduedSeparator'\n >\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--plus--regular'\n iconOnly\n label='Add section'\n data-testid='stack.addSection'\n onClick={handleAddSection}\n />\n </Toolbar.Root>\n <AttentionProvider id={id}>\n <StackContext.Provider\n value={{\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack' classNames='overflow-y-auto'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </AttentionProvider>\n </StackItem.Content>\n );\n};\n\nexport default StackContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type AddSectionPosition } from '../types';\n\nexport type StackContextValue = {\n onCollapse: (id: string, collapsed: boolean) => void;\n onNavigate: (id: string) => Promise<void>;\n onDelete: (id: string) => Promise<void>;\n onAdd: (id: string, position: AddSectionPosition) => void;\n};\n\nexport const StackContext = createContext<StackContextValue>({\n onCollapse: () => {},\n onNavigate: async () => {},\n onDelete: async () => {},\n onAdd: () => {},\n});\n\nexport const useStack = () => useContext(StackContext);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport React, { useMemo, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { getSize, mx, textBlockWidth } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\nimport { type StackSectionItem } from '../types';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from './StackContext';\n\nconst sectionActionDimensions = 'p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min';\n\nexport type StackSectionProps = StackSectionItem;\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionProps) => {\n const { t } = useTranslation(meta.id);\n const { onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attentionAttrs = useAttentionAttributes(id);\n const stackItem = useMemo(() => ({ id }), [id]);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>\n <StackItem.Heading classNames='attention-surface'>\n <span className='sr-only'>{view.title}</span>\n <StackItem.HeadingStickyContent>\n <DropdownMenu.Root\n {...{\n open: optionsMenuOpen,\n onOpenChange: setOptionsMenuOpen,\n }}\n >\n <DropdownMenu.Trigger asChild>\n <StackItem.SigilButton>\n <Icon icon={icon} size={5} classNames='transition-opacity' />\n </StackItem.SigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {view.collapsed ? (\n <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>\n <Icon icon='ph--arrow-right--regular' size={5} />\n <span className='mis-2 grow'>{t('navigate to section label')}</span>\n </DropdownMenu.Item>\n ) : (\n <CollapsiblePrimitive.Trigger asChild>\n <DropdownMenu.Item>\n <CaretDownUp className={getSize(5)} />\n <span className='mis-2 grow'>{t('collapse label')}</span>\n </DropdownMenu.Item>\n </CollapsiblePrimitive.Trigger>\n )}\n <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>\n <Icon icon='ph--arrow-line-up--regular' size={5} />\n <span className='mis-2 grow'>{t('add section before label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>\n <Icon icon='ph--arrow-line-down--regular' size={5} />\n <span className='mis-2 grow'>{t('add section after label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' size={5} />\n <span className='mis-2 grow'>{t('remove section label')}</span>\n </DropdownMenu.Item>\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n {view.collapsed ? (\n <CollapsiblePrimitive.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n label={t('expand label')}\n icon='ph--caret-up-down--regular'\n classNames={sectionActionDimensions}\n />\n </CollapsiblePrimitive.Trigger>\n ) : (\n <IconButton\n iconOnly\n variant='ghost'\n onClick={() => onNavigate(id)}\n label={t('navigate to section label')}\n icon='ph--arrow-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface role='section' data={{ subject: object }} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content classNames='attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium', textBlockWidth)}>{view.title}</h2>\n </StackItem.Content>\n )}\n </StackItem.Root>\n </CollapsiblePrimitive.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef } from 'react';\n\nexport const CaretDownUp = ({ children, ...props }: ComponentPropsWithoutRef<'svg'>) => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' {...props}>\n <rect width='256' height='256' fill='none' />\n <polyline\n points='80 224 128 176 176 224'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n <polyline\n points='80 32 128 80 176 32'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n {children}\n </svg>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,UAASC,aAAaC,YAAAA,iBAAgB;AAE7C,SACEC,cACAC,cACAC,cACAC,aACAC,iBACAC,2BACK;AACP,SAASC,kBAAkBC,oBAAoB;AAC/C,SAASC,WAAW;AACpB,SAASC,mBAAmB;AAC5B,SAASC,SAASC,mBAAmBC,kBAAAA,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;MAAYE;KAAS;AAGxB,WACE,gBAAA8D,OAAA,cAACC,WAAUC,SAAO;MAChBC,SAAAA;MACAC,YAAW;OAEX,gBAAAJ,OAAA,cAACK,QAAQC,MAAI,MACX,gBAAAN,OAAA,cAACK,QAAQE,YAAU;MACjBC,MAAK;MACLC,UAAAA;MACApC,OAAM;MACNqC,eAAY;MACZC,SAASd;SAGb,gBAAAG,OAAA,cAACY,mBAAAA;MAAkB7E;OACjB,gBAAAiE,OAAA,cAACa,aAAaC,UAAQ;MACpBC,OAAO;QACLC,YAAYrB;QACZsB,YAAYxB;QACZyB,UAAU5C;QACV6C,OAAOpC;MACT;OAEA,gBAAAiB,OAAA,cAACoB,OAAAA;MAAMC,aAAY;MAAWC,MAAK;MAAYvF;MAAQ2E,eAAY;MAAaN,YAAW;OACxFpD,MAAME,IAAI,CAACqE,SACV,gBAAAvB,OAAA,cAACwB,cAAAA;MAAaC,KAAKF,KAAKxF;MAAK,GAAGwF;;;;;AAO9C;AAEA,IAAA,yBAAezF;",
|
|
6
|
+
"names": ["Option", "React", "useCallback", "useState", "Capabilities", "LayoutAction", "createIntent", "useAppGraph", "useCapabilities", "useIntentDispatcher", "fullyQualifiedId", "isLiveObject", "Obj", "SpaceAction", "Toolbar", "toLocalizedString", "useTranslation", "AttentionProvider", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "textBlockWidth", "React", "CaretDownUp", "children", "props", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "meta", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "React", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "Heading", "classNames", "span", "className", "title", "HeadingStickyContent", "DropdownMenu", "Trigger", "SigilButton", "Icon", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "data", "subject", "limit", "placeholder", "h2", "mx", "textBlockWidth", "StackContainer", "id", "collection", "dispatchPromise", "dispatch", "useIntentDispatcher", "graph", "useAppGraph", "t", "useTranslation", "meta", "allMetadata", "useCapabilities", "Capabilities", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "items", "objects", "map", "object", "target", "filter", "isNonNullable", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "fullyQualifiedId", "title", "toLocalizedString", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "findIndex", "section", "isLiveObject", "createIntent", "SpaceAction", "RemoveObjects", "handleAdd", "position", "LayoutAction", "UpdateDialog", "part", "subject", "options", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "iconOnly", "data-testid", "onClick", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/types/stack.ts
|
|
2
|
-
import
|
|
3
|
-
import { TypedObject } from "@dxos/echo
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { TypedObject } from "@dxos/echo/internal";
|
|
4
4
|
var SectionSchema = Schema.Struct({
|
|
5
5
|
height: Schema.optional(Schema.Number),
|
|
6
6
|
// Space for data that isn't stack-specific but is specific to this view instance.
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
SectionSchema,
|
|
26
26
|
StackViewType
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
28
|
+
//# sourceMappingURL=chunk-NHMDZYOB.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/stack.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { TypedObject } from '@dxos/echo/internal';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport class StackViewType extends TypedObject({\n typename: 'dxos.org/type/StackView',\n version: '0.1.0',\n})({\n sections: Schema.mutable(Schema.Record({ key: Schema.String, value: SectionSchema })),\n}) {}\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,mBAAmB;AAOrB,IAAMC,gBAAuBC,cAAO;EACzCC,QAAeC,gBAAgBC,aAAM;;;EAGrCC,QAAeF,gBAAgBG,cAAO;IAAEC,KAAYC;IAAQC,OAAcC;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAN,cAA4BC,YAAY;EAC7CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,UAAiBC,eAAeV,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA,CAAA;AACpF,CAAA,EAAA;AAAI;",
|
|
6
|
+
"names": ["Schema", "TypedObject", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "TypedObject", "typename", "version", "sections", "mutable"]
|
|
7
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// src/meta.ts
|
|
2
|
+
import { trim } from "@dxos/util";
|
|
2
3
|
var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
|
|
3
4
|
var meta = {
|
|
4
5
|
id: "dxos.org/plugin/stack",
|
|
5
6
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
6
7
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
7
8
|
name: "Collections",
|
|
8
|
-
description:
|
|
9
|
+
description: trim`
|
|
10
|
+
Organize and view curated collections of workspace objects in customizable layouts.
|
|
11
|
+
Group related items together and manage collections with sections and filtering.
|
|
12
|
+
`,
|
|
9
13
|
icon: "ph--stack-simple--regular",
|
|
10
14
|
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
|
|
11
15
|
};
|
|
@@ -14,4 +18,4 @@ export {
|
|
|
14
18
|
SECTION_IDENTIFIER,
|
|
15
19
|
meta
|
|
16
20
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-UIKFKRFJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/stack',\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.\n name: 'Collections',\n description: trim`\n Organize and view curated collections of workspace objects in customizable layouts.\n Group related items together and manage collections with sections and filtering.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,qBAAqB;AAE3B,IAAMC,OAAmB;EAC9BC,IAAI;;;EAGJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "trim", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StackViewType
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NHMDZYOB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SECTION_IDENTIFIER,
|
|
6
6
|
meta
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UIKFKRFJ.mjs";
|
|
8
8
|
|
|
9
9
|
// src/StackPlugin.ts
|
|
10
10
|
import { Capabilities, Events, contributes, defineModule, definePlugin } from "@dxos/app-framework";
|
|
@@ -12,7 +12,7 @@ import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
|
12
12
|
|
|
13
13
|
// src/capabilities/index.ts
|
|
14
14
|
import { lazy } from "@dxos/app-framework";
|
|
15
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
15
|
+
var ReactSurface = lazy(() => import("./react-surface-IV2S35VD.mjs"));
|
|
16
16
|
|
|
17
17
|
// src/translations.ts
|
|
18
18
|
import { translations as stackTranslations } from "@dxos/react-ui-stack";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":2047,"imports":[],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3545,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/StackContext.tsx":{"bytes":1834,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/CaretDownUp.tsx":{"bytes":3228,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection.tsx":{"bytes":17860,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackMain.tsx":{"bytes":19077,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/index.ts":{"bytes":824,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"src/components/StackMain.tsx","kind":"dynamic-import","original":"./StackMain"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":4516,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":778,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":4437,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/types/stack.ts":{"bytes":3625,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":499,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":6689,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":547,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5372},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-IRTROCUQ.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-MS4QSWEZ.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-DEADYQ54.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","StackPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/StackPlugin.ts":{"bytesInOutput":1394},"src/capabilities/index.ts":{"bytesInOutput":115},"src/translations.ts":{"bytesInOutput":1268}},"bytes":3093},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-IRTROCUQ.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-IRTROCUQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1752},"dist/lib/browser/chunk-IRTROCUQ.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"src/types/stack.ts":{"bytesInOutput":595},"src/types/index.ts":{"bytesInOutput":0}},"bytes":707},"dist/lib/browser/StackMain-XB2KQL47.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21510},"dist/lib/browser/StackMain-XB2KQL47.mjs":{"imports":[{"path":"dist/lib/browser/chunk-MS4QSWEZ.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/StackMain.tsx","inputs":{"src/components/StackMain.tsx":{"bytesInOutput":4469},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/StackSection.tsx":{"bytesInOutput":5406},"src/components/CaretDownUp.tsx":{"bytesInOutput":972}},"bytes":11459},"dist/lib/browser/react-surface-DEADYQ54.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3734},"dist/lib/browser/react-surface-DEADYQ54.mjs":{"imports":[{"path":"dist/lib/browser/chunk-MS4QSWEZ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackMain-XB2KQL47.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":858},"src/components/index.ts":{"bytesInOutput":94},"src/components/StackSettings.tsx":{"bytesInOutput":263}},"bytes":1532},"dist/lib/browser/chunk-MS4QSWEZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":957},"dist/lib/browser/chunk-MS4QSWEZ.mjs":{"imports":[],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":524}},"bytes":625}}}
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":2526,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3545,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/StackContext.tsx":{"bytes":1834,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/CaretDownUp.tsx":{"bytes":3228,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection.tsx":{"bytes":17860,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackContainer.tsx":{"bytes":19493,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/index.ts":{"bytes":858,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"src/components/StackContainer.tsx","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":4020,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":778,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":4437,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/types/stack.ts":{"bytes":3643,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":499,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":6689,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":547,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5372},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NHMDZYOB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UIKFKRFJ.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-IV2S35VD.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","StackPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/StackPlugin.ts":{"bytesInOutput":1394},"src/capabilities/index.ts":{"bytesInOutput":115},"src/translations.ts":{"bytesInOutput":1268}},"bytes":3093},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NHMDZYOB.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-NHMDZYOB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1695},"dist/lib/browser/chunk-NHMDZYOB.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"src/types/stack.ts":{"bytesInOutput":605},"src/types/index.ts":{"bytesInOutput":0}},"bytes":717},"dist/lib/browser/StackContainer-HXD7C5GX.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21698},"dist/lib/browser/StackContainer-HXD7C5GX.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UIKFKRFJ.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/StackContainer.tsx","inputs":{"src/components/StackContainer.tsx":{"bytesInOutput":4541},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/StackSection.tsx":{"bytesInOutput":5406},"src/components/CaretDownUp.tsx":{"bytesInOutput":972}},"bytes":11551},"dist/lib/browser/react-surface-IV2S35VD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3516},"dist/lib/browser/react-surface-IV2S35VD.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UIKFKRFJ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-HXD7C5GX.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":706},"src/components/index.ts":{"bytesInOutput":104},"src/components/StackSettings.tsx":{"bytesInOutput":263}},"bytes":1390},"dist/lib/browser/chunk-UIKFKRFJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1168},"dist/lib/browser/chunk-UIKFKRFJ.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":695}},"bytes":796}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UIKFKRFJ.mjs";
|
|
4
4
|
|
|
5
5
|
// src/capabilities/react-surface.tsx
|
|
6
6
|
import React2 from "react";
|
|
@@ -19,7 +19,7 @@ import { Input, useTranslation } from "@dxos/react-ui";
|
|
|
19
19
|
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
20
20
|
|
|
21
21
|
// src/components/index.ts
|
|
22
|
-
var
|
|
22
|
+
var StackContainer = lazy(() => import("./StackContainer-HXD7C5GX.mjs"));
|
|
23
23
|
|
|
24
24
|
// src/capabilities/react-surface.tsx
|
|
25
25
|
var react_surface_default = (() => contributes(Capabilities.ReactSurface, createSurface({
|
|
@@ -28,19 +28,13 @@ var react_surface_default = (() => contributes(Capabilities.ReactSurface, create
|
|
|
28
28
|
filter: (data) => Obj.instanceOf(DataType.Collection, data.subject),
|
|
29
29
|
component: ({ data }) => {
|
|
30
30
|
const id = typeof data.id === "string" ? data.id : void 0;
|
|
31
|
-
return /* @__PURE__ */ React2.createElement(
|
|
32
|
-
role: "none",
|
|
33
|
-
className: "overflow-auto",
|
|
34
|
-
style: {
|
|
35
|
-
contain: "layout"
|
|
36
|
-
}
|
|
37
|
-
}, /* @__PURE__ */ React2.createElement(StackMain, {
|
|
31
|
+
return /* @__PURE__ */ React2.createElement(StackContainer, {
|
|
38
32
|
id: id ?? fullyQualifiedId(data.subject),
|
|
39
33
|
collection: data.subject
|
|
40
|
-
})
|
|
34
|
+
});
|
|
41
35
|
}
|
|
42
36
|
})));
|
|
43
37
|
export {
|
|
44
38
|
react_surface_default as default
|
|
45
39
|
};
|
|
46
|
-
//# sourceMappingURL=react-surface-
|
|
40
|
+
//# sourceMappingURL=react-surface-IV2S35VD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/index.ts", "../../../src/components/StackSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { StackContainer } from '../components';\nimport { meta } from '../meta';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${meta.id}/article`,\n role: 'article',\n filter: (data): data is { id?: string; subject: DataType.Collection } =>\n Obj.instanceOf(DataType.Collection, data.subject),\n component: ({ data }) => {\n // This allows the id to be overridden by the surface for situations where the id of the collection\n // is not the same as the id of what is being represented (e.g., a space with a root collection).\n const id = typeof data.id === 'string' ? data.id : undefined;\n return <StackContainer id={id ?? fullyQualifiedId(data.subject)} collection={data.subject} />;\n },\n }),\n );\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const StackContainer = lazy(() => import('./StackContainer'));\n\nexport * from './StackSettings';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\nimport { type StackSettingsProps } from '../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <ControlPage>\n <ControlSection title={t('settings title', { ns: meta.id })}>\n <ControlGroup>\n <ControlItemInput title={t('settings separation label')}>\n <Input.Switch\n checked={settings.separation}\n onCheckedChange={(checked) => (settings.separation = !!checked)}\n />\n </ControlItemInput>\n </ControlGroup>\n </ControlSection>\n </ControlPage>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,cAAcC,aAAaC,qBAAqB;AACzD,SAASC,WAAW;AACpB,SAASC,wBAAwB;AACjC,SAASC,gBAAgB;;;ACLzB,SAASC,YAAY;;;;ACArB,OAAOC,WAAW;AAElB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,cAAcC,kBAAkBC,aAAaC,sBAAsB;;;ADDrE,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,+BAAA,CAAA;;;ADQhD,IAAA,yBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;EACNC,QAAQ,CAACC,SACPC,IAAIC,WAAWC,SAASC,YAAYJ,KAAKK,OAAO;EAClDC,WAAW,CAAC,EAAEN,KAAI,MAAE;AAGlB,UAAMJ,KAAK,OAAOI,KAAKJ,OAAO,WAAWI,KAAKJ,KAAKW;AACnD,WAAO,gBAAAC,OAAA,cAACC,gBAAAA;MAAeb,IAAIA,MAAMc,iBAAiBV,KAAKK,OAAO;MAAGM,YAAYX,KAAKK;;EACpF;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "fullyQualifiedId", "DataType", "lazy", "React", "Input", "useTranslation", "ControlGroup", "ControlItemInput", "ControlPage", "ControlSection", "StackContainer", "lazy", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "DataType", "Collection", "subject", "component", "undefined", "React", "StackContainer", "fullyQualifiedId", "collection"]
|
|
7
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
meta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BGVQYUYP.mjs";
|
|
5
5
|
|
|
6
|
-
// src/components/
|
|
6
|
+
// src/components/StackContainer.tsx
|
|
7
7
|
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
8
|
-
import
|
|
8
|
+
import * as Option from "effect/Option";
|
|
9
9
|
import React3, { useCallback, useState as useState2 } from "react";
|
|
10
10
|
import { Capabilities, LayoutAction, createIntent, useAppGraph, useCapabilities, useIntentDispatcher } from "@dxos/app-framework";
|
|
11
11
|
import { fullyQualifiedId, isLiveObject } from "@dxos/client/echo";
|
|
12
12
|
import { Obj } from "@dxos/echo";
|
|
13
13
|
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
14
|
-
import {
|
|
14
|
+
import { Toolbar, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
15
15
|
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
16
|
-
import { Stack } from "@dxos/react-ui-stack";
|
|
16
|
+
import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
17
17
|
import { isNonNullable } from "@dxos/util";
|
|
18
18
|
|
|
19
19
|
// src/components/StackContext.tsx
|
|
@@ -180,8 +180,8 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
// src/components/
|
|
184
|
-
var
|
|
183
|
+
// src/components/StackContainer.tsx
|
|
184
|
+
var StackContainer = ({ id, collection }) => {
|
|
185
185
|
var _effect = _useSignals3();
|
|
186
186
|
try {
|
|
187
187
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
@@ -260,7 +260,16 @@ var StackMain = ({ id, collection }) => {
|
|
|
260
260
|
collection,
|
|
261
261
|
dispatch
|
|
262
262
|
]);
|
|
263
|
-
return /* @__PURE__ */ React3.createElement(
|
|
263
|
+
return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
|
|
264
|
+
toolbar: true,
|
|
265
|
+
classNames: "container-max-width overflow-hidden border-l border-r border-subduedSeparator"
|
|
266
|
+
}, /* @__PURE__ */ React3.createElement(Toolbar.Root, null, /* @__PURE__ */ React3.createElement(Toolbar.IconButton, {
|
|
267
|
+
icon: "ph--plus--regular",
|
|
268
|
+
iconOnly: true,
|
|
269
|
+
label: "Add section",
|
|
270
|
+
"data-testid": "stack.addSection",
|
|
271
|
+
onClick: handleAddSection
|
|
272
|
+
})), /* @__PURE__ */ React3.createElement(AttentionProvider, {
|
|
264
273
|
id
|
|
265
274
|
}, /* @__PURE__ */ React3.createElement(StackContext.Provider, {
|
|
266
275
|
value: {
|
|
@@ -273,28 +282,18 @@ var StackMain = ({ id, collection }) => {
|
|
|
273
282
|
orientation: "vertical",
|
|
274
283
|
size: "intrinsic",
|
|
275
284
|
id,
|
|
276
|
-
"data-testid": "main.stack"
|
|
285
|
+
"data-testid": "main.stack",
|
|
286
|
+
classNames: "overflow-y-auto"
|
|
277
287
|
}, items.map((item) => /* @__PURE__ */ React3.createElement(StackSection, {
|
|
278
288
|
key: item.id,
|
|
279
289
|
...item
|
|
280
|
-
})))
|
|
281
|
-
role: "none",
|
|
282
|
-
className: "flex mlb-2 pli-2 justify-center"
|
|
283
|
-
}, /* @__PURE__ */ React3.createElement(Button, {
|
|
284
|
-
"data-testid": "stack.createSection",
|
|
285
|
-
classNames: "gap-2",
|
|
286
|
-
onClick: handleAddSection
|
|
287
|
-
}, /* @__PURE__ */ React3.createElement(Icon2, {
|
|
288
|
-
icon: "ph--plus"
|
|
289
|
-
}), /* @__PURE__ */ React3.createElement("span", {
|
|
290
|
-
className: "sr-only"
|
|
291
|
-
}, t("add section label"))))));
|
|
290
|
+
}))))));
|
|
292
291
|
} finally {
|
|
293
292
|
_effect.f();
|
|
294
293
|
}
|
|
295
294
|
};
|
|
296
|
-
var
|
|
295
|
+
var StackContainer_default = StackContainer;
|
|
297
296
|
export {
|
|
298
|
-
|
|
297
|
+
StackContainer_default as default
|
|
299
298
|
};
|
|
300
|
-
//# sourceMappingURL=
|
|
299
|
+
//# sourceMappingURL=StackContainer-OTSCVZKK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport {\n Capabilities,\n LayoutAction,\n createIntent,\n useAppGraph,\n useCapabilities,\n useIntentDispatcher,\n} from '@dxos/app-framework';\nimport { fullyQualifiedId, isLiveObject } from '@dxos/client/echo';\nimport { Obj } from '@dxos/echo';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { Stack, StackItem } from '@dxos/react-ui-stack';\nimport { type DataType } from '@dxos/schema';\nimport { isNonNullable } from '@dxos/util';\n\nimport { meta } from '../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../types';\n\nimport { StackContext } from './StackContext';\nimport { StackSection } from './StackSection';\n\ntype StackContainerProps = {\n id: string;\n collection: DataType.Collection;\n};\n\nconst StackContainer = ({ id, collection }: StackContainerProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const allMetadata = useCapabilities(Capabilities.Metadata);\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n // TODO(wittjosiah): Re-implement stack views with relations.\n // const defaultStack = useMemo(() => Obj.make(StackViewType, { sections: {} }), [collection]);\n // const stack = (collection.views[StackViewType.typename]?.target as StackViewType | undefined) ?? defaultStack;\n // useEffect(() => {\n // if (!collection.views[StackViewType.typename]) {\n // collection.views[StackViewType.typename] = Ref.make(stack);\n // }\n // }, [collection, stack]);\n\n const items =\n collection.objects\n // TODO(wittjosiah): Should the database handle this differently?\n // TODO(wittjosiah): Render placeholders for missing objects so they can be removed from the stack?\n .map((object) => object.target)\n .filter(isNonNullable)\n .map((object) => {\n const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? 'never'))\n ?.metadata as StackSectionMetadata;\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[fullyQualifiedId(object)],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(graph.getNode(fullyQualifiedId(object)).pipe(Option.getOrNull)?.properties.label, t),\n } as StackSectionView;\n return { id: fullyQualifiedId(object), object, metadata, view } satisfies StackSectionItem;\n }) ?? [];\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(isNonNullable)\n .findIndex((section) => fullyQualifiedId(section) === id);\n const object = collection.objects[index].target;\n if (isLiveObject(object)) {\n await dispatch(createIntent(SpaceAction.RemoveObjects, { objects: [object], target: collection }));\n\n // TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.\n // delete stack.sections[Path.last(path)];\n }\n },\n [collection, dispatch],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n await dispatch?.(\n // TODO(wittjosiah): Use object creation dialog.\n createIntent(LayoutAction.UpdateDialog, {\n part: 'dialog',\n subject: `${meta.id}/AddSectionDialog`,\n options: {\n blockAlign: 'start',\n props: {\n path: id,\n position,\n collection,\n },\n },\n }),\n );\n },\n [collection, dispatch],\n );\n\n const handleNavigate = useCallback(\n async (id: string) => {\n await dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [id] }));\n },\n [dispatch],\n );\n\n const handleCollapse = useCallback(\n (id: string, collapsed: boolean) => setCollapsedSections((prev) => ({ ...prev, [id]: collapsed })),\n [],\n );\n\n const handleAddSection = useCallback(\n () => dispatch?.(createIntent(SpaceAction.OpenCreateObject, { target: collection, navigable: false })),\n [collection, dispatch],\n );\n\n return (\n <StackItem.Content\n toolbar\n classNames='container-max-width overflow-hidden border-l border-r border-subduedSeparator'\n >\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--plus--regular'\n iconOnly\n label='Add section'\n data-testid='stack.addSection'\n onClick={handleAddSection}\n />\n </Toolbar.Root>\n <AttentionProvider id={id}>\n <StackContext.Provider\n value={{\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack' classNames='overflow-y-auto'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </AttentionProvider>\n </StackItem.Content>\n );\n};\n\nexport default StackContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type AddSectionPosition } from '../types';\n\nexport type StackContextValue = {\n onCollapse: (id: string, collapsed: boolean) => void;\n onNavigate: (id: string) => Promise<void>;\n onDelete: (id: string) => Promise<void>;\n onAdd: (id: string, position: AddSectionPosition) => void;\n};\n\nexport const StackContext = createContext<StackContextValue>({\n onCollapse: () => {},\n onNavigate: async () => {},\n onDelete: async () => {},\n onAdd: () => {},\n});\n\nexport const useStack = () => useContext(StackContext);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport React, { useMemo, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { getSize, mx, textBlockWidth } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\nimport { type StackSectionItem } from '../types';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from './StackContext';\n\nconst sectionActionDimensions = 'p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min';\n\nexport type StackSectionProps = StackSectionItem;\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionProps) => {\n const { t } = useTranslation(meta.id);\n const { onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attentionAttrs = useAttentionAttributes(id);\n const stackItem = useMemo(() => ({ id }), [id]);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>\n <StackItem.Heading classNames='attention-surface'>\n <span className='sr-only'>{view.title}</span>\n <StackItem.HeadingStickyContent>\n <DropdownMenu.Root\n {...{\n open: optionsMenuOpen,\n onOpenChange: setOptionsMenuOpen,\n }}\n >\n <DropdownMenu.Trigger asChild>\n <StackItem.SigilButton>\n <Icon icon={icon} size={5} classNames='transition-opacity' />\n </StackItem.SigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {view.collapsed ? (\n <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>\n <Icon icon='ph--arrow-right--regular' size={5} />\n <span className='mis-2 grow'>{t('navigate to section label')}</span>\n </DropdownMenu.Item>\n ) : (\n <CollapsiblePrimitive.Trigger asChild>\n <DropdownMenu.Item>\n <CaretDownUp className={getSize(5)} />\n <span className='mis-2 grow'>{t('collapse label')}</span>\n </DropdownMenu.Item>\n </CollapsiblePrimitive.Trigger>\n )}\n <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>\n <Icon icon='ph--arrow-line-up--regular' size={5} />\n <span className='mis-2 grow'>{t('add section before label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>\n <Icon icon='ph--arrow-line-down--regular' size={5} />\n <span className='mis-2 grow'>{t('add section after label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' size={5} />\n <span className='mis-2 grow'>{t('remove section label')}</span>\n </DropdownMenu.Item>\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n {view.collapsed ? (\n <CollapsiblePrimitive.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n label={t('expand label')}\n icon='ph--caret-up-down--regular'\n classNames={sectionActionDimensions}\n />\n </CollapsiblePrimitive.Trigger>\n ) : (\n <IconButton\n iconOnly\n variant='ghost'\n onClick={() => onNavigate(id)}\n label={t('navigate to section label')}\n icon='ph--arrow-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface role='section' data={{ subject: object }} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content classNames='attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium', textBlockWidth)}>{view.title}</h2>\n </StackItem.Content>\n )}\n </StackItem.Root>\n </CollapsiblePrimitive.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef } from 'react';\n\nexport const CaretDownUp = ({ children, ...props }: ComponentPropsWithoutRef<'svg'>) => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' {...props}>\n <rect width='256' height='256' fill='none' />\n <polyline\n points='80 224 128 176 176 224'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n <polyline\n points='80 32 128 80 176 32'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n {children}\n </svg>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;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AAC8C,UAAU;MAAE,GAAGA;MAAM,CAAC7D,GAAAA,GAAK8B;IAAU,EAAA,GAC/F,CAAA,CAAE;AAGJ,UAAMgC,mBAAmBtB,YACvB,MAAMrC,WAAW0C,aAAaC,YAAYiB,kBAAkB;MAAE1C,QAAQpB;MAAY+D,WAAW;IAAM,CAAA,CAAA,GACnG;MAAC/D;MAAYE;KAAS;AAGxB,WACE,gBAAA8D,OAAA,cAACC,WAAUC,SAAO;MAChBC,SAAAA;MACAC,YAAW;OAEX,gBAAAJ,OAAA,cAACK,QAAQC,MAAI,MACX,gBAAAN,OAAA,cAACK,QAAQE,YAAU;MACjBC,MAAK;MACLC,UAAAA;MACApC,OAAM;MACNqC,eAAY;MACZC,SAASd;SAGb,gBAAAG,OAAA,cAACY,mBAAAA;MAAkB7E;OACjB,gBAAAiE,OAAA,cAACa,aAAaC,UAAQ;MACpBC,OAAO;QACLC,YAAYrB;QACZsB,YAAYxB;QACZyB,UAAU5C;QACV6C,OAAOpC;MACT;OAEA,gBAAAiB,OAAA,cAACoB,OAAAA;MAAMC,aAAY;MAAWC,MAAK;MAAYvF;MAAQ2E,eAAY;MAAaN,YAAW;OACxFpD,MAAME,IAAI,CAACqE,SACV,gBAAAvB,OAAA,cAACwB,cAAAA;MAAaC,KAAKF,KAAKxF;MAAK,GAAGwF;;;;;AAO9C;AAEA,IAAA,yBAAezF;",
|
|
6
|
+
"names": ["Option", "React", "useCallback", "useState", "Capabilities", "LayoutAction", "createIntent", "useAppGraph", "useCapabilities", "useIntentDispatcher", "fullyQualifiedId", "isLiveObject", "Obj", "SpaceAction", "Toolbar", "toLocalizedString", "useTranslation", "AttentionProvider", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "textBlockWidth", "React", "CaretDownUp", "children", "props", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "meta", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "React", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "Heading", "classNames", "span", "className", "title", "HeadingStickyContent", "DropdownMenu", "Trigger", "SigilButton", "Icon", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "data", "subject", "limit", "placeholder", "h2", "mx", "textBlockWidth", "StackContainer", "id", "collection", "dispatchPromise", "dispatch", "useIntentDispatcher", "graph", "useAppGraph", "t", "useTranslation", "meta", "allMetadata", "useCapabilities", "Capabilities", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "items", "objects", "map", "object", "target", "filter", "isNonNullable", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "fullyQualifiedId", "title", "toLocalizedString", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "findIndex", "section", "isLiveObject", "createIntent", "SpaceAction", "RemoveObjects", "handleAdd", "position", "LayoutAction", "UpdateDialog", "part", "subject", "options", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "iconOnly", "data-testid", "onClick", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key"]
|
|
7
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/meta.ts
|
|
4
|
+
import { trim } from "@dxos/util";
|
|
4
5
|
var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
|
|
5
6
|
var meta = {
|
|
6
7
|
id: "dxos.org/plugin/stack",
|
|
7
8
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
8
9
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
9
10
|
name: "Collections",
|
|
10
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Organize and view curated collections of workspace objects in customizable layouts.
|
|
13
|
+
Group related items together and manage collections with sections and filtering.
|
|
14
|
+
`,
|
|
11
15
|
icon: "ph--stack-simple--regular",
|
|
12
16
|
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
|
|
13
17
|
};
|
|
@@ -16,4 +20,4 @@ export {
|
|
|
16
20
|
SECTION_IDENTIFIER,
|
|
17
21
|
meta
|
|
18
22
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-BGVQYUYP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/stack',\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.\n name: 'Collections',\n description: trim`\n Organize and view curated collections of workspace objects in customizable layouts.\n Group related items together and manage collections with sections and filtering.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,qBAAqB;AAE3B,IAAMC,OAAmB;EAC9BC,IAAI;;;EAGJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "trim", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/types/stack.ts
|
|
4
|
-
import
|
|
5
|
-
import { TypedObject } from "@dxos/echo
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { TypedObject } from "@dxos/echo/internal";
|
|
6
6
|
var SectionSchema = Schema.Struct({
|
|
7
7
|
height: Schema.optional(Schema.Number),
|
|
8
8
|
// Space for data that isn't stack-specific but is specific to this view instance.
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
SectionSchema,
|
|
28
28
|
StackViewType
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-ZZFA7HIV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/stack.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { TypedObject } from '@dxos/echo/internal';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport class StackViewType extends TypedObject({\n typename: 'dxos.org/type/StackView',\n version: '0.1.0',\n})({\n sections: Schema.mutable(Schema.Record({ key: Schema.String, value: SectionSchema })),\n}) {}\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,mBAAmB;AAOrB,IAAMC,gBAAuBC,cAAO;EACzCC,QAAeC,gBAAgBC,aAAM;;;EAGrCC,QAAeF,gBAAgBG,cAAO;IAAEC,KAAYC;IAAQC,OAAcC;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAN,cAA4BC,YAAY;EAC7CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,UAAiBC,eAAeV,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA,CAAA;AACpF,CAAA,EAAA;AAAI;",
|
|
6
|
+
"names": ["Schema", "TypedObject", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "TypedObject", "typename", "version", "sections", "mutable"]
|
|
7
|
+
}
|