@dxos/plugin-stack 0.8.3 → 0.8.4-main.1c7ec43d41

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 (117) hide show
  1. package/dist/lib/browser/StackPlugin-XXRZ2OJA.mjs +22 -0
  2. package/dist/lib/browser/StackPlugin-XXRZ2OJA.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +19 -92
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/translations.mjs +37 -0
  7. package/dist/lib/browser/translations.mjs.map +7 -0
  8. package/dist/lib/browser/types/index.mjs +21 -4
  9. package/dist/lib/browser/types/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/StackPlugin-YCPQMVBH.mjs +24 -0
  11. package/dist/lib/node-esm/StackPlugin-YCPQMVBH.mjs.map +7 -0
  12. package/dist/lib/node-esm/index.mjs +19 -91
  13. package/dist/lib/node-esm/index.mjs.map +4 -4
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/lib/node-esm/translations.mjs +39 -0
  16. package/dist/lib/node-esm/translations.mjs.map +7 -0
  17. package/dist/lib/node-esm/types/index.mjs +22 -4
  18. package/dist/lib/node-esm/types/index.mjs.map +4 -4
  19. package/dist/types/src/StackPlugin.d.ts +3 -1
  20. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/index.d.ts +2 -1
  22. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  23. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  24. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  25. package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
  26. package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
  27. package/dist/types/src/components/StackContext/index.d.ts +2 -0
  28. package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
  29. package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
  30. package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
  31. package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
  32. package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
  33. package/dist/types/src/components/StackSection/index.d.ts +2 -0
  34. package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
  35. package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
  36. package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
  37. package/dist/types/src/components/StackSettings/index.d.ts +2 -0
  38. package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
  39. package/dist/types/src/components/index.d.ts +2 -4
  40. package/dist/types/src/components/index.d.ts.map +1 -1
  41. package/dist/types/src/containers/StackContainer/StackContainer.d.ts +7 -0
  42. package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -0
  43. package/dist/types/src/containers/StackContainer/index.d.ts +2 -0
  44. package/dist/types/src/containers/StackContainer/index.d.ts.map +1 -0
  45. package/dist/types/src/containers/index.d.ts +3 -0
  46. package/dist/types/src/containers/index.d.ts.map +1 -0
  47. package/dist/types/src/index.d.ts +2 -1
  48. package/dist/types/src/index.d.ts.map +1 -1
  49. package/dist/types/src/meta.d.ts +3 -4
  50. package/dist/types/src/meta.d.ts.map +1 -1
  51. package/dist/types/src/translations.d.ts +36 -35
  52. package/dist/types/src/translations.d.ts.map +1 -1
  53. package/dist/types/src/types/index.d.ts +1 -1
  54. package/dist/types/src/types/index.d.ts.map +1 -1
  55. package/dist/types/src/types/stack.d.ts +13 -14
  56. package/dist/types/src/types/stack.d.ts.map +1 -1
  57. package/dist/types/src/types/types.d.ts +7 -5
  58. package/dist/types/src/types/types.d.ts.map +1 -1
  59. package/dist/types/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +60 -46
  61. package/src/StackPlugin.ts +14 -46
  62. package/src/capabilities/index.ts +2 -2
  63. package/src/capabilities/react-surface.tsx +20 -26
  64. package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
  65. package/src/components/StackContext/index.ts +5 -0
  66. package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +30 -26
  67. package/src/components/StackSection/index.ts +5 -0
  68. package/src/components/StackSettings/StackSettings.tsx +28 -0
  69. package/src/components/StackSettings/index.ts +5 -0
  70. package/src/components/index.ts +2 -4
  71. package/src/containers/StackContainer/StackContainer.tsx +170 -0
  72. package/src/containers/StackContainer/index.ts +5 -0
  73. package/src/containers/index.ts +7 -0
  74. package/src/index.ts +6 -1
  75. package/src/meta.ts +9 -6
  76. package/src/translations.ts +27 -24
  77. package/src/types/index.ts +1 -1
  78. package/src/types/stack.ts +12 -8
  79. package/src/types/types.ts +4 -5
  80. package/dist/lib/browser/StackMain-VQUBQKYP.mjs +0 -298
  81. package/dist/lib/browser/StackMain-VQUBQKYP.mjs.map +0 -7
  82. package/dist/lib/browser/chunk-KBJKTX5V.mjs +0 -28
  83. package/dist/lib/browser/chunk-KBJKTX5V.mjs.map +0 -7
  84. package/dist/lib/browser/chunk-XHZTILS3.mjs +0 -19
  85. package/dist/lib/browser/chunk-XHZTILS3.mjs.map +0 -7
  86. package/dist/lib/browser/react-surface-7NC5QPP4.mjs +0 -46
  87. package/dist/lib/browser/react-surface-7NC5QPP4.mjs.map +0 -7
  88. package/dist/lib/node/StackMain-33HO2PMZ.cjs +0 -314
  89. package/dist/lib/node/StackMain-33HO2PMZ.cjs.map +0 -7
  90. package/dist/lib/node/chunk-F7ZNJ53O.cjs +0 -43
  91. package/dist/lib/node/chunk-F7ZNJ53O.cjs.map +0 -7
  92. package/dist/lib/node/chunk-R6Q5AF3V.cjs +0 -51
  93. package/dist/lib/node/chunk-R6Q5AF3V.cjs.map +0 -7
  94. package/dist/lib/node/index.cjs +0 -123
  95. package/dist/lib/node/index.cjs.map +0 -7
  96. package/dist/lib/node/meta.json +0 -1
  97. package/dist/lib/node/react-surface-BUYFGQTR.cjs +0 -64
  98. package/dist/lib/node/react-surface-BUYFGQTR.cjs.map +0 -7
  99. package/dist/lib/node/types/index.cjs +0 -31
  100. package/dist/lib/node/types/index.cjs.map +0 -7
  101. package/dist/lib/node-esm/StackMain-7L5JME2D.mjs +0 -299
  102. package/dist/lib/node-esm/StackMain-7L5JME2D.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-KEWNJDTP.mjs +0 -30
  104. package/dist/lib/node-esm/chunk-KEWNJDTP.mjs.map +0 -7
  105. package/dist/lib/node-esm/chunk-YW7WYA4H.mjs +0 -21
  106. package/dist/lib/node-esm/chunk-YW7WYA4H.mjs.map +0 -7
  107. package/dist/lib/node-esm/react-surface-2ODZHHA7.mjs +0 -47
  108. package/dist/lib/node-esm/react-surface-2ODZHHA7.mjs.map +0 -7
  109. package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
  110. package/dist/types/src/components/StackContext.d.ts.map +0 -1
  111. package/dist/types/src/components/StackMain.d.ts +0 -9
  112. package/dist/types/src/components/StackMain.d.ts.map +0 -1
  113. package/dist/types/src/components/StackSection.d.ts.map +0 -1
  114. package/dist/types/src/components/StackSettings.d.ts.map +0 -1
  115. package/src/components/StackMain.tsx +0 -160
  116. package/src/components/StackSettings.tsx +0 -23
  117. /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
