@dxos/plugin-stack 0.11.1 → 0.12.0-next-bbabc02363f18d7643ea4160e3a7a7809870fd0d

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.
Files changed (50) hide show
  1. package/dist/lib/Stack.mjs +10 -0
  2. package/dist/lib/Stack.mjs.map +1 -0
  3. package/dist/lib/StackEvents.mjs +15 -0
  4. package/dist/lib/StackEvents.mjs.map +1 -0
  5. package/dist/lib/StackPlugin.mjs +6 -6
  6. package/dist/lib/StackPlugin.mjs.map +1 -1
  7. package/dist/lib/capabilities.mjs +2 -2
  8. package/dist/lib/capabilities.mjs.map +1 -1
  9. package/dist/lib/chunk-meta.mjs +1 -1
  10. package/dist/lib/chunk-meta.mjs.map +1 -1
  11. package/dist/lib/chunk-react-surface.mjs +3 -2
  12. package/dist/lib/chunk-react-surface.mjs.map +1 -1
  13. package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
  14. package/dist/lib/components.mjs +1 -1
  15. package/dist/lib/components.mjs.map +1 -1
  16. package/dist/lib/index.mjs +3 -2
  17. package/dist/lib/plugin.mjs +1 -1
  18. package/dist/lib/plugin.mjs.map +1 -1
  19. package/dist/types/src/StackPlugin.d.ts +1 -1
  20. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/index.d.ts +1 -2
  22. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  23. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  24. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  25. package/dist/types/src/components/Stack/Stack.d.ts +1 -0
  26. package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
  27. package/dist/types/src/containers/StackArticle/StackArticle.stories.d.ts.map +1 -1
  28. package/dist/types/src/index.d.ts +2 -1
  29. package/dist/types/src/index.d.ts.map +1 -1
  30. package/dist/types/src/plugin.d.ts +1 -1
  31. package/dist/types/src/plugin.d.ts.map +1 -1
  32. package/dist/types/src/types/StackEvents.d.ts +8 -0
  33. package/dist/types/src/types/StackEvents.d.ts.map +1 -0
  34. package/dist/types/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +46 -37
  36. package/src/StackPlugin.ts +14 -9
  37. package/src/capabilities/index.ts +4 -2
  38. package/src/capabilities/react-surface.ts +3 -2
  39. package/src/components/Stack/Stack.tsx +1 -1
  40. package/src/containers/StackArticle/StackArticle.stories.tsx +7 -8
  41. package/src/index.ts +2 -1
  42. package/src/meta.ts +1 -1
  43. package/src/plugin.ts +1 -1
  44. package/src/types/StackEvents.ts +16 -0
  45. package/dist/lib/chunk-types.mjs +0 -21
  46. package/dist/lib/chunk-types.mjs.map +0 -1
  47. package/dist/lib/types.mjs +0 -2
  48. package/dist/types/src/types/index.d.ts +0 -2
  49. package/dist/types/src/types/index.d.ts.map +0 -1
  50. package/src/types/index.ts +0 -5
@@ -0,0 +1,10 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import * as Schema from "effect/Schema";
3
+ import { DXN, Type } from "@dxos/echo";
4
+ //#region src/types/Stack.ts
5
+ var Stack_exports = /* @__PURE__ */ __exportAll({ Stack: () => Stack });
6
+ var Stack = class extends Type.makeObject(DXN.make("org.dxos.type.stack", "0.1.0"))(Schema.Struct({})) {};
7
+ //#endregion
8
+ export { Stack, Stack_exports as t };
9
+
10
+ //# sourceMappingURL=Stack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stack.mjs","names":[],"sources":["../../src/types/Stack.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Type } from '@dxos/echo';\n\n// TODO(burdon): Placeholder.\nexport class Stack extends Type.makeObject<Stack>(DXN.make('org.dxos.type.stack', '0.1.0'))(Schema.Struct({})) {}\n"],"mappings":";;;;;AAWA,IAAa,QAAb,cAA2B,KAAK,WAAkB,IAAI,KAAK,uBAAuB,OAAO,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import * as ActivationEvent from "@dxos/app-framework/ActivationEvent";
3
+ import { meta } from "#meta";
4
+ //#region src/types/StackEvents.ts
5
+ var StackEvents_exports = /* @__PURE__ */ __exportAll({ Start: () => Start });
6
+ /**
7
+ * The feature's start event: the plugin's start-gated modules (and cross-plugin
8
+ * contributions consumed by this feature) activate here. Fired on demand and by the
9
+ * host's idle trickle.
10
+ */
11
+ var Start = ActivationEvent.pluginStart(meta.profile.key);
12
+ //#endregion
13
+ export { Start, StackEvents_exports as t };
14
+
15
+ //# sourceMappingURL=StackEvents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackEvents.mjs","names":[],"sources":["../../src/types/StackEvents.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as ActivationEvent from '@dxos/app-framework/ActivationEvent';\n\nimport { meta } from '#meta';\n\n/**\n * The feature's start event: the plugin's start-gated modules (and cross-plugin\n * contributions consumed by this feature) activate here. Fired on demand and by the\n * host's idle trickle.\n */\nexport const Start = ActivationEvent.pluginStart(meta.profile.key);\n"],"mappings":";;;;;;;;;;AAeA,IAAa,QAAQ,gBAAgB,YAAY,KAAK,QAAQ,GAAG"}
@@ -1,17 +1,17 @@
1
- import { Plugin } from "@dxos/app-framework";
2
- import { AppPlugin } from "@dxos/app-toolkit";
3
- import { ReactSurface } from "#capabilities";
1
+ import { Stack } from "./Stack.mjs";
2
+ import * as Plugin from "@dxos/app-framework/Plugin";
4
3
  import { meta } from "#meta";
4
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
5
+ import { ReactSurface } from "#capabilities";
5
6
  import { translations } from "#translations";
6
- import { Stack } from "#types";
7
7
  //#endregion
8
8
  //#region src/StackPlugin.ts
