@dxos/plugin-stack 0.8.4-main.3f58842 → 0.8.4-main.406dc2a

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 (63) hide show
  1. package/dist/lib/browser/{StackMain-ET24BQFZ.mjs → StackContainer-RFJDTQBT.mjs} +28 -30
  2. package/dist/lib/browser/StackContainer-RFJDTQBT.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-FVB7LGW7.mjs → chunk-MS4QSWEZ.mjs} +2 -4
  4. package/dist/lib/browser/chunk-MS4QSWEZ.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-IRTROCUQ.mjs → chunk-NHMDZYOB.mjs} +3 -3
  6. package/dist/lib/browser/chunk-NHMDZYOB.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +6 -7
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/{react-surface-KODSQDIY.mjs → react-surface-DGGN5OPM.mjs} +10 -16
  11. package/dist/lib/browser/react-surface-DGGN5OPM.mjs.map +7 -0
  12. package/dist/lib/browser/types/index.mjs +1 -1
  13. package/dist/lib/node-esm/{StackMain-LCMLZ4MS.mjs → StackContainer-HL6KYBW2.mjs} +28 -30
  14. package/dist/lib/node-esm/StackContainer-HL6KYBW2.mjs.map +7 -0
  15. package/dist/lib/node-esm/{chunk-UN5PA7TK.mjs → chunk-5FDDKAPB.mjs} +2 -4
  16. package/dist/lib/node-esm/chunk-5FDDKAPB.mjs.map +7 -0
  17. package/dist/lib/node-esm/{chunk-LRAZXJ65.mjs → chunk-ZZFA7HIV.mjs} +3 -3
  18. package/dist/lib/node-esm/chunk-ZZFA7HIV.mjs.map +7 -0
  19. package/dist/lib/node-esm/index.mjs +6 -7
  20. package/dist/lib/node-esm/index.mjs.map +3 -3
  21. package/dist/lib/node-esm/meta.json +1 -1
  22. package/dist/lib/node-esm/{react-surface-SWMUVIYU.mjs → react-surface-TEOPQTLH.mjs} +10 -16
  23. package/dist/lib/node-esm/react-surface-TEOPQTLH.mjs.map +7 -0
  24. package/dist/lib/node-esm/types/index.mjs +1 -1
  25. package/dist/types/src/StackPlugin.d.ts +1 -1
  26. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  27. package/dist/types/src/capabilities/index.d.ts +1 -1
  28. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  30. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  31. package/dist/types/src/components/StackContainer.d.ts +9 -0
  32. package/dist/types/src/components/StackContainer.d.ts.map +1 -0
  33. package/dist/types/src/components/StackSection.d.ts.map +1 -1
  34. package/dist/types/src/components/StackSettings.d.ts.map +1 -1
  35. package/dist/types/src/components/index.d.ts +5 -2
  36. package/dist/types/src/components/index.d.ts.map +1 -1
  37. package/dist/types/src/meta.d.ts +0 -1
  38. package/dist/types/src/meta.d.ts.map +1 -1
  39. package/dist/types/src/translations.d.ts +1 -0
  40. package/dist/types/src/translations.d.ts.map +1 -1
  41. package/dist/types/src/types/stack.d.ts +3 -3
  42. package/dist/types/src/types/stack.d.ts.map +1 -1
  43. package/dist/types/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +35 -34
  45. package/src/StackPlugin.ts +39 -40
  46. package/src/capabilities/react-surface.tsx +4 -8
  47. package/src/components/{StackMain.tsx → StackContainer.tsx} +36 -34
  48. package/src/components/StackSection.tsx +6 -5
  49. package/src/components/StackSettings.tsx +15 -8
  50. package/src/components/index.ts +1 -1
  51. package/src/meta.ts +1 -2
  52. package/src/translations.ts +1 -0
  53. package/src/types/stack.ts +2 -2
  54. package/dist/lib/browser/StackMain-ET24BQFZ.mjs.map +0 -7
  55. package/dist/lib/browser/chunk-FVB7LGW7.mjs.map +0 -7
  56. package/dist/lib/browser/chunk-IRTROCUQ.mjs.map +0 -7
  57. package/dist/lib/browser/react-surface-KODSQDIY.mjs.map +0 -7
  58. package/dist/lib/node-esm/StackMain-LCMLZ4MS.mjs.map +0 -7
  59. package/dist/lib/node-esm/chunk-LRAZXJ65.mjs.map +0 -7
  60. package/dist/lib/node-esm/chunk-UN5PA7TK.mjs.map +0 -7
  61. package/dist/lib/node-esm/react-surface-SWMUVIYU.mjs.map +0 -7
  62. package/dist/types/src/components/StackMain.d.ts +0 -9
  63. package/dist/types/src/components/StackMain.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-stack",