package/package.json CHANGED
@@ -1,83 +1,97 @@
1
1
  {
2
2
  "name": "@dxos/plugin-stack",
3
- "version": "0.8.3",
3
+ "version": "0.8.4-main.1c7ec43d41",
4
4
  "description": "DXOS Surface plugin for Stack entities",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": "./src/capabilities/index.ts",
17
+ "#components": "./src/components/index.ts",
18
+ "#containers": "./src/containers/index.ts",
19
+ "#meta": "./src/meta.ts",
20
+ "#translations": "./src/translations.ts",
21
+ "#types": "./src/types/index.ts"
22
+ },
11
23
  "exports": {
12
24
  ".": {
25
+ "source": "./src/index.ts",
13
26
  "types": "./dist/types/src/index.d.ts",
14
27
  "browser": "./dist/lib/browser/index.mjs",
15
28
  "node": "./dist/lib/node-esm/index.mjs"
16
29
  },
30
+ "./translations": {
31
+ "source": "./src/translations.ts",
32
+ "types": "./dist/types/src/translations.d.ts",
33
+ "browser": "./dist/lib/browser/translations.mjs",
34
+ "node": "./dist/lib/node-esm/translations.mjs"
35
+ },
17
36
  "./types": {
37
+ "source": "./src/types/index.ts",
18
38
  "types": "./dist/types/src/types/index.d.ts",
19
39
  "browser": "./dist/lib/browser/types/index.mjs",
20
40
  "node": "./dist/lib/node-esm/types/index.mjs"
21
41
  }
22
42
  },