9
- var StackPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({ schema: [Stack.Stack] }), AppPlugin.addSurfaceModule({ activate: ReactSurface }), AppPlugin.addTranslationsModule({ translations }), AppPlugin.addPluginAssetModule({ asset: {
9
+ var StackPlugin = Plugin.define(meta).pipe(Plugin.addModule(AppCapability.schema([Stack])), Plugin.addModule(ReactSurface), Plugin.addModule(AppCapability.translations(translations)), Plugin.addModule(AppCapability.pluginAsset({
10
10
  pluginId: meta.profile.key,
11
11
  path: "PLUGIN.mdl",
12
12
  content: "---\nid: org.dxos.plugin.stack\nname: StackPlugin\nversion: 0.1.0\n---\n\nCollections plugin for `DXOS` Composer — renders any `Collection` object as a vertically scrollable stack of collapsible sections, where each section displays an arbitrary ECHO object via the `section` surface role. Supports adding, removing, navigating, and collapsing individual sections.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype SectionSchema\n fields:\n height?: number # explicit height override for the section\n custom?: Record<string, any> # view-instance-specific data (e.g. cover mode for images)\n```\n\n```mdl\ntype StackViewType\n typename: org.dxos.type.stackView\n version: 0.1.0\n fields:\n sections: Record<string, SectionSchema>\n```\n\n```mdl\ntype StackSectionView\n fields:\n title?: string\n size?: StackItemSize\n height?: number\n collapsed?: boolean\n custom?: Record<string, any>\n```\n\n```mdl\ntype StackSectionMetadata\n fields:\n icon?: string\n placeholder?: Label\n viewActions?: (item: CollectionItem) => StackSectionAction\n```\n\n```mdl\ntype StackSectionItem\n fields:\n id: string # DXN string for the contained object\n object: Obj.Unknown\n view: StackSectionView\n metadata: StackSectionMetadata\n```\n\n```mdl\ntype AddSectionPosition\n literals: before | after | beforeAll | afterAll\n```\n\n```mdl\ntype StackSettingsProps\n fields:\n separation: boolean # whether visual separators are shown between sections\n```\n\n## Components\n\n```mdl\ncomponent StackArticle\n desc: Full-page article view of a Collection — renders items as a vertical stack of StackSection components with a toolbar for adding sections.\n props:\n subject: Collection\n role: AppSurface.Role\n attendableId?: string\n state:\n collapsedSections: Record<string, boolean> # collapsed state by DXN string\n items: StackSectionItem[] # derived from collection objects\n slots:\n (none)\n actions:\n handleAdd(id: string, position: AddSectionPosition)\n handleDelete(id: string)\n handleNavigate(id: string)\n handleCollapse(id: string, collapsed: boolean)\n handleAddSection()\n emits:\n (none)\n layout: |\n ┌──────────────────────────────┐\n │ Toolbar [+ Add Section] │\n ├──────────────────────────────┤\n │ Stack (vertical, intrinsic) │\n │ ┌────────────────────────┐ │\n │ │ StackSection │ │\n │ │ ▾ [icon] Title [→] │ │\n │ │ └─ Surface:section │ │\n │ └────────────────────────┘ │\n │ ┌────────────────────────┐ │\n │ │ StackSection (collapsed│ │\n │ │ ▸ [icon] Title [↕] │ │\n │ └────────────────────────┘ │\n │ … │\n └──────────────────────────────┘\n```\n\n```mdl\ncomponent StackSection\n desc: A single collapsible section in the stack — shows a sigil icon button with a dropdown menu and delegates content rendering to the section surface slot.\n props:\n id: string\n object: Obj.Unknown\n view: StackSectionView\n metadata: StackSectionMetadata\n state:\n optionsMenuOpen: boolean\n attendableId: string # composed as parentAttendableId/object.id\n slots:\n content: ReactNode # rendered by Surface(type=section, subject=object)\n actions:\n navigate(id: string)\n add(id: string, position: AddSectionPosition)\n collapse(id: string, collapsed: boolean)\n delete(id: string)\n layout: |\n ┌─────────────────────────────────┐\n │ StackItem.Heading │\n │ [sigil▾] (sticky) [→ or ↕] │\n ├─────────────────────────────────┤\n │ CollapsibleContent │\n │ Surface type=section │\n └─────────────────────────────────┘\n```\n\n```mdl\ncomponent StackSettings\n desc: Settings panel for configuring stack-level display preferences such as section separation.\n props:\n settings: StackSettingsProps\n layout: |\n ┌─────────────────────────────┐\n │ Settings.Section │\n │ Separation [toggle] │\n └─────────────────────────────┘\n```\n\n## Features\n\n```mdl\nfeat F-1: Stack Rendering\n\n req F-1.1: StackPlugin registers a surface for the article role filtered to Collection objects.\n req F-1.2: StackArticle renders each item in the collection as a StackSection in document order.\n req F-1.3: Each StackSection title is derived from the object's title property or graph node label.\n req F-1.4: The icon displayed on the section sigil is taken from the object schema's IconAnnotation.\n```\n\n```mdl\nfeat F-2: Section Management\n\n req F-2.1:\n when: user clicks the Add Section button in the toolbar\n then: SpaceOperation.OpenCreateObject dialog is invoked with the collection as target\n req F-2.2:\n when: user selects \"Add Before\" or \"Add After\" from a section dropdown\n then: LayoutOperation.UpdateDialog is invoked with the AddSectionDialog, position, and collection context\n req F-2.3:\n when: user selects \"Remove\" from a section dropdown\n then: SpaceOperation.RemoveObjects is invoked; section is removed from the collection\n req F-2.4:\n when: user selects \"Navigate to\" from a collapsed section dropdown or the navigate button\n then: LayoutOperation.Open is invoked with the section's id\n```\n\n```mdl\nfeat F-3: Collapse / Expand\n\n req F-3.1: Each section can be individually collapsed via the dropdown menu or caret trigger.\n req F-3.2:\n when: section is expanded\n then: full Surface:section content is visible; navigate button shown in heading\n req F-3.3:\n when: section is collapsed\n then: only the title is shown in StackItem.Content; expand toggle shown in heading\n req F-3.4: Collapsed state is managed locally in StackArticle component state (not persisted).\n```\n\n```mdl\nfeat F-4: Settings\n\n req F-4.1: StackPlugin exposes a settings panel via the StackSettings component.\n req F-4.2: The separation setting controls whether visual separators appear between sections.\n```\n\n```mdl\nfeat F-5: Schema Registration\n\n req F-5.1: StackPlugin registers StackViewType with the ECHO schema module on activation.\n req F-5.2: StackViewType stores per-section metadata (height, custom data) keyed by object id.\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Collection renders as stack\n given: a Collection with three objects is opened in article role\n then:\n - StackArticle is displayed\n - three StackSection components are rendered in order\n - each section shows the object's title\n```\n\n```mdl\ntest T-2: Add section via toolbar\n given: StackArticle is open\n when: user clicks the Add Section toolbar button\n then: SpaceOperation.OpenCreateObject is invoked with the collection as target\n```\n\n```mdl\ntest T-3: Remove section\n given: StackArticle is open with at least one section\n when: user selects Remove from a section dropdown\n then:\n - SpaceOperation.RemoveObjects is invoked\n - section no longer appears in the stack\n```\n\n```mdl\ntest T-4: Collapse section\n given: a section is expanded\n when: user selects Collapse from the section dropdown\n then:\n - section content is hidden\n - section title is shown in collapsed state\n - expand toggle is visible in heading\n```\n\n```mdl\ntest T-5: Navigate to section\n given: StackArticle is open\n when: user clicks the navigate button on a section heading\n then: LayoutOperation.Open is invoked with the section's DXN id\n```\n\n```mdl\ntest T-6: StackViewType registered\n given: StackPlugin is active\n then: StackViewType (typename org.dxos.type.stackView) is registered with the ECHO schema module\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n",
13
13
  mimeType: "application/x-mdl"
14
- } }), Plugin.make);
14
+ })), Plugin.make);
15
15
  //#endregion
