@dxos/plugin-testing 0.8.4-main.9735255 → 0.8.4-main.c351d160a8

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 (47) hide show
  1. package/dist/lib/browser/{chunk-YHPXIILW.mjs → chunk-NWOKPVNQ.mjs} +3 -3
  2. package/dist/lib/browser/{chunk-YHPXIILW.mjs.map → chunk-NWOKPVNQ.mjs.map} +1 -1
  3. package/dist/lib/browser/index.mjs +33 -30
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/{operation-resolver-B2DOYB7C.mjs → operation-resolver-SR4GZ7Q5.mjs} +11 -10
  7. package/dist/lib/browser/operation-resolver-SR4GZ7Q5.mjs.map +7 -0
  8. package/dist/lib/browser/{state-2M3RMJYA.mjs → state-TCYYH5JN.mjs} +5 -4
  9. package/dist/lib/browser/state-TCYYH5JN.mjs.map +7 -0
  10. package/dist/lib/node-esm/{chunk-OWK6XE6C.mjs → chunk-NWN7D2LS.mjs} +3 -3
  11. package/dist/lib/node-esm/{chunk-OWK6XE6C.mjs.map → chunk-NWN7D2LS.mjs.map} +1 -1
  12. package/dist/lib/node-esm/index.mjs +33 -30
  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/{operation-resolver-DJI7OPBP.mjs → operation-resolver-A6XLCTWX.mjs} +11 -10
  16. package/dist/lib/node-esm/operation-resolver-A6XLCTWX.mjs.map +7 -0
  17. package/dist/lib/node-esm/{state-UF2MWBFU.mjs → state-ZJEK6SP7.mjs} +5 -4
  18. package/dist/lib/node-esm/state-ZJEK6SP7.mjs.map +7 -0
  19. package/dist/types/src/StorybookPlugin.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/operation-resolver/index.d.ts +1 -1
  21. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
  23. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/state/index.d.ts +1 -1
  25. package/dist/types/src/capabilities/state/state.d.ts +1 -1
  26. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  27. package/dist/types/src/components/{Layout.d.ts → Layout/Layout.d.ts} +1 -1
  28. package/dist/types/src/components/Layout/Layout.d.ts.map +1 -0
  29. package/dist/types/src/components/Layout/index.d.ts +2 -0
  30. package/dist/types/src/components/Layout/index.d.ts.map +1 -0
  31. package/dist/types/src/core.d.ts +2 -1
  32. package/dist/types/src/core.d.ts.map +1 -1
  33. package/dist/types/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +20 -18
  35. package/src/StorybookPlugin.ts +13 -12
  36. package/src/capabilities/operation-resolver/operation-resolver.ts +9 -8
  37. package/src/capabilities/state/state.tsx +4 -6
  38. package/src/components/{Layout.tsx → Layout/Layout.tsx} +20 -16
  39. package/src/components/Layout/index.ts +5 -0
  40. package/src/core.ts +2 -1
  41. package/src/meta.ts +1 -1
  42. package/src/types/capabilities.ts +1 -1
  43. package/dist/lib/browser/operation-resolver-B2DOYB7C.mjs.map +0 -7
  44. package/dist/lib/browser/state-2M3RMJYA.mjs.map +0 -7
  45. package/dist/lib/node-esm/operation-resolver-DJI7OPBP.mjs.map +0 -7
  46. package/dist/lib/node-esm/state-UF2MWBFU.mjs.map +0 -7
  47. package/dist/types/src/components/Layout.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-testing",
3
- "version": "0.8.4-main.9735255",
3
+ "version": "0.8.4-main.c351d160a8",
4
4
  "description": "Plugin testing utils",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -25,33 +25,35 @@
25
25
  "src"
26
26
  ],