23
43
  "types": "dist/types/src/index.d.ts",
24
- "typesVersions": {
25
- "*": {
26
- "types": [
27
- "dist/types/src/types/index.d.ts"
28
- ]
29
- }
30
- },
31
44
  "files": [
32
45
  "dist",
33
46
  "src"
34
47
  ],
35
48
  "dependencies": {
36
- "@fluentui/react-tabster": "^9.24.2",
37
- "@preact-signals/safe-react": "^0.9.0",
38
- "@preact/signals-core": "^1.9.0",
49
+ "@effect-atom/atom-react": "^0.5.0",
50
+ "@fluentui/react-tabster": "9.26.11",
39
51
  "@radix-ui/react-collapsible": "1.1.3",
40
- "effect": "3.14.21",
52
+ "effect": "3.20.0",
41
53
  "node-fetch": "^2.6.0",
42
- "react-is": "~18.2.0",
43
- "@dxos/echo": "0.8.3",
44
- "@dxos/async": "0.8.3",
45
- "@dxos/client": "0.8.3",
46
- "@dxos/app-framework": "0.8.3",
47
- "@dxos/echo-schema": "0.8.3",
48
- "@dxos/local-storage": "0.8.3",
49
- "@dxos/plugin-client": "0.8.3",
50
- "@dxos/invariant": "0.8.3",
51
- "@dxos/plugin-deck": "0.8.3",
52
- "@dxos/plugin-graph": "0.8.3",
53
- "@dxos/plugin-space": "0.8.3",
54
- "@dxos/react-client": "0.8.3",
55
- "@dxos/react-ui-attention": "0.8.3",
56
- "@dxos/react-ui-form": "0.8.3",
57
- "@dxos/react-ui-searchlist": "0.8.3",
58
- "@dxos/react-ui-stack": "0.8.3",
59
- "@dxos/util": "0.8.3",
60
- "@dxos/schema": "0.8.3"
54
+ "react-is": "~19.2.0",
55
+ "@dxos/app-framework": "0.8.4-main.1c7ec43d41",
56
+ "@dxos/app-toolkit": "0.8.4-main.1c7ec43d41",
57
+ "@dxos/async": "0.8.4-main.1c7ec43d41",
58
+ "@dxos/client": "0.8.4-main.1c7ec43d41",
59
+ "@dxos/echo": "0.8.4-main.1c7ec43d41",
60
+ "@dxos/echo-atom": "0.8.4-main.1c7ec43d41",
61
+ "@dxos/invariant": "0.8.4-main.1c7ec43d41",
62
+ "@dxos/plugin-client": "0.8.4-main.1c7ec43d41",
63
+ "@dxos/plugin-deck": "0.8.4-main.1c7ec43d41",
64
+ "@dxos/react-client": "0.8.4-main.1c7ec43d41",
65
+ "@dxos/operation": "0.8.4-main.1c7ec43d41",
66
+ "@dxos/plugin-graph": "0.8.4-main.1c7ec43d41",
67
+ "@dxos/react-ui-attention": "0.8.4-main.1c7ec43d41",
68
+ "@dxos/react-ui-form": "0.8.4-main.1c7ec43d41",
69
+ "@dxos/react-ui-list": "0.8.4-main.1c7ec43d41",
70
+ "@dxos/react-ui-stack": "0.8.4-main.1c7ec43d41",
71
+ "@dxos/schema": "0.8.4-main.1c7ec43d41",
72
+ "@dxos/plugin-space": "0.8.4-main.1c7ec43d41",
73
+ "@dxos/util": "0.8.4-main.1c7ec43d41",
74
+ "@dxos/types": "0.8.4-main.1c7ec43d41"
61
75
  },