16
16
  export { StackPlugin, StackPlugin as default };
17
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"StackPlugin.mjs","names":[],"sources":["../../src/StackPlugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Stack } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const StackPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Stack.Stack] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default StackPlugin;\n"],"mappings":";;;;;;;;AAeA,IAAa,cAAc,OAAO,OAAO,IAAI,CAAC,CAAC,KAC7C,UAAU,gBAAgB,EAAE,QAAQ,CAAC,MAAM,KAAK,EAAE,CAAC,GACnD,UAAU,iBAAiB,EAAE,UAAU,aAAa,CAAC,GACrD,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,UAAU,qBAAqB,EAC7B,OAAO;CAAE,UAAU,KAAK,QAAQ;CAAK,MAAM;CAAc,SAAS;CAAY,UAAU;AAAoB,EAC9G,CAAC,GACD,OAAO,IACT"}
1
+ {"version":3,"file":"StackPlugin.mjs","names":[],"sources":["../../src/StackPlugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nimport { ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\nimport * as Stack from './types/Stack';\n\nexport const StackPlugin = Plugin.define(meta).pipe(\n Plugin.addModule(AppCapability.schema([Stack.Stack])),\n Plugin.addModule(ReactSurface),\n Plugin.addModule(AppCapability.translations(translations)),\n Plugin.addModule(\n AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n }),\n ),\n Plugin.make,\n);\n\nexport default StackPlugin;\n"],"mappings":";;;;;;;;AAeA,IAAa,cAAc,OAAO,OAAO,IAAI,CAAC,CAAC,KAC7C,OAAO,UAAU,cAAc,OAAO,CAAC,KAAW,CAAC,CAAC,GACpD,OAAO,UAAU,YAAY,GAC7B,OAAO,UAAU,cAAc,aAAa,YAAY,CAAC,GACzD,OAAO,UACL,cAAc,YAAY;CACxB,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC,CACH,GACA,OAAO,IACT"}
@@ -1,6 +1,6 @@
1
- import { Capability } from "@dxos/app-framework";
1
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
2
2
  //#region src/capabilities/index.ts
3
- var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
3
+ var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: ["org.dxos.role.article"] });
4
4
  //#endregion
5
5
  export { ReactSurface };
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],"mappings":";;AAMA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB"}
1
+ {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\n\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.article'],\n});\n"],"mappings":";;AAMA,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAoB,EACjF,OAAO,CAAC,uBAAuB,EACjC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from "@dxos/app-framework";
1
+ import * as Plugin from "@dxos/app-framework/Plugin";
2
2
  import { DXN } from "@dxos/keys";
3
3
  import { Config2 } from "@dxos/app-framework/config";
4
4
  import { trim } from "@dxos/util";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.stack',\n name: 'Stacks',\n author: 'DXOS',\n description: trim`\n The Stack plugin renders any Collection as a vertically scrollable stack of collapsible sections in the\n Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering\n to the section surface role, enabling any other plugin to contribute its own section renderer.\n\n Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated\n to directly, or removed from the collection. New sections can be inserted before or after any existing\n section via a per-section dropdown menu, or appended via the toolbar Add button.\n\n The plugin registers StackViewType with the ECHO schema module so that per-section view metadata\n (height overrides, custom display data) can be stored and replicated alongside the collection.\n\n A settings panel exposes a separation toggle that controls whether visual dividers are rendered between\n sections.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n icon: { key: 'ph--stack-simple--regular' },\n spec: 'PLUGIN.mdl',\n tags: ['alpha'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\n\nimport config from '../dx.config';\n\nexport const SECTION_IDENTIFIER = DXN.make('org.dxos.type.stackSection');\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;CAejB,QAAQ;CACR,MAAM,EAAE,KAAK,4BAA4B;CACzC,MAAM;CACN,MAAM,CAAC,OAAO;AAChB,EACF,CAAC;;;ACvBD,IAAa,qBAAqB,IAAI,KAAK,4BAA4B;AAEvE,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
1
+ {"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.stack',\n name: 'Stacks',\n author: 'DXOS',\n description: trim`\n The Stack plugin renders any Collection as a vertically scrollable stack of collapsible sections in the\n Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering\n to the section surface role, enabling any other plugin to contribute its own section renderer.\n\n Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated\n to directly, or removed from the collection. New sections can be inserted before or after any existing\n section via a per-section dropdown menu, or appended via the toolbar Add button.\n\n The plugin registers StackViewType with the ECHO schema module so that per-section view metadata\n (height overrides, custom display data) can be stored and replicated alongside the collection.\n\n A settings panel exposes a separation toggle that controls whether visual dividers are rendered between\n sections.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n icon: { key: 'ph--stack-simple--regular' },\n spec: 'PLUGIN.mdl',\n tags: ['alpha'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport { DXN } from '@dxos/keys';\n\nimport config from '../dx.config';\n\nexport const SECTION_IDENTIFIER = DXN.make('org.dxos.type.stackSection');\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;CAejB,QAAQ;CACR,MAAM,EAAE,KAAK,4BAA4B;CACzC,MAAM;CACN,MAAM,CAAC,OAAO;AAChB,EACF,CAAC;;;ACvBD,IAAa,qBAAqB,IAAI,KAAK,4BAA4B;AAEvE,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
@@ -1,11 +1,12 @@
1
- import { Capabilities, Capability } from "@dxos/app-framework";
2
1
  import { Collection } from "@dxos/echo";
3
2
  import { Surface } from "@dxos/app-framework/ui";
4
3
  import { AppSurface } from "@dxos/app-toolkit/ui";
5
4
  import * as Effect from "effect/Effect";
5
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
6
+ import * as Capability from "@dxos/app-framework/Capability";
6
7
  import { StackArticle } from "#containers";
7
8
  //#region src/capabilities/react-surface.ts
8
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
9
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contribute(Capabilities.ReactSurface, Surface.create({
9
10
  id: "article",
10
11
  filter: AppSurface.object(AppSurface.Article, Collection.Collection),
11
12
  component: StackArticle,
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Collection } from '@dxos/echo';\n\nimport { StackArticle } from '#containers';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Capabilities.ReactSurface,\n Surface.create({\n id: 'article',\n filter: AppSurface.object(AppSurface.Article, Collection.Collection),\n component: StackArticle,\n props: ({ role, data: { subject, attendableId } }) => ({ role, subject, attendableId }),\n }),\n ),\n ),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,YACT,aAAa,cACb,QAAQ,OAAO;CACb,IAAI;CACJ,QAAQ,WAAW,OAAO,WAAW,SAAS,WAAW,UAAU;CACnE,WAAW;CACX,QAAQ,EAAE,MAAM,MAAM,EAAE,SAAS,sBAAsB;EAAE;EAAM;EAAS;CAAa;AACvF,CAAC,CACH,CACF,CACF"}
1
+ {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Collection } from '@dxos/echo';\n\nimport { StackArticle } from '#containers';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contribute(\n Capabilities.ReactSurface,\n Surface.create({\n id: 'article',\n filter: AppSurface.object(AppSurface.Article, Collection.Collection),\n component: StackArticle,\n props: ({ role, data: { subject, attendableId } }) => ({ role, subject, attendableId }),\n }),\n ),\n ),\n);\n"],"mappings":";;;;;;;;AAcA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,WACT,aAAa,cACb,QAAQ,OAAO;CACb,IAAI;CACJ,QAAQ,WAAW,OAAO,WAAW,SAAS,WAAW,UAAU;CACnE,WAAW;CACX,QAAQ,EAAE,MAAM,MAAM,EAAE,SAAS,sBAAsB;EAAE;EAAM;EAAS;CAAa;AACvF,CAAC,CACH,CACF,CACF"}
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -1,8 +1,8 @@
1
1
  import { Obj } from "@dxos/echo";