27
27
  "dependencies": {
28
- "@effect-atom/atom": "^0.4.13",
29
- "@effect-atom/atom-react": "^0.4.6",
30
- "@dxos/app-framework": "0.8.4-main.9735255",
31
- "@dxos/plugin-client": "0.8.4-main.9735255",
32
- "@dxos/operation": "0.8.4-main.9735255",
33
- "@dxos/plugin-attention": "0.8.4-main.9735255",
34
- "@dxos/react-ui-mosaic": "0.8.4-main.9735255",
35
- "@dxos/util": "0.8.4-main.9735255",
36
- "@dxos/plugin-theme": "0.8.4-main.9735255",
37
- "@dxos/plugin-graph": "0.8.4-main.9735255"
28
+ "@effect-atom/atom": "^0.5.1",
29
+ "@effect-atom/atom-react": "^0.5.0",
30
+ "@dxos/app-toolkit": "0.8.4-main.c351d160a8",
31
+ "@dxos/app-framework": "0.8.4-main.c351d160a8",
32
+ "@dxos/plugin-attention": "0.8.4-main.c351d160a8",
33
+ "@dxos/operation": "0.8.4-main.c351d160a8",
34
+ "@dxos/plugin-client": "0.8.4-main.c351d160a8",
35
+ "@dxos/plugin-settings": "0.8.4-main.c351d160a8",
36
+ "@dxos/plugin-graph": "0.8.4-main.c351d160a8",
37
+ "@dxos/react-ui-mosaic": "0.8.4-main.c351d160a8",
38
+ "@dxos/util": "0.8.4-main.c351d160a8",
39
+ "@dxos/plugin-theme": "0.8.4-main.c351d160a8"
38
40
  },
39
41
  "devDependencies": {
40
42
  "@types/react": "~19.2.7",
41
43
  "@types/react-dom": "~19.2.3",
42
- "effect": "3.19.11",
44
+ "effect": "3.19.16",
43
45
  "react": "~19.2.3",
44
46
  "react-dom": "~19.2.3",
45
- "vite": "7.1.9",
46
- "@dxos/react-ui": "0.8.4-main.9735255",
47
- "@dxos/ui-theme": "0.8.4-main.9735255"
47
+ "vite": "^7.1.11",
48
+ "@dxos/react-ui": "0.8.4-main.c351d160a8",
49
+ "@dxos/ui-theme": "0.8.4-main.c351d160a8"
48
50
  },
49
51
  "peerDependencies": {
50
- "effect": "3.19.11",
52
+ "effect": "3.19.16",
51
53
  "react": "~19.2.3",
52
54
  "react-dom": "~19.2.3",
53
- "@dxos/react-ui": "0.8.4-main.9735255",
54
- "@dxos/ui-theme": "0.8.4-main.9735255"
55
+ "@dxos/react-ui": "0.8.4-main.c351d160a8",
56
+ "@dxos/ui-theme": "0.8.4-main.c351d160a8"
55
57
  },