3
- "version": "0.8.4-main.3f58842",
3
+ "version": "0.8.4-main.406dc2a",
4
4
  "description": "DXOS Surface plugin for Stack entities",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -10,11 +10,13 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "source": "./src/index.ts",
13
14
  "types": "./dist/types/src/index.d.ts",
14
15
  "browser": "./dist/lib/browser/index.mjs",
15
16
  "node": "./dist/lib/node-esm/index.mjs"
16
17
  },
17
18
  "./types": {
19
+ "source": "./src/types/index.ts",
18
20
  "types": "./dist/types/src/types/index.d.ts",
19
21
  "browser": "./dist/lib/browser/types/index.mjs",
20
22
  "node": "./dist/lib/node-esm/types/index.mjs"
@@ -35,47 +37,46 @@
35
37
  "dependencies": {
36
38
  "@fluentui/react-tabster": "^9.24.2",
37
39
  "@preact-signals/safe-react": "^0.9.0",
38
- "@preact/signals-core": "^1.9.0",
40
+ "@preact/signals-core": "^1.12.1",
39
41
  "@radix-ui/react-collapsible": "1.1.3",
40
- "effect": "3.17.0",
42
+ "effect": "3.18.3",
41
43
  "node-fetch": "^2.6.0",
42
- "react-is": "~18.2.0",
43
- "@dxos/app-framework": "0.8.4-main.3f58842",
44
- "@dxos/async": "0.8.4-main.3f58842",
45
- "@dxos/client": "0.8.4-main.3f58842",
46
- "@dxos/echo": "0.8.4-main.3f58842",
47
- "@dxos/echo-schema": "0.8.4-main.3f58842",
48
- "@dxos/invariant": "0.8.4-main.3f58842",
49
- "@dxos/local-storage": "0.8.4-main.3f58842",
50
- "@dxos/plugin-client": "0.8.4-main.3f58842",
51
- "@dxos/plugin-deck": "0.8.4-main.3f58842",
52
- "@dxos/plugin-graph": "0.8.4-main.3f58842",
53
- "@dxos/react-ui-attention": "0.8.4-main.3f58842",
54
- "@dxos/plugin-space": "0.8.4-main.3f58842",
55
- "@dxos/react-client": "0.8.4-main.3f58842",
56
- "@dxos/react-ui-form": "0.8.4-main.3f58842",
57
- "@dxos/react-ui-searchlist": "0.8.4-main.3f58842",
58
- "@dxos/schema": "0.8.4-main.3f58842",
59
- "@dxos/react-ui-stack": "0.8.4-main.3f58842",
60
- "@dxos/util": "0.8.4-main.3f58842"
44
+ "react-is": "~19.2.0",
45
+ "@dxos/async": "0.8.4-main.406dc2a",
46
+ "@dxos/app-framework": "0.8.4-main.406dc2a",
47
+ "@dxos/client": "0.8.4-main.406dc2a",
48
+ "@dxos/invariant": "0.8.4-main.406dc2a",
49
+ "@dxos/echo": "0.8.4-main.406dc2a",
50
+ "@dxos/local-storage": "0.8.4-main.406dc2a",
51
+ "@dxos/plugin-client": "0.8.4-main.406dc2a",
52
+ "@dxos/plugin-graph": "0.8.4-main.406dc2a",
53
+ "@dxos/plugin-deck": "0.8.4-main.406dc2a",
54
+ "@dxos/react-client": "0.8.4-main.406dc2a",
55
+ "@dxos/plugin-space": "0.8.4-main.406dc2a",
56
+ "@dxos/react-ui-attention": "0.8.4-main.406dc2a",
57
+ "@dxos/react-ui-searchlist": "0.8.4-main.406dc2a",
58
+ "@dxos/react-ui-form": "0.8.4-main.406dc2a",
59
+ "@dxos/react-ui-stack": "0.8.4-main.406dc2a",
60
+ "@dxos/schema": "0.8.4-main.406dc2a",
61
+ "@dxos/util": "0.8.4-main.406dc2a"
61
62
  },
62
63
  "devDependencies": {
63
64
  "@babel/core": "^7.18.13",
64
- "@types/react": "~18.2.0",
65
- "@types/react-dom": "~18.2.0",
66
- "react": "~18.2.0",
67
- "react-dom": "~18.2.0",
68
- "vite": "5.4.7",
69
- "@dxos/react-ui": "0.8.4-main.3f58842",
70
- "@dxos/react-ui-theme": "0.8.4-main.3f58842",
71
- "@dxos/storybook-utils": "0.8.4-main.3f58842"
65
+ "@types/react": "~19.2.2",
66
+ "@types/react-dom": "~19.2.1",
67
+ "react": "~19.2.0",
68
+ "react-dom": "~19.2.0",
69
+ "vite": "7.1.9",
70
+ "@dxos/react-ui-theme": "0.8.4-main.406dc2a",
71
+ "@dxos/storybook-utils": "0.8.4-main.406dc2a",
72
+ "@dxos/react-ui": "0.8.4-main.406dc2a"
72
73
  },
73
74
  "peerDependencies": {
74
75
  "effect": "^3.13.3",
75
- "react": "~18.2.0",
76
- "react-dom": "~18.2.0",
77
- "@dxos/react-ui": "0.8.4-main.3f58842",
78
- "@dxos/react-ui-theme": "0.8.4-main.3f58842"
76
+ "react": "^19.0.0",
77
+ "react-dom": "^19.0.0",
78
+ "@dxos/react-ui": "0.8.4-main.406dc2a",
79
+ "@dxos/react-ui-theme": "0.8.4-main.406dc2a"
79
80
  },
80
81
  "publishConfig": {
81
82
  "access": "public"
@@ -2,51 +2,50 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';
5
+ import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
6
6
  import { type Obj } from '@dxos/echo';
7
7
  import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
8
8
 
9
9
  import { ReactSurface } from './capabilities';
10
- import { meta, SECTION_IDENTIFIER } from './meta';
10
+ import { SECTION_IDENTIFIER, meta } from './meta';
11
11
  import { translations } from './translations';
12
12
  import { StackViewType } from './types';
13
13
 
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
- },
14
+ export const StackPlugin = definePlugin(meta, () => [
15
+ defineModule({
16
+ id: `${meta.id}/module/translations`,
17
+ activatesOn: Events.SetupTranslations,
18
+ activate: () => contributes(Capabilities.Translations, translations),
19
+ }),
20
+ defineModule({
21
+ id: `${meta.id}/module/metadata`,
22
+ activatesOn: Events.SetupMetadata,
23
+ activate: () => [
24
+ contributes(Capabilities.Metadata, {
25
+ id: SECTION_IDENTIFIER,
26
+ metadata: {
27
+ parse: (section: { object: Obj.Any }, type: string) => {
28
+ switch (type) {
29
+ case 'node':
30
+ return { id: section.object.id, label: (section.object as any).title, data: section.object };
31
+ case 'object':
32
+ return section.object;
33
+ case 'view-object':
34
+ return section;
35
+ }
38
36
  },
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
- ]);
37
+ },
38
+ }),
39
+ ],
40
+ }),
41
+ defineModule({
42
+ id: `${meta.id}/module/schema`,
43
+ activatesOn: ClientEvents.SetupSchema,
44
+ activate: () => contributes(ClientCapabilities.Schema, [StackViewType]),
45
+ }),
46
+ defineModule({
47
+ id: `${meta.id}/module/react-surface`,
48
+ activatesOn: Events.SetupReactSurface,
49
+ activate: ReactSurface,
50
+ }),
51
+ ]);
@@ -9,14 +9,14 @@ import { Obj } from '@dxos/echo';
9
9
  import { fullyQualifiedId } from '@dxos/react-client/echo';