2
- import { GraphPath } from "@dxos/app-toolkit";
3
2
  import { meta } from "#meta";
4
3
  import { createContext, forwardRef, useCallback, useContext, useMemo, useState } from "react";
5
4
  import { Surface } from "@dxos/app-framework/ui";
5
+ import * as GraphPath from "@dxos/app-toolkit/GraphPath";
6
6
  import { AppSurface, AttentionSigilButton } from "@dxos/app-toolkit/ui";
7
7
  import { DropdownMenu, Icon, ScrollArea, useTranslation } from "@dxos/react-ui";
8
8
  import { useAttentionAttributes } from "@dxos/react-ui-attention";
@@ -1 +1 @@
1
- {"version":3,"file":"components.mjs","names":[],"sources":["../../src/components/Stack/StackContext.ts","../../src/components/Stack/Stack.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type StackContextType, type StackContextValue } from './Stack';\n\n// Kept out of `Stack.tsx`: react-refresh only fast-refreshes a module whose exports are all\n// components, so a context and its hook exported beside them force a full page reload on every edit.\n\nexport const StackContext = createContext<StackContextType | undefined>(undefined);\n\nexport const useStackContext = (consumer: string): StackContextType => {\n const context = useContext(StackContext);\n if (!context) {\n throw new Error(`\\`${consumer}\\` must be used within \\`Stack.Root\\`.`);\n }\n return context;\n};\n\n/** Section-level callbacks consumed by stack sections. */\nexport const useStack = (): StackContextValue => useStackContext('useStack');\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport React, {\n type ComponentPropsWithoutRef,\n type ForwardedRef,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { GraphPath } from '@dxos/app-toolkit';\nimport { AppSurface, AttentionSigilButton } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport {\n DropdownMenu,\n Icon,\n ScrollArea,\n ScrollAreaRootProps,\n type ThemedClassName,\n useTranslation,\n} from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { type DndContainerHandler } from '@dxos/react-ui-dnd';\nimport { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\n\nimport { meta } from '#meta';\n\nimport { StackContext, useStack, useStackContext } from './StackContext';\n\n//\n// Types\n//\n\nexport type StackSectionItem = {\n id: string;\n object: Obj.Unknown;\n};\n\n//\n// Context\n//\n\n/** Section-level callbacks consumed by stack sections. */\nexport type StackContextValue = {\n attendableId: string;\n /** Ids of sections that are currently collapsed. */\n collapsed: ReadonlySet<string>;\n onCollapse: (id: string, collapsed: boolean) => void;\n /** Add a new section immediately after the given section. */\n onAdd: (id: string) => void;\n onMoveUp: (id: string) => void;\n onMoveDown: (id: string) => void;\n onDelete: (id: string) => void;\n};\n\nexport type StackContextType = StackContextValue & {\n /** Container id used to scope Mosaic drag/drop. */\n id: string;\n eventHandler: DndContainerHandler;\n /** Scroll viewport element; threaded to the Mosaic container for autoscroll. */\n viewport: HTMLElement | null;\n setViewport: (element: HTMLElement | null) => void;\n};\n\n//\n// Root\n//\n\ntype StackRootProps = PropsWithChildren<\n StackContextValue & {\n /** Container id used to scope Mosaic drag/drop. */\n id: string;\n /** Drag/drop event handler; defaults to a read-only (no-drop) handler. */\n eventHandler?: DndContainerHandler;\n }\n>;\n\nconst StackRoot = ({\n id,\n eventHandler,\n children,\n attendableId,\n collapsed,\n onCollapse,\n onAdd,\n onMoveUp,\n onMoveDown,\n onDelete,\n}: StackRootProps) => {\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n const value = useMemo<StackContextType>(\n () => ({\n id,\n eventHandler: eventHandler ?? { id, canDrop: () => false },\n viewport,\n setViewport,\n attendableId,\n collapsed,\n onCollapse,\n onAdd,\n onMoveUp,\n onMoveDown,\n onDelete,\n }),\n [id, eventHandler, viewport, attendableId, collapsed, onCollapse, onAdd, onMoveUp, onMoveDown, onDelete],\n );\n\n return <StackContext.Provider value={value}>{children}</StackContext.Provider>;\n};\n\nStackRoot.displayName = 'Stack.Root';\n\n//\n// Content\n//\n\ntype StackContentProps = ThemedClassName<\n ComponentPropsWithoutRef<'div'> & Pick<ScrollAreaRootProps, 'centered' | 'thin' | 'padding'>\n>;\n\nconst StackContent = forwardRef<HTMLDivElement, StackContentProps>(({ children, ...props }, forwardedRef) => {\n const { eventHandler, viewport } = useStackContext('Stack.Content');\n return (\n <Mosaic.Container asChild orientation='vertical' autoScroll={viewport} eventHandler={eventHandler}>\n <ScrollArea.Root {...props} orientation='vertical' ref={forwardedRef}>\n {children}\n </ScrollArea.Root>\n </Mosaic.Container>\n );\n});\n\nStackContent.displayName = 'Stack.Content';\n\n//\n// Viewport\n//\n\ntype StackViewportProps = ThemedClassName<PropsWithChildren>;\n\nconst StackViewport = forwardRef<HTMLDivElement, StackViewportProps>(\n ({ classNames, children }, forwardedRef: ForwardedRef<HTMLDivElement>) => {\n const { setViewport } = useStackContext('Stack.Viewport');\n // Capture the viewport element for autoscroll while still honouring a forwarded ref.\n const setRefs = useCallback(\n (element: HTMLDivElement | null) => {\n setViewport(element);\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [setViewport, forwardedRef],\n );\n\n return (\n <ScrollArea.Viewport classNames={classNames} ref={setRefs}>\n {children}\n </ScrollArea.Viewport>\n );\n },\n);\n\nStackViewport.displayName = 'Stack.Viewport';\n\n//\n// Section\n//\n\ntype StackSectionProps = MosaicTileProps<StackSectionItem>;\n\n/**\n * A stack section rendered as a Mosaic tile: a 40px left rail (drag handle + section menu) beside the\n * main content area, which renders the object's content surface (or its title when collapsed). The\n * rail sticks to the top of the scroll viewport while the section is in view.\n */\n// TODO(burdon): All sections are intrinsic (content-sized) for now. Extrinsic content (e.g. a sketch\n// with no intrinsic height) should later get a Mosaic-native resizable height affordance.\n\n// Inline grip glyph for the drag preview. The native drag image does not rasterize external SVG sprite\n// `<use>` icons (e.g. `@dxos/react-ui` `Icon`), so the preview uses plain inline SVG circles instead.\nconst DragHandleGlyph = () => (\n <svg width={10} height={16} viewBox='0 0 10 16' aria-hidden className='shrink-0 text-description'>\n {[3, 8, 13].flatMap((cy) =>\n [2.5, 7.5].map((cx) => <circle key={`${cx}-${cy}`} cx={cx} cy={cy} r={1.1} fill='currentColor' />),\n )}\n </svg>\n);\n\nconst StackSection = ({ data, ...tileProps }: StackSectionProps) => {\n const { id, object } = data;\n const { t } = useTranslation(meta.profile.key);\n const { attendableId: parentAttendableId, collapsed, onAdd, onMoveUp, onMoveDown, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attendableId = GraphPath.getCollectionObjectPath(parentAttendableId, object.id);\n const attentionAttrs = useAttentionAttributes(attendableId);\n const surfaceData = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);\n const isCollapsed = collapsed.has(id);\n const icon = Obj.getIcon(object)?.icon ?? 'ph--circle-dashed--regular';\n const title = Obj.getLabel(object, { fallback: 'typename' }) ?? t('untitled-section.title');\n\n const rail = (\n <div className='grid grid-rows-[min-content_1fr]'>\n <div className='p-1 dx-toolbar-surface'>\n <DropdownMenu.Root open={optionsMenuOpen} onOpenChange={setOptionsMenuOpen}>\n <DropdownMenu.Trigger asChild>\n <AttentionSigilButton size='md' attendableId={attendableId}>\n <Icon icon={icon} classNames='transition-opacity' />\n </AttentionSigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {isCollapsed ? (\n <DropdownMenu.Item onClick={() => onCollapse(id, false)} data-testid='section.expand'>\n <Icon icon='ph--arrows-out-line-vertical--regular' />\n <span className='ms-2 grow'>{t('expand.label')}</span>\n </DropdownMenu.Item>\n ) : (\n <DropdownMenu.Item onClick={() => onCollapse(id, true)} data-testid='section.collapse'>\n <Icon icon='ph--arrows-in-line-vertical--regular' />\n <span className='ms-2 grow'>{t('collapse.label')}</span>\n </DropdownMenu.Item>\n )}\n <DropdownMenu.Separator />\n <DropdownMenu.Item onClick={() => onAdd(id)} data-testid='section.add'>\n <Icon icon='ph--plus--regular' />\n <span className='ms-2 grow'>{t('add-section.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onMoveUp(id)} data-testid='section.move-up'>\n <Icon icon='ph--arrow-line-up--regular' />\n <span className='ms-2 grow'>{t('move-up.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onMoveDown(id)} data-testid='section.move-down'>\n <Icon icon='ph--arrow-line-down--regular' />\n <span className='ms-2 grow'>{t('move-down.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' />\n <span className='ms-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 </div>\n <div className='p-1'>\n {/* Inline glyph (not a sprite `Icon`) so the handle stays visible in the tile's native drag image. */}\n <Mosaic.DragHandle\n label={t('drag-handle.label')}\n classNames='p-1 min-h-0 w-(--dx-rail-item) h-(--dx-rail-item)'\n testId='section.drag-handle'\n >\n <DragHandleGlyph />\n </Mosaic.DragHandle>\n </div>\n </div>\n );\n\n return (\n <Mosaic.Tile\n {...tileProps}\n data={data}\n classNames='grid grid-cols-[var(--dx-rail-action)_1fr] dx-attention-surface border border-subdued-separator'\n >\n <div className='border-e border-subdued-separator'>\n <div className='sticky top-0 flex flex-col items-center'>{rail}</div>\n </div>\n <div {...attentionAttrs} className='min-w-0'>\n <span className='sr-only'>{title}</span>\n {isCollapsed ? (\n <div className='h-(--dx-toolbar-size) flex p-1'>\n <h2 className='flex items-center font-medium'>{title}</h2>\n </div>\n ) : (\n <Surface.Surface type={AppSurface.Section} data={surfaceData} limit={1} />\n )}\n </div>\n </Mosaic.Tile>\n );\n};\n\nStackSection.displayName = 'Stack.Section';\n\n//\n// Stack\n//\n\nexport const Stack = {\n Root: StackRoot,\n Content: StackContent,\n Viewport: StackViewport,\n Section: StackSection,\n};\n\nexport type { StackContentProps, StackRootProps, StackSectionProps, StackViewportProps };\n"],"mappings":";;;;;;;;;;;AAWA,IAAa,eAAe,cAA4C,KAAA,CAAS;AAEjF,IAAa,mBAAmB,aAAuC;CACrE,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,KAAK,SAAS,uCAAuC;CAEvE,OAAO;AACT;;AAGA,IAAa,iBAAoC,gBAAgB,UAAU;;;AC4D3E,IAAM,aAAa,EACjB,IACA,cACA,UACA,cACA,WACA,YACA,OACA,UACA,YACA,eACoB;CACpB,MAAM,CAAC,UAAU,eAAe,SAA6B,IAAI;CACjE,MAAM,QAAQ,eACL;EACL;EACA,cAAc,gBAAgB;GAAE;GAAI,eAAe;EAAM;EACzD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAI;EAAc;EAAU;EAAc;EAAW;EAAY;EAAO;EAAU;EAAY;CAAQ,CACzG;CAEA,OAAO,oBAAC,aAAa,UAAd;EAA8B;EAAQ;CAAgC,CAAA;AAC/E;AAEA,UAAU,cAAc;AAUxB,IAAM,eAAe,YAA+C,EAAE,UAAU,GAAG,SAAS,iBAAiB;CAC3G,MAAM,EAAE,cAAc,aAAa,gBAAgB,eAAe;CAClE,OACE,oBAAC,OAAO,WAAR;EAAkB,SAAA;EAAQ,aAAY;EAAW,YAAY;EAAwB;YACnF,oBAAC,WAAW,MAAZ;GAAiB,GAAI;GAAO,aAAY;GAAW,KAAK;GACrD;EACc,CAAA;CACD,CAAA;AAEtB,CAAC;AAED,aAAa,cAAc;AAQ3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 {"version":3,"file":"components.mjs","names":[],"sources":["../../src/components/Stack/StackContext.ts","../../src/components/Stack/Stack.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type StackContextType, type StackContextValue } from './Stack';\n\n// Kept out of `Stack.tsx`: react-refresh only fast-refreshes a module whose exports are all\n// components, so a context and its hook exported beside them force a full page reload on every edit.\n\nexport const StackContext = createContext<StackContextType | undefined>(undefined);\n\nexport const useStackContext = (consumer: string): StackContextType => {\n const context = useContext(StackContext);\n if (!context) {\n throw new Error(`\\`${consumer}\\` must be used within \\`Stack.Root\\`.`);\n }\n return context;\n};\n\n/** Section-level callbacks consumed by stack sections. */\nexport const useStack = (): StackContextValue => useStackContext('useStack');\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport React, {\n type ComponentPropsWithoutRef,\n type ForwardedRef,\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useMemo,\n useState,\n} from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport { AppSurface, AttentionSigilButton } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport {\n DropdownMenu,\n Icon,\n ScrollArea,\n ScrollAreaRootProps,\n type ThemedClassName,\n useTranslation,\n} from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { type DndContainerHandler } from '@dxos/react-ui-dnd';\nimport { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\n\nimport { meta } from '#meta';\n\nimport { StackContext, useStack, useStackContext } from './StackContext';\n\n//\n// Types\n//\n\nexport type StackSectionItem = {\n id: string;\n object: Obj.Unknown;\n};\n\n//\n// Context\n//\n\n/** Section-level callbacks consumed by stack sections. */\nexport type StackContextValue = {\n attendableId: string;\n /** Ids of sections that are currently collapsed. */\n collapsed: ReadonlySet<string>;\n onCollapse: (id: string, collapsed: boolean) => void;\n /** Add a new section immediately after the given section. */\n onAdd: (id: string) => void;\n onMoveUp: (id: string) => void;\n onMoveDown: (id: string) => void;\n onDelete: (id: string) => void;\n};\n\nexport type StackContextType = StackContextValue & {\n /** Container id used to scope Mosaic drag/drop. */\n id: string;\n eventHandler: DndContainerHandler;\n /** Scroll viewport element; threaded to the Mosaic container for autoscroll. */\n viewport: HTMLElement | null;\n setViewport: (element: HTMLElement | null) => void;\n};\n\n//\n// Root\n//\n\ntype StackRootProps = PropsWithChildren<\n StackContextValue & {\n /** Container id used to scope Mosaic drag/drop. */\n id: string;\n /** Drag/drop event handler; defaults to a read-only (no-drop) handler. */\n eventHandler?: DndContainerHandler;\n }\n>;\n\nconst StackRoot = ({\n id,\n eventHandler,\n children,\n attendableId,\n collapsed,\n onCollapse,\n onAdd,\n onMoveUp,\n onMoveDown,\n onDelete,\n}: StackRootProps) => {\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n const value = useMemo<StackContextType>(\n () => ({\n id,\n eventHandler: eventHandler ?? { id, canDrop: () => false },\n viewport,\n setViewport,\n attendableId,\n collapsed,\n onCollapse,\n onAdd,\n onMoveUp,\n onMoveDown,\n onDelete,\n }),\n [id, eventHandler, viewport, attendableId, collapsed, onCollapse, onAdd, onMoveUp, onMoveDown, onDelete],\n );\n\n return <StackContext.Provider value={value}>{children}</StackContext.Provider>;\n};\n\nStackRoot.displayName = 'Stack.Root';\n\n//\n// Content\n//\n\ntype StackContentProps = ThemedClassName<\n ComponentPropsWithoutRef<'div'> & Pick<ScrollAreaRootProps, 'centered' | 'thin' | 'padding'>\n>;\n\nconst StackContent = forwardRef<HTMLDivElement, StackContentProps>(({ children, ...props }, forwardedRef) => {\n const { eventHandler, viewport } = useStackContext('Stack.Content');\n return (\n <Mosaic.Container asChild orientation='vertical' autoScroll={viewport} eventHandler={eventHandler}>\n <ScrollArea.Root {...props} orientation='vertical' ref={forwardedRef}>\n {children}\n </ScrollArea.Root>\n </Mosaic.Container>\n );\n});\n\nStackContent.displayName = 'Stack.Content';\n\n//\n// Viewport\n//\n\ntype StackViewportProps = ThemedClassName<PropsWithChildren>;\n\nconst StackViewport = forwardRef<HTMLDivElement, StackViewportProps>(\n ({ classNames, children }, forwardedRef: ForwardedRef<HTMLDivElement>) => {\n const { setViewport } = useStackContext('Stack.Viewport');\n // Capture the viewport element for autoscroll while still honouring a forwarded ref.\n const setRefs = useCallback(\n (element: HTMLDivElement | null) => {\n setViewport(element);\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [setViewport, forwardedRef],\n );\n\n return (\n <ScrollArea.Viewport classNames={classNames} ref={setRefs}>\n {children}\n </ScrollArea.Viewport>\n );\n },\n);\n\nStackViewport.displayName = 'Stack.Viewport';\n\n//\n// Section\n//\n\ntype StackSectionProps = MosaicTileProps<StackSectionItem>;\n\n/**\n * A stack section rendered as a Mosaic tile: a 40px left rail (drag handle + section menu) beside the\n * main content area, which renders the object's content surface (or its title when collapsed). The\n * rail sticks to the top of the scroll viewport while the section is in view.\n */\n// TODO(burdon): All sections are intrinsic (content-sized) for now. Extrinsic content (e.g. a sketch\n// with no intrinsic height) should later get a Mosaic-native resizable height affordance.\n\n// Inline grip glyph for the drag preview. The native drag image does not rasterize external SVG sprite\n// `<use>` icons (e.g. `@dxos/react-ui` `Icon`), so the preview uses plain inline SVG circles instead.\nconst DragHandleGlyph = () => (\n <svg width={10} height={16} viewBox='0 0 10 16' aria-hidden className='shrink-0 text-description'>\n {[3, 8, 13].flatMap((cy) =>\n [2.5, 7.5].map((cx) => <circle key={`${cx}-${cy}`} cx={cx} cy={cy} r={1.1} fill='currentColor' />),\n )}\n </svg>\n);\n\nconst StackSection = ({ data, ...tileProps }: StackSectionProps) => {\n const { id, object } = data;\n const { t } = useTranslation(meta.profile.key);\n const { attendableId: parentAttendableId, collapsed, onAdd, onMoveUp, onMoveDown, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attendableId = GraphPath.getCollectionObjectPath(parentAttendableId, object.id);\n const attentionAttrs = useAttentionAttributes(attendableId);\n const surfaceData = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);\n const isCollapsed = collapsed.has(id);\n const icon = Obj.getIcon(object)?.icon ?? 'ph--circle-dashed--regular';\n const title = Obj.getLabel(object, { fallback: 'typename' }) ?? t('untitled-section.title');\n\n const rail = (\n <div className='grid grid-rows-[min-content_1fr]'>\n <div className='p-1 dx-toolbar-surface'>\n <DropdownMenu.Root open={optionsMenuOpen} onOpenChange={setOptionsMenuOpen}>\n <DropdownMenu.Trigger asChild>\n <AttentionSigilButton size='md' attendableId={attendableId}>\n <Icon icon={icon} classNames='transition-opacity' />\n </AttentionSigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {isCollapsed ? (\n <DropdownMenu.Item onClick={() => onCollapse(id, false)} data-testid='section.expand'>\n <Icon icon='ph--arrows-out-line-vertical--regular' />\n <span className='ms-2 grow'>{t('expand.label')}</span>\n </DropdownMenu.Item>\n ) : (\n <DropdownMenu.Item onClick={() => onCollapse(id, true)} data-testid='section.collapse'>\n <Icon icon='ph--arrows-in-line-vertical--regular' />\n <span className='ms-2 grow'>{t('collapse.label')}</span>\n </DropdownMenu.Item>\n )}\n <DropdownMenu.Separator />\n <DropdownMenu.Item onClick={() => onAdd(id)} data-testid='section.add'>\n <Icon icon='ph--plus--regular' />\n <span className='ms-2 grow'>{t('add-section.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onMoveUp(id)} data-testid='section.move-up'>\n <Icon icon='ph--arrow-line-up--regular' />\n <span className='ms-2 grow'>{t('move-up.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onMoveDown(id)} data-testid='section.move-down'>\n <Icon icon='ph--arrow-line-down--regular' />\n <span className='ms-2 grow'>{t('move-down.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' />\n <span className='ms-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 </div>\n <div className='p-1'>\n {/* Inline glyph (not a sprite `Icon`) so the handle stays visible in the tile's native drag image. */}\n <Mosaic.DragHandle\n label={t('drag-handle.label')}\n classNames='p-1 min-h-0 w-(--dx-rail-item) h-(--dx-rail-item)'\n testId='section.drag-handle'\n >\n <DragHandleGlyph />\n </Mosaic.DragHandle>\n </div>\n </div>\n );\n\n return (\n <Mosaic.Tile\n {...tileProps}\n data={data}\n classNames='grid grid-cols-[var(--dx-rail-action)_1fr] dx-attention-surface border border-subdued-separator'\n >\n <div className='border-e border-subdued-separator'>\n <div className='sticky top-0 flex flex-col items-center'>{rail}</div>\n </div>\n <div {...attentionAttrs} className='min-w-0'>\n <span className='sr-only'>{title}</span>\n {isCollapsed ? (\n <div className='h-(--dx-toolbar-size) flex p-1'>\n <h2 className='flex items-center font-medium'>{title}</h2>\n </div>\n ) : (\n <Surface.Surface type={AppSurface.Section} data={surfaceData} limit={1} />\n )}\n </div>\n </Mosaic.Tile>\n );\n};\n\nStackSection.displayName = 'Stack.Section';\n\n//\n// Stack\n//\n\nexport const Stack = {\n Root: StackRoot,\n Content: StackContent,\n Viewport: StackViewport,\n Section: StackSection,\n};\n\nexport type { StackContentProps, StackRootProps, StackSectionProps, StackViewportProps };\n"],"mappings":";;;;;;;;;;;AAWA,IAAa,eAAe,cAA4C,KAAA,CAAS;AAEjF,IAAa,mBAAmB,aAAuC;CACrE,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,KAAK,SAAS,uCAAuC;CAEvE,OAAO;AACT;;AAGA,IAAa,iBAAoC,gBAAgB,UAAU;;;AC4D3E,IAAM,a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GAAK,WAAU;aAEb,oBAAC,OAAO,YAAR;IACE,OAAO,EAAE,mBAAmB;IAC5B,YAAW;IACX,QAAO;cAEP,oBAAC,iBAAD,CAAkB,CAAA;GACD,CAAA;EAChB,CAAA,CACF;;CAGP,OACE,qBAAC,OAAO,MAAR;EACE,GAAI;EACE;EACN,YAAW;YAHb,CAKE,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,OAAD;IAAK,WAAU;cAA2C;GAAU,CAAA;EACjE,CAAA,GACL,qBAAC,OAAD;GAAK,GAAI;GAAgB,WAAU;aAAnC,CACE,oBAAC,QAAD;IAAM,WAAU;cAAW;GAAY,CAAA,GACtC,cACC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,MAAD;KAAI,WAAU;eAAiC;IAAU,CAAA;GACtD,CAAA,IAEL,oBAAC,QAAQ,SAAT;IAAiB,MAAM,WAAW;IAAS,MAAM;IAAa,OAAO;GAAI,CAAA,CAExE;IACM;;AAEjB;AAEA,aAAa,cAAc;AAM3B,IAAa,QAAQ;CACnB,MAAM;CACN,SAAS;CACT,UAAU;CACV,SAAS;AACX"}
@@ -1,3 +1,4 @@
1
- import { t as Stack_exports } from "./chunk-types.mjs";
2
1
  import { n as meta, t as SECTION_IDENTIFIER } from "./chunk-meta.mjs";