62
76
  "devDependencies": {
63
77
  "@babel/core": "^7.18.13",
64
- "@phosphor-icons/react": "^2.1.5",
65
- "@types/react": "~18.2.0",
66
- "@types/react-dom": "~18.2.0",
67
- "react": "~18.2.0",
68
- "react-dom": "~18.2.0",
69
- "vite": "5.4.7",
70
- "@dxos/react-ui": "0.8.3",
71
- "@dxos/react-ui-theme": "0.8.3",
72
- "@dxos/storybook-utils": "0.8.3"
78
+ "@types/react": "~19.2.7",
79
+ "@types/react-dom": "~19.2.3",
80
+ "react": "~19.2.3",
81
+ "react-dom": "~19.2.3",
82
+ "vite": "^8.0.10",
83
+ "@dxos/plugin-testing": "0.8.4-main.1c7ec43d41",
84
+ "@dxos/react-ui": "0.8.4-main.1c7ec43d41",
85
+ "@dxos/storybook-utils": "0.8.4-main.1c7ec43d41",
86
+ "@dxos/ui-theme": "0.8.4-main.1c7ec43d41"
73
87
  },
74
88
  "peerDependencies": {
75
- "@phosphor-icons/react": "^2.1.5",
76
- "effect": "^3.13.3",
77
- "react": "~18.2.0",
78
- "react-dom": "~18.2.0",
79
- "@dxos/react-ui": "0.8.3",
80
- "@dxos/react-ui-theme": "0.8.3"
89
+ "@effect-atom/atom-react": "^0.5.0",
90
+ "effect": "3.20.0",
91
+ "react": "~19.2.3",
92
+ "react-dom": "~19.2.3",
93
+ "@dxos/react-ui": "0.8.4-main.1c7ec43d41",
94
+ "@dxos/ui-theme": "0.8.4-main.1c7ec43d41"
81
95
  },