56
58
  "publishConfig": {
57
59
  "access": "public"
@@ -4,7 +4,8 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Capability, Common, Plugin } from '@dxos/app-framework';
7
+ import { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
8
+ import { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';
8
9
 
9
10
  import { OperationResolver, State } from './capabilities';
10
11
  import { Layout } from './components';
@@ -16,23 +17,23 @@ export type StorybookPluginOptions = {
16
17
  };
17
18
 
18
19
  export const StorybookPlugin = Plugin.define<StorybookPluginOptions>(meta).pipe(
19
- Plugin.addModule(({ initialState }) => ({
20
- id: Capability.getModuleTag(State),
21
- activatesOn: Common.ActivationEvent.Startup,
22
- activatesAfter: [Common.ActivationEvent.LayoutReady],
23
- activate: () => State({ initialState }),
24
- })),
25
- Common.Plugin.addReactContextModule({
20
+ AppPlugin.addOperationResolverModule({
21
+ activate: OperationResolver,
22
+ }),
23
+ AppPlugin.addReactContextModule({
26
24
  activate: () =>
27
25
  Effect.succeed(
28
- Capability.contributes(Common.Capability.ReactContext, {
26
+ Capability.contributes(Capabilities.ReactContext, {
29
27
  id: 'storybook-layout',
30
28
  context: Layout,
31
29
  }),
32
30
  ),
33
31
  }),
34
- Common.Plugin.addOperationResolverModule({
35
- activate: OperationResolver,
36
- }),
32
+ Plugin.addModule(({ initialState }) => ({
33
+ id: Capability.getModuleTag(State),
34
+ activatesOn: ActivationEvents.Startup,
35
+ activatesAfter: [AppActivationEvents.LayoutReady],
36
+ activate: () => State({ initialState }),
37
+ })),
37
38
  Plugin.make,
38
39
  );
@@ -4,14 +4,15 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Capability, Common } from '@dxos/app-framework';
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { LayoutOperation } from '@dxos/app-toolkit';
8
9
  import { OperationResolver } from '@dxos/operation';
9
10
 
10
11
  import { LayoutState, type LayoutStateProps } from '../../types';
11
12
 
12
13
  export default Capability.makeModule(
13
14
  Effect.fnUntraced(function* () {
14
- const registry = yield* Capability.get(Common.Capability.AtomRegistry);
15
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
15
16
  const stateAtom = yield* Capability.get(LayoutState);
16
17
 
17
18
  const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) => {
@@ -19,9 +20,9 @@ export default Capability.makeModule(
19
20
  registry.set(stateAtom, { ...current, ...fn(current) });
20
21
  };
21
22
 
22
- return Capability.contributes(Common.Capability.OperationResolver, [
23
+ return Capability.contributes(Capabilities.OperationResolver, [
23
24
  OperationResolver.make({
24
- operation: Common.LayoutOperation.UpdateSidebar,
25
+ operation: LayoutOperation.UpdateSidebar,
25
26
  handler: Effect.fnUntraced(function* ({ state }) {
26
27
  updateState((layout) => {
27
28
  const next = state ?? layout.sidebarState;
@@ -33,7 +34,7 @@ export default Capability.makeModule(
33
34
  }),
34
35
  }),
35
36
  OperationResolver.make({
36
- operation: Common.LayoutOperation.UpdateComplementary,
37
+ operation: LayoutOperation.UpdateComplementary,
37
38
  handler: Effect.fnUntraced(function* ({ state }) {
38
39
  updateState((layout) => {
39
40
  const next = state ?? layout.complementarySidebarState;
@@ -45,7 +46,7 @@ export default Capability.makeModule(
45
46
  }),
46
47
  }),
47
48
  OperationResolver.make({
48
- operation: Common.LayoutOperation.UpdateDialog,
49
+ operation: LayoutOperation.UpdateDialog,
49
50
  handler: Effect.fnUntraced(function* ({
50
51
  subject,
51
52
  state,
@@ -66,7 +67,7 @@ export default Capability.makeModule(
66
67
  }),
67
68
  }),
68
69
  OperationResolver.make({
69
- operation: Common.LayoutOperation.UpdatePopover,
70
+ operation: LayoutOperation.UpdatePopover,
70
71
  handler: Effect.fnUntraced(function* (input) {
71
72
  const { subject, state, side, kind, props } = input;
72
73
  updateState(() => {
@@ -88,7 +89,7 @@ export default Capability.makeModule(
88
89
  }),
89
90
  }),
90
91
  OperationResolver.make({
91
- operation: Common.LayoutOperation.SwitchWorkspace,
92
+ operation: LayoutOperation.SwitchWorkspace,
92
93
  handler: Effect.fnUntraced(function* ({ subject }) {
93
94
  updateState(() => ({ workspace: subject }));
94
95
  }),
@@ -5,7 +5,8 @@
5
5
  import { Atom } from '@effect-atom/atom-react';
6
6
  import * as Effect from 'effect/Effect';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capability } from '@dxos/app-framework';
9
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
10
 
10
11
  import { LayoutState, type LayoutStateProps } from '../../types';
11
12
 
@@ -21,7 +22,7 @@ export default Capability.makeModule(
21
22
  const { initialState } = props ?? {};
22
23
  const stateAtom = Atom.make<LayoutStateProps>({ ...defaultState, ...initialState });
23
24
 
24
- const layoutAtom = Atom.make((get): Common.Capability.Layout => {
25
+ const layoutAtom = Atom.make((get): AppCapabilities.Layout => {
25
26
  const state = get(stateAtom);
26
27
  return {
27
28
  mode: 'storybook',
@@ -35,9 +36,6 @@ export default Capability.makeModule(
35
36
  };
36
37
  });
37
38
 
38
- return [
39
- Capability.contributes(LayoutState, stateAtom),
40
- Capability.contributes(Common.Capability.Layout, layoutAtom),
41
- ];
39
+ return [Capability.contributes(LayoutState, stateAtom), Capability.contributes(AppCapabilities.Layout, layoutAtom)];
42
40
  }),
43
41
  );
@@ -5,7 +5,7 @@
5
5
  import { RegistryContext, useAtomValue } from '@effect-atom/atom-react';
6
6
  import React, { type PropsWithChildren, useCallback, useContext, useEffect, useRef, useState } from 'react';
7
7
 
8
- import { Surface, useCapability } from '@dxos/app-framework/react';
8
+ import { Surface, useCapability } from '@dxos/app-framework/ui';
9
9
  import {
10
10
  AlertDialog,
11
11
  Dialog,
@@ -15,11 +15,12 @@ import {
15
15
  toLocalizedString,
16
16
  useTranslation,
17
17
  } from '@dxos/react-ui';
18
- import { Card, Mosaic } from '@dxos/react-ui-mosaic';
18
+ import { Card } from '@dxos/react-ui';
19
+ import { Mosaic } from '@dxos/react-ui-mosaic';
19
20
  import { descriptionMessage, mx } from '@dxos/ui-theme';
20
21
 
21
- import { meta } from '../meta';
22
- import { LayoutState, type LayoutStateProps } from '../types';
22
+ import { meta } from '../../meta';
23
+ import { LayoutState, type LayoutStateProps } from '../../types';
23
24
 
24
25
  const debounce_delay = 100;
25
26
 
@@ -102,11 +103,11 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
102
103
  onOpenChange={(nextOpen) => updateState({ dialogOpen: nextOpen })}
103
104
  >
104
105
  {layout.dialogBlockAlign === 'end' ? (
105
- <Surface
106
+ <Surface.Surface
106
107
  role='dialog'
107
108
  data={layout.dialogContent}
108
109
  limit={1}
109
- fallback={ContentError}
110
+ fallback={ErrorFallback}
110
111
  placeholder={<div />}
111
112
  />
112
113
  ) : (
@@ -115,7 +116,7 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
115
116
  classNames={layout.dialogOverlayClasses}
116
117
  style={layout.dialogOverlayStyle}
117
118
  >
118
- <Surface role='dialog' data={layout.dialogContent} limit={1} fallback={ContentError} />
119
+ <Surface.Surface role='dialog' data={layout.dialogContent} limit={1} fallback={ErrorFallback} />
119
120
  </DialogOverlay>
120
121
  )}
121
122
  </DialogRoot>
@@ -140,12 +141,14 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
140
141
  ) : (
141
142
  <span />
142
143
  )}
143
- <Card.Close onClick={handleClose} />
144
+ <Card.CloseIconButton onClick={handleClose} />
144
145
  </Card.Toolbar>
145
- <Surface role='card--content' data={layout.popoverContent} limit={1} />
146
+ <Surface.Surface role='card--content' data={layout.popoverContent} limit={1} />
146
147
  </Card.Root>
147
148
  )}
148
- {layout.popoverKind === 'base' && <Surface role='popover' data={layout.popoverContent} limit={1} />}
149
+ {layout.popoverKind === 'base' && (
150
+ <Surface.Surface role='popover' data={layout.popoverContent} limit={1} />
151
+ )}
149
152
  </Popover.Viewport>
150
153
  <Popover.Arrow />
151
154
  </Popover.Content>
@@ -156,15 +159,16 @@ export const Layout = ({ children }: PropsWithChildren<{}>) => {
156
159
  );
157
160
  };
158
161
 
159
- export const ContentError = ({ error }: { error?: Error }) => {
162
+ export const ErrorFallback = ({ error }: { error?: Error }) => {
160
163
  const { t } = useTranslation(meta.id);
161
164
  const errorString = error?.toString() ?? '';
162
165
  return (
163
- <div role='none' className='overflow-auto p-8 attention-surface grid place-items-center'>
164
- <p
165
- role='alert'
166
- className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}
167
- >
166
+ <div
167
+ role='alert'
168
+ data-testid='error-boundary-fallback'
169
+ className={mx('overflow-auto p-8 dx-attention-surface grid place-items-center')}
170
+ >
171
+ <p className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}>
168
172
  {error ? errorString : t('error fallback message')}
169
173
  </p>
170
174
  </div>
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export * from './Layout';
package/src/core.ts CHANGED
@@ -2,10 +2,11 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { OperationPlugin, type Plugin, RuntimePlugin, SettingsPlugin } from '@dxos/app-framework';
5
+ import { OperationPlugin, type Plugin, RuntimePlugin } from '@dxos/app-framework';
6
6
  import { AttentionPlugin } from '@dxos/plugin-attention';
7
7
  import { ClientPlugin } from '@dxos/plugin-client';
8
8
  import { GraphPlugin } from '@dxos/plugin-graph';
9
+ import { SettingsPlugin } from '@dxos/plugin-settings';
9
10
  import { ThemePlugin } from '@dxos/plugin-theme';
10
11
  import { defaultTx } from '@dxos/ui-theme';
11
12
 
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/storybook-layout',
9
+ id: 'org.dxos.plugin.storybook-layout',
10
10
  name: 'Storybook',
11
11
  description: trim`
12
12
  Development layout optimized for Storybook component testing and documentation.
@@ -33,4 +33,4 @@ export type LayoutStateProps = {
33
33
  workspace: string;
34
34
  };
35
35
 
36
- export const LayoutState = Capability.make<Atom.Writable<LayoutStateProps>>(`${meta.id}/state`);
36
+ export const LayoutState = Capability.make<Atom.Writable<LayoutStateProps>>(`${meta.id}.state`);
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Common.Capability.AtomRegistry);\n const stateAtom = yield* Capability.get(LayoutState);\n\n const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) => {\n const current = registry.get(stateAtom);\n registry.set(stateAtom, { ...current, ...fn(current) });\n };\n\n return Capability.contributes(Common.Capability.OperationResolver, [\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateSidebar,\n handler: Effect.fnUntraced(function* ({ state }) {\n updateState((layout) => {\n const next = state ?? layout.sidebarState;\n if (next !== layout.sidebarState) {\n return { sidebarState: next };\n }\n return {};\n });\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateComplementary,\n handler: Effect.fnUntraced(function* ({ state }) {\n updateState((layout) => {\n const next = state ?? layout.complementarySidebarState;\n if (next !== layout.complementarySidebarState) {\n return { complementarySidebarState: next };\n }\n return {};\n });\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateDialog,\n handler: Effect.fnUntraced(function* ({\n subject,\n state,\n type,\n blockAlign,\n overlayClasses,\n overlayStyle,\n props,\n }) {\n updateState(() => ({\n dialogOpen: state ?? Boolean(subject),\n dialogType: type ?? 'default',\n dialogBlockAlign: blockAlign ?? 'center',\n dialogOverlayClasses: overlayClasses,\n dialogOverlayStyle: overlayStyle,\n dialogContent: subject ? { component: subject, props } : null,\n }));\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdatePopover,\n handler: Effect.fnUntraced(function* (input) {\n const { subject, state, side, kind, props } = input;\n updateState(() => {\n const base: Partial<LayoutStateProps> = {\n popoverKind: kind ?? 'base',\n popoverTitle: kind === 'card' ? input.title : undefined,\n popoverContent:\n typeof subject === 'string' ? { component: subject, props } : subject ? { subject } : undefined,\n popoverOpen: state ?? Boolean(subject),\n popoverSide: side,\n };\n if ('variant' in input && input.variant === 'virtual') {\n return { ...base, popoverVariant: 'virtual', popoverAnchor: input.anchor };\n } else if ('anchorId' in input) {\n return { ...base, popoverVariant: 'react', popoverAnchorId: input.anchorId };\n }\n return base;\n });\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.SwitchWorkspace,\n handler: Effect.fnUntraced(function* ({ subject }) {\n updateState(() => ({ workspace: subject }));\n }),\n }),\n ]);\n }),\n);\n"],
5
- "mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,YAAY;AACrE,QAAMC,YAAY,OAAOP,WAAWI,IAAII,WAAAA;AAExC,QAAMC,cAAc,CAACC,OAAAA;AACnB,UAAMC,UAAUR,SAASC,IAAIG,SAAAA;AAC7BJ,aAASS,IAAIL,WAAW;MAAE,GAAGI;MAAS,GAAGD,GAAGC,OAAAA;IAAS,CAAA;EACvD;AAEA,SAAOX,WAAWa,YAAYR,OAAOL,WAAWc,mBAAmB;IACjEA,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OAAOvB,YAAY,WAAW;cAAEa,WAAWb;cAASK;YAAM,IAAIL,UAAU;cAAEA;YAAQ,IAAIsB;YACxFE,aAAa/B,SAASc,QAAQP,OAAAA;YAC9ByB,aAAaT;UACf;AACA,cAAI,aAAaD,SAASA,MAAMW,YAAY,WAAW;AACrD,mBAAO;cAAE,GAAGR;cAAMS,gBAAgB;cAAWC,eAAeb,MAAMc;YAAO;UAC3E,WAAW,cAAcd,OAAO;AAC9B,mBAAO;cAAE,GAAGG;cAAMS,gBAAgB;cAASG,iBAAiBf,MAAMgB;YAAS;UAC7E;AACA,iBAAOb;QACT,CAAA;MACF,CAAA;IACF,CAAA;IACA/B,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgB0C;MAClCxC,SAAgBjB,kBAAW,WAAW,EAAEyB,QAAO,GAAE;AAC/ClB,oBAAY,OAAO;UAAEmD,WAAWjC;QAAQ,EAAA;MAC1C,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
6
- "names": ["Effect", "Capability", "Common", "OperationResolver", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "stateAtom", "LayoutState", "updateState", "fn", "current", "set", "contributes", "OperationResolver", "make", "operation", "LayoutOperation", "UpdateSidebar", "handler", "state", "layout", "next", "sidebarState", "UpdateComplementary", "complementarySidebarState", "UpdateDialog", "subject", "type", "blockAlign", "overlayClasses", "overlayStyle", "props", "dialogOpen", "Boolean", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "dialogContent", "component", "UpdatePopover", "input", "side", "kind", "base", "popoverKind", "popoverTitle", "title", "undefined", "popoverContent", "popoverOpen", "popoverSide", "variant", "popoverVariant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId", "SwitchWorkspace", "workspace"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/state/state.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\n\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nconst defaultState: LayoutStateProps = {\n sidebarState: 'closed',\n complementarySidebarState: 'closed',\n dialogOpen: false,\n workspace: 'default',\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* (props?: { initialState?: Partial<LayoutStateProps> }) {\n const { initialState } = props ?? {};\n const stateAtom = Atom.make<LayoutStateProps>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): Common.Capability.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'storybook',\n dialogOpen: state.dialogOpen,\n sidebarOpen: state.sidebarState === 'expanded',\n complementarySidebarOpen: state.complementarySidebarState === 'expanded',\n workspace: state.workspace,\n active: [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [\n Capability.contributes(LayoutState, stateAtom),\n Capability.contributes(Common.Capability.Layout, layoutAtom),\n ];\n }),\n);\n"],
5
- "mappings": ";;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AAInC,IAAMC,eAAiC;EACrCC,cAAc;EACdC,2BAA2B;EAC3BC,YAAY;EACZC,WAAW;AACb;AAEA,IAAA,gBAAeC,WAAWC,WACjBC,kBAAW,WAAWC,OAAoD;AAC/E,QAAM,EAAEC,aAAY,IAAKD,SAAS,CAAC;AACnC,QAAME,YAAYC,KAAKC,KAAuB;IAAE,GAAGZ;IAAc,GAAGS;EAAa,CAAA;AAEjF,QAAMI,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNb,YAAYY,MAAMZ;MAClBc,aAAaF,MAAMd,iBAAiB;MACpCiB,0BAA0BH,MAAMb,8BAA8B;MAC9DE,WAAWW,MAAMX;MACjBe,QAAQ,CAAA;MACRC,UAAU,CAAA;MACVC,gBAAgBC;IAClB;EACF,CAAA;AAEA,SAAO;IACLjB,WAAWkB,YAAYC,aAAad,SAAAA;IACpCL,WAAWkB,YAAYE,OAAOpB,WAAWqB,QAAQb,UAAAA;;AAErD,CAAA,CAAA;",
6
- "names": ["Atom", "Effect", "Capability", "Common", "defaultState", "sidebarState", "complementarySidebarState", "dialogOpen", "workspace", "Capability", "makeModule", "fnUntraced", "props", "initialState", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "undefined", "contributes", "LayoutState", "Common", "Layout"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { OperationResolver } from '@dxos/operation';\n\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Common.Capability.AtomRegistry);\n const stateAtom = yield* Capability.get(LayoutState);\n\n const updateState = (fn: (state: LayoutStateProps) => Partial<LayoutStateProps>) => {\n const current = registry.get(stateAtom);\n registry.set(stateAtom, { ...current, ...fn(current) });\n };\n\n return Capability.contributes(Common.Capability.OperationResolver, [\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateSidebar,\n handler: Effect.fnUntraced(function* ({ state }) {\n updateState((layout) => {\n const next = state ?? layout.sidebarState;\n if (next !== layout.sidebarState) {\n return { sidebarState: next };\n }\n return {};\n });\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateComplementary,\n handler: Effect.fnUntraced(function* ({ state }) {\n updateState((layout) => {\n const next = state ?? layout.complementarySidebarState;\n if (next !== layout.complementarySidebarState) {\n return { complementarySidebarState: next };\n }\n return {};\n });\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateDialog,\n handler: Effect.fnUntraced(function* ({\n subject,\n state,\n type,\n blockAlign,\n overlayClasses,\n overlayStyle,\n props,\n }) {\n updateState(() => ({\n dialogOpen: state ?? Boolean(subject),\n dialogType: type ?? 'default',\n dialogBlockAlign: blockAlign ?? 'center',\n dialogOverlayClasses: overlayClasses,\n dialogOverlayStyle: overlayStyle,\n dialogContent: subject ? { component: subject, props } : null,\n }));\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdatePopover,\n handler: Effect.fnUntraced(function* (input) {\n const { subject, state, side, kind, props } = input;\n updateState(() => {\n const base: Partial<LayoutStateProps> = {\n popoverKind: kind ?? 'base',\n popoverTitle: kind === 'card' ? input.title : undefined,\n popoverContent:\n typeof subject === 'string' ? { component: subject, props } : subject ? { subject } : undefined,\n popoverOpen: state ?? Boolean(subject),\n popoverSide: side,\n };\n if ('variant' in input && input.variant === 'virtual') {\n return { ...base, popoverVariant: 'virtual', popoverAnchor: input.anchor };\n } else if ('anchorId' in input) {\n return { ...base, popoverVariant: 'react', popoverAnchorId: input.anchorId };\n }\n return base;\n });\n }),\n }),\n OperationResolver.make({\n operation: Common.LayoutOperation.SwitchWorkspace,\n handler: Effect.fnUntraced(function* ({ subject }) {\n updateState(() => ({ workspace: subject }));\n }),\n }),\n ]);\n }),\n);\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,yBAAyB;AAIlC,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,YAAY;AACrE,QAAMC,YAAY,OAAOP,WAAWI,IAAII,WAAAA;AAExC,QAAMC,cAAc,CAACC,OAAAA;AACnB,UAAMC,UAAUR,SAASC,IAAIG,SAAAA;AAC7BJ,aAASS,IAAIL,WAAW;MAAE,GAAGI;MAAS,GAAGD,GAAGC,OAAAA;IAAS,CAAA;E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QAAQ;YACrBG,cAAcH,SAAS,SAASF,MAAMM,QAAQC;YAC9CC,gBACE,OAAOvB,YAAY,WAAW;cAAEa,WAAWb;cAASK;YAAM,IAAIL,UAAU;cAAEA;YAAQ,IAAIsB;YACxFE,aAAa/B,SAASc,QAAQP,OAAAA;YAC9ByB,aAAaT;UACf;AACA,cAAI,aAAaD,SAASA,MAAMW,YAAY,WAAW;AACrD,mBAAO;cAAE,GAAGR;cAAMS,gBAAgB;cAAWC,eAAeb,MAAMc;YAAO;UAC3E,WAAW,cAAcd,OAAO;AAC9B,mBAAO;cAAE,GAAGG;cAAMS,gBAAgB;cAASG,iBAAiBf,MAAMgB;YAAS;UAC7E;AACA,iBAAOb;QACT,CAAA;MACF,CAAA;IACF,CAAA;IACA/B,kBAAkBC,KAAK;MACrBC,WAAWX,OAAOY,gBAAgB0C;MAClCxC,SAAgBjB,kBAAW,WAAW,EAAEyB,QAAO,GAAE;AAC/ClB,oBAAY,OAAO;UAAEmD,WAAWjC;QAAQ,EAAA;MAC1C,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
6
- "names": ["Effect", "Capability", "Common", "OperationResolver", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "stateAtom", "LayoutState", "updateState", "fn", "current", "set", "contributes", "OperationResolver", "make", "operation", "LayoutOperation", "UpdateSidebar", "handler", "state", "layout", "next", "sidebarState", "UpdateComplementary", "complementarySidebarState", "UpdateDialog", "subject", "type", "blockAlign", "overlayClasses", "overlayStyle", "props", "dialogOpen", "Boolean", "dialogType", "dialogBlockAlign", "dialogOverlayClasses", "dialogOverlayStyle", "dialogContent", "component", "UpdatePopover", "input", "side", "kind", "base", "popoverKind", "popoverTitle", "title", "undefined", "popoverContent", "popoverOpen", "popoverSide", "variant", "popoverVariant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId", "SwitchWorkspace", "workspace"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/state/state.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\n\nimport { LayoutState, type LayoutStateProps } from '../../types';\n\nconst defaultState: LayoutStateProps = {\n sidebarState: 'closed',\n complementarySidebarState: 'closed',\n dialogOpen: false,\n workspace: 'default',\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* (props?: { initialState?: Partial<LayoutStateProps> }) {\n const { initialState } = props ?? {};\n const stateAtom = Atom.make<LayoutStateProps>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): Common.Capability.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'storybook',\n dialogOpen: state.dialogOpen,\n sidebarOpen: state.sidebarState === 'expanded',\n complementarySidebarOpen: state.complementarySidebarState === 'expanded',\n workspace: state.workspace,\n active: [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [\n Capability.contributes(LayoutState, stateAtom),\n Capability.contributes(Common.Capability.Layout, layoutAtom),\n ];\n }),\n);\n"],
5
- "mappings": ";;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AAInC,IAAMC,eAAiC;EACrCC,cAAc;EACdC,2BAA2B;EAC3BC,YAAY;EACZC,WAAW;AACb;AAEA,IAAA,gBAAeC,WAAWC,WACjBC,kBAAW,WAAWC,OAAoD;AAC/E,QAAM,EAAEC,aAAY,IAAKD,SAAS,CAAC;AACnC,QAAME,YAAYC,KAAKC,KAAuB;IAAE,GAAGZ;IAAc,GAAGS;EAAa,CAAA;AAEjF,QAAMI,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNb,YAAYY,MAAMZ;MAClBc,aAAaF,MAAMd,iBAAiB;MACpCiB,0BAA0BH,MAAMb,8BAA8B;MAC9DE,WAAWW,MAAMX;MACjBe,QAAQ,CAAA;MACRC,UAAU,CAAA;MACVC,gBAAgBC;IAClB;EACF,CAAA;AAEA,SAAO;IACLjB,WAAWkB,YAAYC,aAAad,SAAAA;IACpCL,WAAWkB,YAAYE,OAAOpB,WAAWqB,QAAQb,UAAAA;;AAErD,CAAA,CAAA;",
6
- "names": ["Atom", "Effect", "Capability", "Common", "defaultState", "sidebarState", "complementarySidebarState", "dialogOpen", "workspace", "Capability", "makeModule", "fnUntraced", "props", "initialState", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "undefined", "contributes", "LayoutState", "Common", "Layout"]
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAwD,MAAM,OAAO,CAAC;AAqB5G,eAAO,MAAM,MAAM,GAAI,cAAc,iBAAiB,CAAC,EAAE,CAAC,sBAkIzD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,WAAW;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,sBAaxD,CAAC"}