3
- export { SECTION_IDENTIFIER, Stack_exports as Stack, meta };
2
+ import { t as Stack_exports } from "./Stack.mjs";
3
+ import { t as StackEvents_exports } from "./StackEvents.mjs";
4
+ export { SECTION_IDENTIFIER, Stack_exports as Stack, StackEvents_exports as StackEvents, meta };
@@ -1,5 +1,5 @@
1
1
  import { n as meta } from "./chunk-meta.mjs";
2
- import { Plugin } from "@dxos/app-framework";
2
+ import * as Plugin from "@dxos/app-framework/Plugin";
3
3
  //#region src/plugin.ts
4
4
  var StackPlugin = Plugin.lazy(meta, () => import("#plugin"));
5
5
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const StackPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],"mappings":";;;AAQA,IAAa,cAAc,OAAO,KAAK,YAAY,OAAO,UAAU"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport { meta } from './meta';\n\nexport const StackPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],"mappings":";;;AAQA,IAAa,cAAc,OAAO,KAAK,YAAY,OAAO,UAAU"}
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@dxos/app-framework';
1
+ import * as Plugin from '@dxos/app-framework/Plugin';
2
2
  export declare const StackPlugin: Plugin.PluginFactory<void>;
3
3
  export default StackPlugin;
4
4
  //# sourceMappingURL=StackPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StackPlugin.d.ts","sourceRoot":"","sources":["../../../src/StackPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAW7C,eAAO,MAAM,WAAW,4BAQvB,CAAC;eAEa,WAAW"}