82
96
  "publishConfig": {
83
97
  "access": "public"
@@ -2,51 +2,19 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';
6
- import { type Obj } from '@dxos/echo';
7
- import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
5
+ import { Plugin } from '@dxos/app-framework';
6
+ import { AppPlugin } from '@dxos/app-toolkit';
8
7
 
9
- import { ReactSurface } from './capabilities';
10
- import { meta, SECTION_IDENTIFIER } from './meta';
11
- import translations from './translations';
12
- import { StackViewType } from './types';
8
+ import { ReactSurface } from '#capabilities';
9
+ import { meta } from '#meta';
10
+ import { translations } from '#translations';
11
+ import { StackViewType } from '#types';
13
12
 
14
- export const StackPlugin = () =>
15
- definePlugin(meta, [
16
- defineModule({
17
- id: `${meta.id}/module/translations`,
18
- activatesOn: Events.SetupTranslations,
19
- activate: () => contributes(Capabilities.Translations, translations),
20
- }),
21
- defineModule({
22
- id: `${meta.id}/module/metadata`,
23
- activatesOn: Events.SetupMetadata,
24
- activate: () => [
25
- contributes(Capabilities.Metadata, {
26
- id: SECTION_IDENTIFIER,
27
- metadata: {
28
- parse: (section: { object: Obj.Any }, type: string) => {
29
- switch (type) {
30
- case 'node':
31
- return { id: section.object.id, label: (section.object as any).title, data: section.object };
32
- case 'object':
33
- return section.object;
34
- case 'view-object':
35
- return section;
36
- }
37
- },
38
- },
39
- }),
40
- ],
41
- }),
42
- defineModule({
43
- id: `${meta.id}/module/schema`,
44
- activatesOn: ClientEvents.SetupSchema,
45
- activate: () => contributes(ClientCapabilities.Schema, [StackViewType]),
46
- }),
47
- defineModule({
48
- id: `${meta.id}/module/react-surface`,
49
- activatesOn: Events.SetupReactSurface,
50
- activate: ReactSurface,
51
- }),
52
- ]);
13
+ export const StackPlugin = Plugin.define(meta).pipe(
14
+ AppPlugin.addSchemaModule({ schema: [StackViewType] }),
15
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
16
+ AppPlugin.addTranslationsModule({ translations }),
17
+ Plugin.make,
18
+ );
19
+
20
+ export default StackPlugin;
@@ -2,6 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
5
+ import { Capability } from '@dxos/app-framework';
6
6
 
7
- export const ReactSurface = lazy(() => import('./react-surface'));
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -2,33 +2,27 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Effect from 'effect/Effect';
5
6
  import React from 'react';
6
7
 
7
- import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { Obj } from '@dxos/echo';
9
- import { fullyQualifiedId } from '@dxos/react-client/echo';
10
- import { DataType } from '@dxos/schema';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
10
+ import { AppSurface } from '@dxos/app-toolkit/ui';
11
+ import { Collection } from '@dxos/echo';
11
12
 
12
- import { StackMain } from '../components';
13
- import { STACK_PLUGIN } from '../meta';
13
+ import { StackContainer } from '#containers';
14
14
 
15
- export default () =>
16
- contributes(
17
- Capabilities.ReactSurface,
18
- createSurface({
19
- id: `${STACK_PLUGIN}/article`,
20
- role: 'article',
21
- filter: (data): data is { id?: string; subject: DataType.Collection } =>
22
- Obj.instanceOf(DataType.Collection, data.subject),
23
- component: ({ data }) => {
24
- // This allows the id to be overridden by the surface for situations where the id of the collection
25
- // is not the same as the id of what is being represented (e.g., a space with a root collection).
26
- const id = typeof data.id === 'string' ? data.id : undefined;
27
- return (
28
- <div role='none' className='overflow-auto' style={{ contain: 'layout' }}>
29
- <StackMain id={id ?? fullyQualifiedId(data.subject)} collection={data.subject} />
30
- </div>
31
- );
32
- },
33
- }),
34
- );
15
+ export default Capability.makeModule(() =>
16
+ Effect.succeed(
17
+ Capability.contributes(
18
+ Capabilities.ReactSurface,
19
+ Surface.create({
20
+ id: 'article',
21
+ filter: AppSurface.object(AppSurface.Article, Collection.Collection),
22
+ component: ({ role, data }) => {
23
+ return <StackContainer attendableId={data.attendableId} role={role} subject={data.subject} />;
24
+ },
25
+ }),
26
+ ),
27
+ ),
28
+ );
@@ -4,9 +4,10 @@
4
4
 
5
5
  import { createContext, useContext } from 'react';
6
6
 
7
- import { type AddSectionPosition } from '../types';
7
+ import { type AddSectionPosition } from '#types';
8
8
 
9
9
  export type StackContextValue = {
10
+ attendableId: string;
10
11
  onCollapse: (id: string, collapsed: boolean) => void;
11
12
  onNavigate: (id: string) => Promise<void>;
12
13
  onDelete: (id: string) => Promise<void>;
@@ -14,6 +15,7 @@ export type StackContextValue = {
14
15
  };
15
16
 
16
17
  export const StackContext = createContext<StackContextValue>({
18
+ attendableId: '',
17
19
  onCollapse: () => {},
18
20
  onNavigate: async () => {},
19
21
  onDelete: async () => {},
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export * from './StackContext';
@@ -5,18 +5,20 @@
5
5
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
6
6
  import React, { useMemo, useState } from 'react';
7
7
 
8
- import { Surface } from '@dxos/app-framework';
9
- import { DropdownMenu, Icon, useTranslation, IconButton } from '@dxos/react-ui';
8
+ import { Surface } from '@dxos/app-framework/ui';
9
+ import { AppSurface } from '@dxos/app-toolkit/ui';
10
+ import { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';
10
11
  import { useAttentionAttributes } from '@dxos/react-ui-attention';
11
12
  import { StackItem } from '@dxos/react-ui-stack';
12
- import { mx, getSize, textBlockWidth } from '@dxos/react-ui-theme';
13
+ import { getSize, mx } from '@dxos/ui-theme';
13
14
 
15
+ import { meta } from '#meta';
16
+ import { type StackSectionItem } from '#types';
17
+
18
+ import { useStack } from '../StackContext';
14
19
  import { CaretDownUp } from './CaretDownUp';
15
- import { useStack } from './StackContext';
16
- import { STACK_PLUGIN } from '../meta';
17
- import { type StackSectionItem } from '../types';
18
20
 
19
- const sectionActionDimensions = 'p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min';
21
+ const sectionActionDimensions = 'p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min';
20
22
 
21
23
  export type StackSectionProps = StackSectionItem;
22
24
 
@@ -26,16 +28,18 @@ export const StackSection = ({
26
28
  object,
27
29
  metadata: { icon = 'ph--placeholder--regular' },
28
30
  }: StackSectionProps) => {
29
- const { t } = useTranslation(STACK_PLUGIN);
30
- const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
31
+ const { t } = useTranslation(meta.id);
32
+ const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();
31
33
  const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
32
- const attentionAttrs = useAttentionAttributes(id);
34
+ const attendableId = `${parentAttendableId}/${object.id}`;
35
+ const attentionAttrs = useAttentionAttributes(attendableId);
33
36
  const stackItem = useMemo(() => ({ id }), [id]);
37
+ const data = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);
34
38
 
35
39
  return (
36
40
  <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>
37
41
  <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>
38
- <StackItem.Heading classNames='attention-surface'>
42
+ <StackItem.Heading classNames='dx-attention-surface'>
39
43
  <span className='sr-only'>{view.title}</span>
40
44
  <StackItem.HeadingStickyContent>
41
45
  <DropdownMenu.Root
@@ -46,7 +50,7 @@ export const StackSection = ({
46
50
  >
47
51
  <DropdownMenu.Trigger asChild>
48
52
  <StackItem.SigilButton>
49
- <Icon icon={icon} size={5} classNames='transition-opacity' />
53
+ <Icon icon={icon} classNames='transition-opacity' />
50
54
  </StackItem.SigilButton>
51
55
  </DropdownMenu.Trigger>
52
56
  <DropdownMenu.Portal>
@@ -54,28 +58,28 @@ export const StackSection = ({
54
58
  <DropdownMenu.Viewport>
55
59
  {view.collapsed ? (
56
60
  <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>
57
- <Icon icon='ph--arrow-right--regular' size={5} />
58
- <span className='mis-2 grow'>{t('navigate to section label')}</span>
61
+ <Icon icon='ph--arrow-right--regular' />
62
+ <span className='ms-2 grow'>{t('navigate-to-section.label')}</span>
59
63
  </DropdownMenu.Item>
60
64
  ) : (
61
65
  <CollapsiblePrimitive.Trigger asChild>
62
66
  <DropdownMenu.Item>
63
67
  <CaretDownUp className={getSize(5)} />
64
- <span className='mis-2 grow'>{t('collapse label')}</span>
68
+ <span className='ms-2 grow'>{t('collapse.label')}</span>
65
69
  </DropdownMenu.Item>
66
70
  </CollapsiblePrimitive.Trigger>
67
71
  )}
68
72
  <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>
69
- <Icon icon='ph--arrow-line-up--regular' size={5} />
70
- <span className='mis-2 grow'>{t('add section before label')}</span>
73
+ <Icon icon='ph--arrow-line-up--regular' />
74
+ <span className='ms-2 grow'>{t('add-section-before.label')}</span>
71
75
  </DropdownMenu.Item>
72
76
  <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>
73
- <Icon icon='ph--arrow-line-down--regular' size={5} />
74
- <span className='mis-2 grow'>{t('add section after label')}</span>
77
+ <Icon icon='ph--arrow-line-down--regular' />
78
+ <span className='ms-2 grow'>{t('add-section-after.label')}</span>
75
79
  </DropdownMenu.Item>
76
80
  <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>
77
- <Icon icon='ph--trash--regular' size={5} />
78
- <span className='mis-2 grow'>{t('remove section label')}</span>
81
+ <Icon icon='ph--trash--regular' />
82
+ <span className='ms-2 grow'>{t('remove-section.label')}</span>
79
83
  </DropdownMenu.Item>
80
84
  </DropdownMenu.Viewport>
81
85
  <DropdownMenu.Arrow />
@@ -87,7 +91,7 @@ export const StackSection = ({
87
91
  <IconButton
88
92
  iconOnly
89
93
  variant='ghost'
90
- label={t('expand label')}
94
+ label={t('expand.label')}
91
95
  icon='ph--caret-up-down--regular'
92
96
  classNames={sectionActionDimensions}
93
97
  />
@@ -97,7 +101,7 @@ export const StackSection = ({
97
101
  iconOnly
98
102
  variant='ghost'
99
103
  onClick={() => onNavigate(id)}
100
- label={t('navigate to section label')}
104
+ label={t('navigate-to-section.label')}
101
105
  icon='ph--arrow-right--regular'
102
106
  data-testid='section.navigate-to'
103
107
  classNames={sectionActionDimensions}
@@ -106,11 +110,11 @@ export const StackSection = ({
106
110
  </StackItem.HeadingStickyContent>
107
111
  </StackItem.Heading>
108
112
  <CollapsiblePrimitive.Content>
109
- <Surface role='section' data={{ subject: object }} limit={1} placeholder={<></>} />
113
+ <Surface.Surface type={AppSurface.Section} data={data} limit={1} placeholder={<></>} />
110
114
  </CollapsiblePrimitive.Content>
111
115
  {view.collapsed && (
112
- <StackItem.Content classNames='attention-surface'>
113
- <h2 className={mx('flex items-center p-4 font-medium', textBlockWidth)}>{view.title}</h2>
116
+ <StackItem.Content classNames='dx-attention-surface'>
117
+ <h2 className={mx('flex items-center p-4 font-medium')}>{view.title}</h2>
114
118
  </StackItem.Content>
115
119
  )}
116
120
  </StackItem.Root>
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export * from './StackSection';
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { Input, useTranslation } from '@dxos/react-ui';
8
+ import { Settings as SettingsForm } from '@dxos/react-ui-form';
9
+
10
+ import { meta } from '#meta';
11
+ import { type StackSettingsProps } from '#types';
12
+
13
+ export const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {
14
+ const { t } = useTranslation(meta.id);
15
+
16
+ return (
17
+ <SettingsForm.Viewport>
18
+ <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>
19
+ <SettingsForm.Item title={t('settings.separation.label')} description={t('settings.separation.description')}>
20
+ <Input.Switch
21
+ checked={settings.separation}
22
+ onCheckedChange={(checked) => (settings.separation = !!checked)}
23
+ />
24
+ </SettingsForm.Item>
25
+ </SettingsForm.Section>
26
+ </SettingsForm.Viewport>
27
+ );
28
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export * from './StackSettings';
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from 'react';
6
-
7
- export const StackMain = lazy(() => import('./StackMain'));
8
-
5
+ export * from './StackContext';
6
+ export * from './StackSection';
9
7
  export * from './StackSettings';