10
10
  import { DataType } from '@dxos/schema';
11
11
 
12
- import { StackMain } from '../components';
13
- import { STACK_PLUGIN } from '../meta';
12
+ import { StackContainer } from '../components';
13
+ import { meta } from '../meta';
14
14
 
15
15
  export default () =>
16
16
  contributes(
17
17
  Capabilities.ReactSurface,
18
18
  createSurface({
19
- id: `${STACK_PLUGIN}/article`,
19
+ id: `${meta.id}/article`,
20
20
  role: 'article',
21
21
  filter: (data): data is { id?: string; subject: DataType.Collection } =>
22
22
  Obj.instanceOf(DataType.Collection, data.subject),
@@ -24,11 +24,7 @@ export default () =>
24
24
  // This allows the id to be overridden by the surface for situations where the id of the collection
25
25
  // is not the same as the id of what is being represented (e.g., a space with a root collection).
26
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
- );
27
+ return <StackContainer id={id ?? fullyQualifiedId(data.subject)} collection={data.subject} />;
32
28
  },
33
29
  }),
34
30
  );
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Option } from 'effect';
5
+ import * as Option from 'effect/Option';
6
6
  import React, { useCallback, useState } from 'react';
7
7
 
8
8
  import {
@@ -16,15 +16,13 @@ import {
16
16
  import { fullyQualifiedId, isLiveObject } from '@dxos/client/echo';
17
17
  import { Obj } from '@dxos/echo';
18
18
  import { SpaceAction } from '@dxos/plugin-space/types';
19
- import { Icon, Button, toLocalizedString, useTranslation } from '@dxos/react-ui';
19
+ import { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';
20
20
  import { AttentionProvider } from '@dxos/react-ui-attention';
21
- import { Stack } from '@dxos/react-ui-stack';
21
+ import { Stack, StackItem } from '@dxos/react-ui-stack';
22
22
  import { type DataType } from '@dxos/schema';
23
23
  import { isNonNullable } from '@dxos/util';
24
24
 
25
- import { StackContext } from './StackContext';
26
- import { StackSection } from './StackSection';
27
- import { STACK_PLUGIN } from '../meta';
25
+ import { meta } from '../meta';
28
26
  import {
29
27
  type AddSectionPosition,
30
28
  type CollapsedSections,
@@ -33,15 +31,18 @@ import {
33
31
  type StackSectionView,
34
32
  } from '../types';
35
33
 
36
- type StackMainProps = {
34
+ import { StackContext } from './StackContext';
35
+ import { StackSection } from './StackSection';
36
+
37
+ type StackContainerProps = {
37
38
  id: string;
38
39
  collection: DataType.Collection;
39
40
  };
40
41
 
41
- const StackMain = ({ id, collection }: StackMainProps) => {
42
+ const StackContainer = ({ id, collection }: StackContainerProps) => {
42
43
  const { dispatchPromise: dispatch } = useIntentDispatcher();
43
44
  const { graph } = useAppGraph();
44
- const { t } = useTranslation(STACK_PLUGIN);
45
+ const { t } = useTranslation(meta.id);
45
46
  const allMetadata = useCapabilities(Capabilities.Metadata);
46
47
  const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});
47
48
 
@@ -97,7 +98,7 @@ const StackMain = ({ id, collection }: StackMainProps) => {
97
98
  // TODO(wittjosiah): Use object creation dialog.
98
99
  createIntent(LayoutAction.UpdateDialog, {
99
100
  part: 'dialog',
100
- subject: `${STACK_PLUGIN}/AddSectionDialog`,
101
+ subject: `${meta.id}/AddSectionDialog`,
101
102
  options: {
102
103
  blockAlign: 'start',
103
104
  props: {
@@ -130,30 +131,31 @@ const StackMain = ({ id, collection }: StackMainProps) => {
130
131
  );
131
132
 
132
133
  return (
133
- <AttentionProvider id={id}>
134
- <StackContext.Provider
135
- value={{
136
- onCollapse: handleCollapse,
137
- onNavigate: handleNavigate,
138
- onDelete: handleDelete,
139
- onAdd: handleAdd,
140
- }}
141
- >
142
- <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack'>
143
- {items.map((item) => (
144
- <StackSection key={item.id} {...item} />
145
- ))}
146
- </Stack>
147
-
148
- <div role='none' className='flex mlb-2 pli-2 justify-center'>
149
- <Button data-testid='stack.createSection' classNames='gap-2' onClick={handleAddSection}>
150
- <Icon icon='ph--plus' />
151
- <span className='sr-only'>{t('add section label')}</span>
152
- </Button>
153
- </div>
154
- </StackContext.Provider>
155
- </AttentionProvider>
134
+ <StackItem.Content
135
+ toolbar
136
+ classNames='container-max-width overflow-hidden border-l border-r border-subduedSeparator'
137
+ >
138
+ <Toolbar.Root>
139
+ <Toolbar.IconButton icon='ph--plus--regular' iconOnly label='Add section' onClick={handleAddSection} />
140
+ </Toolbar.Root>
141
+ <AttentionProvider id={id}>
142
+ <StackContext.Provider
143
+ value={{
144
+ onCollapse: handleCollapse,
145
+ onNavigate: handleNavigate,
146
+ onDelete: handleDelete,
147
+ onAdd: handleAdd,
148
+ }}
149
+ >
150
+ <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack' classNames='overflow-y-auto'>
151
+ {items.map((item) => (
152
+ <StackSection key={item.id} {...item} />
153
+ ))}
154
+ </Stack>
155
+ </StackContext.Provider>
156
+ </AttentionProvider>
157
+ </StackItem.Content>
156
158
  );
157
159
  };
158
160
 
159
- export default StackMain;
161
+ export default StackContainer;
@@ -6,15 +6,16 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
6
6
  import React, { useMemo, useState } from 'react';
7
7
 
8
8
  import { Surface } from '@dxos/app-framework';
9
- import { DropdownMenu, Icon, useTranslation, IconButton } from '@dxos/react-ui';
9
+ import { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';
10
10
  import { useAttentionAttributes } from '@dxos/react-ui-attention';
11
11
  import { StackItem } from '@dxos/react-ui-stack';
12
- import { mx, getSize, textBlockWidth } from '@dxos/react-ui-theme';
12
+ import { getSize, mx, textBlockWidth } from '@dxos/react-ui-theme';
13
+
14
+ import { meta } from '../meta';
15
+ import { type StackSectionItem } from '../types';
13
16
 
14
17
  import { CaretDownUp } from './CaretDownUp';
15
18
  import { useStack } from './StackContext';
16
- import { STACK_PLUGIN } from '../meta';
17
- import { type StackSectionItem } from '../types';
18
19
 
19
20
  const sectionActionDimensions = 'p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min';
20
21
 
@@ -26,7 +27,7 @@ export const StackSection = ({
26
27
  object,
27
28
  metadata: { icon = 'ph--placeholder--regular' },
28
29
  }: StackSectionProps) => {
29
- const { t } = useTranslation(STACK_PLUGIN);
30
+ const { t } = useTranslation(meta.id);
30
31
  const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
31
32
  const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
32
33
  const attentionAttrs = useAttentionAttributes(id);
@@ -5,19 +5,26 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { Input, useTranslation } from '@dxos/react-ui';
8
- import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
8
+ import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
9
9
 
10
- import { STACK_PLUGIN } from '../meta';
10
+ import { meta } from '../meta';
11
11
  import { type StackSettingsProps } from '../types';
12
12
 
13
13
  export const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {
14
- const { t } = useTranslation(STACK_PLUGIN);
14
+ const { t } = useTranslation(meta.id);
15
15
 
16
16
  return (
17
- <DeprecatedFormContainer>
18
- <DeprecatedFormInput label={t('settings separation label')}>
19
- <Input.Switch checked={settings.separation} onCheckedChange={(checked) => (settings.separation = !!checked)} />
20
- </DeprecatedFormInput>
21
- </DeprecatedFormContainer>
17
+ <ControlPage>
18
+ <ControlSection title={t('settings title', { ns: meta.id })}>
19
+ <ControlGroup>
20
+ <ControlItemInput title={t('settings separation label')}>
21
+ <Input.Switch
22
+ checked={settings.separation}
23
+ onCheckedChange={(checked) => (settings.separation = !!checked)}
24
+ />
25
+ </ControlItemInput>
26
+ </ControlGroup>
27
+ </ControlSection>
28
+ </ControlPage>
22
29
  );
23
30
  };
@@ -4,6 +4,6 @@
4
4
 
5
5
  import { lazy } from 'react';
6
6
 
7
- export const StackMain = lazy(() => import('./StackMain'));
7
+ export const StackContainer = lazy(() => import('./StackContainer'));
8
8
 
9
9
  export * from './StackSettings';
package/src/meta.ts CHANGED
@@ -4,11 +4,10 @@
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
6
 
7
- export const STACK_PLUGIN = 'dxos.org/plugin/stack';
8
7
  export const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';
9
8
 
10
9
  export const meta: PluginMeta = {
11
- id: STACK_PLUGIN,
10
+ id: 'dxos.org/plugin/stack',
12
11
  // TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
13
12
  // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
14
13
  name: 'Collections',
@@ -12,6 +12,7 @@ export const translations = [
12
12
  'en-US': {
13
13
  [meta.id]: {
14
14
  'plugin name': 'Stacks',
15
+ 'settings title': 'Stack plugin settings',
15
16
  'settings separation label': 'Separate sections',
16
17
  'add section beforeAll dialog title': 'Add a section to the start',
17
18
  'add section afterAll dialog title': 'Add a section to the end',
@@ -2,9 +2,9 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
- import { TypedObject } from '@dxos/echo-schema';
7
+ import { TypedObject } from '@dxos/echo/internal';
8
8
 
9
9
  // All section metadata needs to be optional/have defaults.
10
10
  // Any objects added to the collection will start with the section defaults.
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/StackMain.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Option } from 'effect';\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 { Icon, Button, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { Stack } from '@dxos/react-ui-stack';\nimport { type DataType } from '@dxos/schema';\nimport { isNonNullable } from '@dxos/util';\n\nimport { StackContext } from './StackContext';\nimport { StackSection } from './StackSection';\nimport { STACK_PLUGIN } from '../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../types';\n\ntype StackMainProps = {\n id: string;\n collection: DataType.Collection;\n};\n\nconst StackMain = ({ id, collection }: StackMainProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { graph } = useAppGraph();\n const { t } = useTranslation(STACK_PLUGIN);\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: `${STACK_PLUGIN}/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 <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'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n\n <div role='none' className='flex mlb-2 pli-2 justify-center'>\n <Button data-testid='stack.createSection' classNames='gap-2' onClick={handleAddSection}>\n <Icon icon='ph--plus' />\n <span className='sr-only'>{t('add section label')}</span>\n </Button>\n </div>\n </StackContext.Provider>\n </AttentionProvider>\n );\n};\n\nexport default StackMain;\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, useTranslation, IconButton } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx, getSize, textBlockWidth } from '@dxos/react-ui-theme';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from './StackContext';\nimport { STACK_PLUGIN } from '../meta';\nimport { type StackSectionItem } from '../types';\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(STACK_PLUGIN);\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,SAASA,cAAc;AACvB,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,QAAAA,OAAMC,QAAQC,mBAAmBC,kBAAAA,uBAAsB;AAChE,SAASC,yBAAyB;AAClC,SAASC,aAAa;AAEtB,SAASC,qBAAqB;;;AClB9B,SAASC,eAAeC,kBAAkB;AAWnC,IAAMC,eAAeC,8BAAiC;EAC3DC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;EAAa;EACvBC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AY7E;MAAQ8E,eAAY;OAChE7D,MAAME,IAAI,CAAC4D,SACV,gBAAAb,OAAA,cAACc,cAAAA;MAAaC,KAAKF,KAAK/E;MAAK,GAAG+E;UAIpC,gBAAAb,OAAA,cAACgB,OAAAA;MAAIC,MAAK;MAAOC,WAAU;OACzB,gBAAAlB,OAAA,cAACmB,QAAAA;MAAOP,eAAY;MAAsBQ,YAAW;MAAQC,SAASxB;OACpE,gBAAAG,OAAA,cAACsB,OAAAA;MAAKC,MAAK;QACX,gBAAAvB,OAAA,cAACwB,QAAAA;MAAKN,WAAU;OAAW7E,EAAE,mBAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;AAMzC;AAEA,IAAA,oBAAeR;",
6
- "names": ["Option", "React", "useCallback", "useState", "Capabilities", "LayoutAction", "createIntent", "useAppGraph", "useCapabilities", "useIntentDispatcher", "fullyQualifiedId", "isLiveObject", "Obj", "SpaceAction", "Icon", "Button", "toLocalizedString", "useTranslation", "AttentionProvider", "Stack", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "useTranslation", "IconButton", "useAttentionAttributes", "StackItem", "mx", "getSize", "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", "STACK_PLUGIN", "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", "StackMain", "id", "collection", "dispatchPromise", "dispatch", "useIntentDispatcher", "graph", "useAppGraph", "t", "useTranslation", "STACK_PLUGIN", "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", "Option", "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", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "data-testid", "item", "StackSection", "key", "div", "role", "className", "Button", "classNames", "onClick", "Icon", "icon", "span"]
7
- }
@@ -1,7 +0,0 @@
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';\n\nexport const STACK_PLUGIN = 'dxos.org/plugin/stack';\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta: PluginMeta = {\n id: STACK_PLUGIN,\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: 'View collections of objects within the deck.',\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
5
- "mappings": ";AAMO,IAAMA,eAAe;AACrB,IAAMC,qBAAqB;AAE3B,IAAMC,OAAmB;EAC9BC,IAAIH;;;EAGJI,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;AACV;",
6
- "names": ["STACK_PLUGIN", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "icon", "source"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/stack.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { TypedObject } from '@dxos/echo-schema';\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,SAASA,cAAc;AAEvB,SAASC,mBAAmB;AAOrB,IAAMC,gBAAgBC,OAAOC,OAAO;EACzCC,QAAQF,OAAOG,SAASH,OAAOI,MAAM;;;EAGrCC,QAAQL,OAAOG,SAASH,OAAOM,OAAO;IAAEC,KAAKP,OAAOQ;IAAQC,OAAOT,OAAOU;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAN,cAA4BC,YAAY;EAC7CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,UAAUf,OAAOgB,QAAQhB,OAAOM,OAAO;IAAEC,KAAKP,OAAOQ;IAAQC,OAAOV;EAAc,CAAA,CAAA;AACpF,CAAA,EAAA;AAAI;",
6
- "names": ["Schema", "TypedObject", "SectionSchema", "Schema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "TypedObject", "typename", "version", "sections", "mutable"]
7
- }
@@ -1,7 +0,0 @@
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 { StackMain } from '../components';\nimport { STACK_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${STACK_PLUGIN}/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 (\n <div role='none' className='overflow-auto' style={{ contain: 'layout' }}>\n <StackMain id={id ?? fullyQualifiedId(data.subject)} collection={data.subject} />\n </div>\n );\n },\n }),\n );\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const StackMain = lazy(() => import('./StackMain'));\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 { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { type StackSettingsProps } from '../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(STACK_PLUGIN);\n\n return (\n <DeprecatedFormContainer>\n <DeprecatedFormInput label={t('settings separation label')}>\n <Input.Switch checked={settings.separation} onCheckedChange={(checked) => (settings.separation = !!checked)} />\n </DeprecatedFormInput>\n </DeprecatedFormContainer>\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,yBAAyBC,2BAA2B;;;ADDtD,IAAMC,YAAYC,KAAK,MAAM,OAAO,0BAAA,CAAA;;;ADQ3C,IAAA,wBAAe,MACbC,YACEC,aAAaC,cACbC,cAAc;EACZC,IAAI,GAAGC,YAAAA;EACPC,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,WACE,gBAAAC,OAAA,cAACC,OAAAA;MAAIX,MAAK;MAAOY,WAAU;MAAgBC,OAAO;QAAEC,SAAS;MAAS;OACpE,gBAAAJ,OAAA,cAACK,WAAAA;MAAUjB,IAAIA,MAAMkB,iBAAiBd,KAAKK,OAAO;MAAGU,YAAYf,KAAKK;;EAG5E;AACF,CAAA,CAAA;",
6
- "names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "fullyQualifiedId", "DataType", "lazy", "React", "Input", "useTranslation", "DeprecatedFormContainer", "DeprecatedFormInput", "StackMain", "lazy", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "STACK_PLUGIN", "role", "filter", "data", "Obj", "instanceOf", "DataType", "Collection", "subject", "component", "undefined", "React", "div", "className", "style", "contain", "StackMain", "fullyQualifiedId", "collection"]
7
- }