1
+ {"version":3,"file":"StackPlugin.d.ts","sourceRoot":"","sources":["../../../src/StackPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAWrD,eAAO,MAAM,WAAW,4BAavB,CAAC;eAEa,WAAW"}
@@ -1,3 +1,2 @@
1
- import { Capability } from '@dxos/app-framework';
2
- export declare const ReactSurface: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
1
+ export declare const ReactSurface: import("@dxos/app-framework/Capability").Module<void>;
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iEAAmE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,uDAEvB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as Effect from 'effect/Effect';
2
- import { Capability } from '@dxos/app-framework';
3
- declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
2
+ import * as Capability from '@dxos/app-framework/Capability';
3
+ declare const _default: (props: void) => Effect.Effect<Capability.Contribution<Capability.CapabilityIdentifier<"org.dxos.app-framework.capability.reactSurface", "multi">>, never, import("effect/Scope").Scope>;
4
4
  export default _default;
5
5
  //# sourceMappingURL=react-surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC"}
@@ -57,6 +57,7 @@ export declare const Stack: {
57
57
  padding: boolean;
58
58
  thin: boolean;
59
59
  snap: boolean;
60
+ native: boolean;
60
61
  }>, "centered" | "padding" | "thin">, "className"> & {
61
62
  classNames?: import("@dxos/ui-types").ClassNameValue;
62
63
  } & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,KAAK,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BAAwB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC,CAC7F,CAAC;AAmBF,KAAK,kBAAkB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAgC7D,KAAK,iBAAiB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;8BAoBrC,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,EAAE,iBAAiB;;;;AAqG/D,eAAO,MAAM,KAAK;IAChB,IAAI;sHA3MH,cAAc;;;IA4Mf,OAAO;;;;;;;;;;;;IACP,QAAQ;;;;;IACR,OAAO;iCAzGqC,iBAAiB;;;CA0G9D,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StackArticle.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/StackArticle/StackArticle.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA2BjE,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAoBtE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CA+DnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
1
+ {"version":3,"file":"StackArticle.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/StackArticle/StackArticle.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA2BjE,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AAoBtE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CA8DnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './meta';
2
- export * from './types';
2
+ export * as Stack from './types/Stack';
3
+ export * as StackEvents from './types/StackEvents';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Plugin } from '@dxos/app-framework';
1
+ import * as Plugin from '@dxos/app-framework/Plugin';
2
2
  export declare const StackPlugin: Plugin.PluginFactory<void>;
3
3
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,eAAO,MAAM,WAAW,4BAA6C,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AAIrD,eAAO,MAAM,WAAW,4BAA6C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as ActivationEvent from '@dxos/app-framework/ActivationEvent';
2
+ /**
3
+ * The feature's start event: the plugin's start-gated modules (and cross-plugin
4
+ * contributions consumed by this feature) activate here. Fired on demand and by the
5
+ * host's idle trickle.
6
+ */
7
+ export declare const Start: ActivationEvent.ActivationEvent;
8
+ //# sourceMappingURL=StackEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackEvents.d.ts","sourceRoot":"","sources":["../../../../src/types/StackEvents.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AAIvE;;;;GAIG;AACH,eAAO,MAAM,KAAK,iCAAgD,CAAC"}