@dxos/plugin-simple-layout 0.8.4-main.937b3ca → 0.8.4-main.bc674ce

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 (83) hide show
  1. package/dist/lib/browser/{chunk-FK4M7GJV.mjs → chunk-LR3EE3VB.mjs} +298 -122
  2. package/dist/lib/browser/chunk-LR3EE3VB.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-CLPGTNWJ.mjs → chunk-P77G4YTR.mjs} +1 -1
  4. package/dist/lib/browser/chunk-P77G4YTR.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +13 -7
  6. package/dist/lib/browser/index.mjs.map +2 -2
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/{operation-resolver-LTB63NKP.mjs → operation-resolver-775UYAC2.mjs} +50 -15
  9. package/dist/lib/browser/operation-resolver-775UYAC2.mjs.map +7 -0
  10. package/dist/lib/browser/{react-root-6ARAPH3O.mjs → react-root-KM55OMGJ.mjs} +3 -3
  11. package/dist/lib/browser/{react-surface-SO7B23GS.mjs → react-surface-BABGAWGY.mjs} +3 -3
  12. package/dist/lib/browser/{state-H4IGICBB.mjs → state-OUFTC2KV.mjs} +5 -3
  13. package/dist/lib/browser/state-OUFTC2KV.mjs.map +7 -0
  14. package/dist/lib/browser/{url-handler-7CFGTLNG.mjs → url-handler-DOUFQIAC.mjs} +2 -2
  15. package/dist/lib/node-esm/{chunk-MUVVYBUE.mjs → chunk-F5TEKVJG.mjs} +1 -1
  16. package/dist/lib/node-esm/chunk-F5TEKVJG.mjs.map +7 -0
  17. package/dist/lib/node-esm/{chunk-EGFZAVBD.mjs → chunk-HB2B3LLG.mjs} +298 -122
  18. package/dist/lib/node-esm/chunk-HB2B3LLG.mjs.map +7 -0
  19. package/dist/lib/node-esm/index.mjs +13 -7
  20. package/dist/lib/node-esm/index.mjs.map +2 -2
  21. package/dist/lib/node-esm/meta.json +1 -1
  22. package/dist/lib/node-esm/{operation-resolver-7O6O7T4Q.mjs → operation-resolver-LDNYS3DI.mjs} +50 -15
  23. package/dist/lib/node-esm/operation-resolver-LDNYS3DI.mjs.map +7 -0
  24. package/dist/lib/node-esm/{react-root-2CPA2ZUS.mjs → react-root-36UYFEEB.mjs} +3 -3
  25. package/dist/lib/node-esm/{react-surface-FKAV56MO.mjs → react-surface-CGHFVWU3.mjs} +3 -3
  26. package/dist/lib/node-esm/{state-QIU2LMLT.mjs → state-Q2ZA26W5.mjs} +5 -3
  27. package/dist/lib/node-esm/state-Q2ZA26W5.mjs.map +7 -0
  28. package/dist/lib/node-esm/{url-handler-4LYP3JM7.mjs → url-handler-DVAZZEUO.mjs} +2 -2
  29. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
  31. package/dist/types/src/components/ContentError.stories.d.ts +6 -0
  32. package/dist/types/src/components/ContentError.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/SimpleLayout/Banner.d.ts.map +1 -1
  34. package/dist/types/src/components/SimpleLayout/Drawer.d.ts +9 -0
  35. package/dist/types/src/components/SimpleLayout/Drawer.d.ts.map +1 -0
  36. package/dist/types/src/components/SimpleLayout/Main.d.ts +1 -1
  37. package/dist/types/src/components/SimpleLayout/Main.d.ts.map +1 -1
  38. package/dist/types/src/components/SimpleLayout/NavBar.d.ts +5 -2
  39. package/dist/types/src/components/SimpleLayout/NavBar.d.ts.map +1 -1
  40. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts +10 -6
  41. package/dist/types/src/components/SimpleLayout/NavBar.stories.d.ts.map +1 -1
  42. package/dist/types/src/components/SimpleLayout/SimpleLayout.d.ts.map +1 -1
  43. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts +10 -0
  44. package/dist/types/src/components/SimpleLayout/SimpleLayout.stories.d.ts.map +1 -1
  45. package/dist/types/src/components/hooks.d.ts.map +1 -1
  46. package/dist/types/src/hooks/index.d.ts +1 -0
  47. package/dist/types/src/hooks/index.d.ts.map +1 -1
  48. package/dist/types/src/hooks/useCompanions.d.ts +8 -0
  49. package/dist/types/src/hooks/useCompanions.d.ts.map +1 -0
  50. package/dist/types/src/translations.d.ts +6 -0
  51. package/dist/types/src/translations.d.ts.map +1 -1
  52. package/dist/types/src/types/capabilities.d.ts +5 -1
  53. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +23 -23
  56. package/src/capabilities/operation-resolver/operation-resolver.ts +50 -13
  57. package/src/capabilities/state/state.tsx +2 -0
  58. package/src/components/SimpleLayout/Banner.tsx +35 -4
  59. package/src/components/SimpleLayout/Drawer.tsx +151 -0
  60. package/src/components/SimpleLayout/Main.tsx +31 -40
  61. package/src/components/SimpleLayout/NavBar.stories.tsx +0 -3
  62. package/src/components/SimpleLayout/NavBar.tsx +29 -37
  63. package/src/components/SimpleLayout/SimpleLayout.stories.tsx +4 -0
  64. package/src/components/SimpleLayout/SimpleLayout.tsx +26 -6
  65. package/src/components/hooks.ts +8 -12
  66. package/src/hooks/index.ts +1 -0
  67. package/src/hooks/useCompanions.ts +19 -0
  68. package/src/translations.ts +6 -0
  69. package/src/types/capabilities.ts +6 -1
  70. package/dist/lib/browser/chunk-CLPGTNWJ.mjs.map +0 -7
  71. package/dist/lib/browser/chunk-FK4M7GJV.mjs.map +0 -7
  72. package/dist/lib/browser/operation-resolver-LTB63NKP.mjs.map +0 -7
  73. package/dist/lib/browser/state-H4IGICBB.mjs.map +0 -7
  74. package/dist/lib/node-esm/chunk-EGFZAVBD.mjs.map +0 -7
  75. package/dist/lib/node-esm/chunk-MUVVYBUE.mjs.map +0 -7
  76. package/dist/lib/node-esm/operation-resolver-7O6O7T4Q.mjs.map +0 -7
  77. package/dist/lib/node-esm/state-QIU2LMLT.mjs.map +0 -7
  78. /package/dist/lib/browser/{react-root-6ARAPH3O.mjs.map → react-root-KM55OMGJ.mjs.map} +0 -0
  79. /package/dist/lib/browser/{react-surface-SO7B23GS.mjs.map → react-surface-BABGAWGY.mjs.map} +0 -0
  80. /package/dist/lib/browser/{url-handler-7CFGTLNG.mjs.map → url-handler-DOUFQIAC.mjs.map} +0 -0
  81. /package/dist/lib/node-esm/{react-root-2CPA2ZUS.mjs.map → react-root-36UYFEEB.mjs.map} +0 -0
  82. /package/dist/lib/node-esm/{react-surface-FKAV56MO.mjs.map → react-surface-CGHFVWU3.mjs.map} +0 -0
  83. /package/dist/lib/node-esm/{url-handler-4LYP3JM7.mjs.map → url-handler-DVAZZEUO.mjs.map} +0 -0
@@ -1,12 +1,20 @@
1
1
  import {
2
2
  SimpleLayoutState
3
- } from "./chunk-CLPGTNWJ.mjs";
3
+ } from "./chunk-P77G4YTR.mjs";
4
4
 
5
5
  // src/capabilities/operation-resolver/operation-resolver.ts
6
6
  import * as Effect from "effect/Effect";
7
7
  import { Capability, Common } from "@dxos/app-framework";
8
8
  import { Operation, OperationResolver } from "@dxos/operation";
9
+ import { ATTENDABLE_PATH_SEPARATOR } from "@dxos/react-ui-attention";
9
10
  var MAX_HISTORY_LENGTH = 50;
11
+ var parseEntryId = (entryId) => {
12
+ const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);
13
+ return {
14
+ id,
15
+ variant
16
+ };
17
+ };
10
18
  var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
11
19
  const registry = yield* Capability.get(Common.Capability.AtomRegistry);
12
20
  const stateAtom = yield* Capability.get(SimpleLayoutState);
@@ -15,6 +23,15 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
15
23
  registry.set(stateAtom, fn(getState()));
16
24
  };
17
25
  return Capability.contributes(Common.Capability.OperationResolver, [
26
+ //
27
+ // SetLayoutMode
28
+ //
29
+ // TODO(burdon): No-op for to fix startup bug?
30
+ OperationResolver.make({
31
+ operation: Common.LayoutOperation.SetLayoutMode,
32
+ handler: Effect.fnUntraced(function* () {
33
+ })
34
+ }),
18
35
  //
19
36
  // UpdateSidebar - No-op for simple layout.
20
37
  //
@@ -23,11 +40,18 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
23
40
  handler: () => Effect.void
24
41
  }),
25
42
  //
26
- // UpdateComplementary - No-op for simple layout.
43
+ // UpdateComplementary - Controls companion drawer.
27
44
  //
28
45
  OperationResolver.make({
29
46
  operation: Common.LayoutOperation.UpdateComplementary,
30
- handler: () => Effect.void
47
+ handler: Effect.fnUntraced(function* (input) {
48
+ if (input.state === "closed") {
49
+ updateState((state) => ({
50
+ ...state,
51
+ drawerState: "closed"
52
+ }));
53
+ }
54
+ })
31
55
  }),
32
56
  //
33
57
  // UpdateDialog
@@ -109,18 +133,29 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
109
133
  OperationResolver.make({
110
134
  operation: Common.LayoutOperation.Open,
111
135
  handler: Effect.fnUntraced(function* (input) {
112
- updateState((state) => {
113
- const newHistory = state.active ? [
114
- ...state.history,
115
- state.active
116
- ] : state.history;
117
- const trimmedHistory = newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;
118
- return {
136
+ const id = input.subject[0];
137
+ const { variant } = parseEntryId(id);
138
+ if (variant) {
139
+ updateState((state) => ({
119
140
  ...state,
120
- active: input.subject[0],
121
- history: trimmedHistory
122
- };
123
- });
141
+ companionVariant: variant,
142
+ // Open drawer if closed, otherwise preserve current state (expanded/full).
143
+ drawerState: state.drawerState === "closed" || !state.drawerState ? "expanded" : state.drawerState
144
+ }));
145
+ } else {
146
+ updateState((state) => {
147
+ const newHistory = state.active ? [
148
+ ...state.history,
149
+ state.active
150
+ ] : state.history;
151
+ const trimmedHistory = newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;
152
+ return {
153
+ ...state,
154
+ active: id,
155
+ history: trimmedHistory
156
+ };
157
+ });
158
+ }
124
159
  })
125
160
  }),
126
161
  //
@@ -165,4 +200,4 @@ var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(functio
165
200
  export {
166
201
  operation_resolver_default as default
167
202
  };
168
- //# sourceMappingURL=operation-resolver-LTB63NKP.mjs.map
203
+ //# sourceMappingURL=operation-resolver-775UYAC2.mjs.map
@@ -0,0 +1,7 @@
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 { Operation, OperationResolver } from '@dxos/operation';\nimport { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';\n\nimport { type SimpleLayoutState, SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\n/** Maximum number of items to keep in navigation history. */\nconst MAX_HISTORY_LENGTH = 50;\n\n/** Parse entry ID to extract primary ID and variant. */\nconst parseEntryId = (entryId: string) => {\n const [id, variant] = entryId.split(ATTENDABLE_PATH_SEPARATOR);\n return { id, variant };\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Common.Capability.AtomRegistry);\n const stateAtom = yield* Capability.get(SimpleLayoutStateCapability);\n\n const getState = () => registry.get(stateAtom);\n const updateState = (fn: (current: SimpleLayoutState) => SimpleLayoutState) => {\n registry.set(stateAtom, fn(getState()));\n };\n\n return Capability.contributes(Common.Capability.OperationResolver, [\n //\n // SetLayoutMode\n //\n // TODO(burdon): No-op for to fix startup bug?\n OperationResolver.make({\n operation: Common.LayoutOperation.SetLayoutMode,\n handler: Effect.fnUntraced(function* () {}),\n }),\n\n //\n // UpdateSidebar - No-op for simple layout.\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateSidebar,\n handler: () => Effect.void,\n }),\n\n //\n // UpdateComplementary - Controls companion drawer.\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateComplementary,\n handler: Effect.fnUntraced(function* (input) {\n if (input.state === 'closed') {\n updateState((state) => ({\n ...state,\n drawerState: 'closed',\n }));\n }\n }),\n }),\n\n //\n // UpdateDialog\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdateDialog,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n dialogOpen: input.state ?? Boolean(input.subject),\n dialogType: input.type ?? 'default',\n dialogBlockAlign: input.blockAlign ?? 'center',\n dialogOverlayClasses: input.overlayClasses,\n dialogOverlayStyle: input.overlayStyle,\n dialogContent: input.subject ? { component: input.subject, props: input.props } : undefined,\n }));\n }),\n }),\n\n //\n // UpdatePopover\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.UpdatePopover,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n popoverOpen: input.state ?? Boolean(input.subject),\n popoverKind: input.kind ?? 'base',\n popoverTitle: input.kind === 'card' ? input.title : undefined,\n popoverContent:\n typeof input.subject === 'string'\n ? { component: input.subject, props: input.props }\n : input.subject\n ? { subject: input.subject }\n : undefined,\n popoverSide: input.side,\n popoverVariant: input.variant,\n popoverAnchor: input.variant === 'virtual' ? input.anchor : state.popoverAnchor,\n popoverAnchorId: input.variant !== 'virtual' ? input.anchorId : state.popoverAnchorId,\n }));\n }),\n }),\n\n //\n // SwitchWorkspace\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.SwitchWorkspace,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n // Ideally this should be worked into the data model in a generic way.\n previousWorkspace: !state.workspace.startsWith('!') ? state.workspace : state.previousWorkspace,\n workspace: input.subject,\n active: undefined,\n // Clear history when switching workspaces.\n history: [],\n }));\n }),\n }),\n\n //\n // RevertWorkspace\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.RevertWorkspace,\n handler: Effect.fnUntraced(function* () {\n const state = getState();\n yield* Operation.invoke(Common.LayoutOperation.SwitchWorkspace, {\n subject: state.previousWorkspace,\n });\n }),\n }),\n\n //\n // Open\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.Open,\n handler: Effect.fnUntraced(function* (input) {\n const id = input.subject[0];\n const { variant } = parseEntryId(id);\n\n if (variant) {\n // It's a companion - store the variant preference and open drawer.\n updateState((state) => ({\n ...state,\n companionVariant: variant,\n // Open drawer if closed, otherwise preserve current state (expanded/full).\n drawerState: state.drawerState === 'closed' || !state.drawerState ? 'expanded' : state.drawerState,\n }));\n } else {\n // Regular navigation - update active and history.\n updateState((state) => {\n // Push current active to history if it exists.\n const newHistory = state.active ? [...state.history, state.active] : state.history;\n // Limit history length to prevent memory issues.\n const trimmedHistory =\n newHistory.length > MAX_HISTORY_LENGTH ? newHistory.slice(-MAX_HISTORY_LENGTH) : newHistory;\n return {\n ...state,\n active: id,\n history: trimmedHistory,\n };\n });\n }\n }),\n }),\n\n //\n // Close\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.Close,\n handler: Effect.fnUntraced(function* () {\n updateState((state) => {\n // Pop from history if available.\n if (state.history.length > 0) {\n const newHistory = [...state.history];\n const previousActive = newHistory.pop();\n return {\n ...state,\n active: previousActive,\n history: newHistory,\n };\n }\n // No history, just clear active.\n return {\n ...state,\n active: undefined,\n };\n });\n }),\n }),\n\n //\n // Set\n //\n OperationResolver.make({\n operation: Common.LayoutOperation.Set,\n handler: Effect.fnUntraced(function* (input) {\n updateState((state) => ({\n ...state,\n active: input.subject[0],\n }));\n }),\n }),\n ]);\n }),\n);\n"],
5
+ "mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAWC,yBAAyB;AAC7C,SAASC,iCAAiC;AAK1C,IAAMC,qBAAqB;AAG3B,IAAMC,eAAe,CAACC,YAAAA;AACpB,QAAM,CAACC,IAAIC,OAAAA,IAAWF,QAAQG,MAAMC,yBAAAA;AACpC,SAAO;IAAEH;IAAIC;EAAQ;AACvB;AAEA,IAA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olver", "ATTENDABLE_PATH_SEPARATOR", "MAX_HISTORY_LENGTH", "parseEntryId", "entryId", "id", "variant", "split", "ATTENDABLE_PATH_SEPARATOR", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "stateAtom", "SimpleLayoutStateCapability", "getState", "updateState", "fn", "set", "contributes", "OperationResolver", "make", "operation", "LayoutOperation", "SetLayoutMode", "handler", "UpdateSidebar", "void", "UpdateComplementary", "input", "state", "drawerState", "UpdateDialog", "dialogOpen", "Boolean", "subject", "dialogType", "type", "dialogBlockAlign", "blockAlign", "dialogOverlayClasses", "overlayClasses", "dialogOverlayStyle", "overlayStyle", "dialogContent", "component", "props", "undefined", "UpdatePopover", "popoverOpen", "popoverKind", "kind", "popoverTitle", "title", "popoverContent", "popoverSide", "side", "popoverVariant", "popoverAnchor", "anchor", "popoverAnchorId", "anchorId", "SwitchWorkspace", "previousWorkspace", "workspace", "startsWith", "active", "history", "RevertWorkspace", "Operation", "invoke", "Open", "companionVariant", "newHistory", "trimmedHistory", "length", "slice", "Close", "previousActive", "pop", "Set"]
7
+ }
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SimpleLayout
3
- } from "./chunk-FK4M7GJV.mjs";
3
+ } from "./chunk-LR3EE3VB.mjs";
4
4
  import {
5
5
  meta
6
- } from "./chunk-CLPGTNWJ.mjs";
6
+ } from "./chunk-P77G4YTR.mjs";
7
7
 
8
8
  // src/capabilities/react-root/react-root.tsx
9
9
  import * as Effect from "effect/Effect";
@@ -18,4 +18,4 @@ var react_root_default = Capability.makeModule(() => Effect.succeed(Capability.c
18
18
  export {
19
19
  react_root_default as default
20
20
  };
21
- //# sourceMappingURL=react-root-6ARAPH3O.mjs.map
21
+ //# sourceMappingURL=react-root-KM55OMGJ.mjs.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Home,
3
3
  Workspace
4
- } from "./chunk-FK4M7GJV.mjs";
4
+ } from "./chunk-LR3EE3VB.mjs";
5
5
  import {
6
6
  meta
7
- } from "./chunk-CLPGTNWJ.mjs";
7
+ } from "./chunk-P77G4YTR.mjs";
8
8
 
9
9
  // src/capabilities/react-surface/react-surface.tsx
10
10
  import * as Effect from "effect/Effect";
@@ -36,4 +36,4 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
36
36
  export {
37
37
  react_surface_default as default
38
38
  };
39
- //# sourceMappingURL=react-surface-SO7B23GS.mjs.map
39
+ //# sourceMappingURL=react-surface-BABGAWGY.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SimpleLayoutState
3
- } from "./chunk-CLPGTNWJ.mjs";
3
+ } from "./chunk-P77G4YTR.mjs";
4
4
 
5
5
  // src/capabilities/state/state.tsx
6
6
  import { Atom } from "@effect-atom/atom-react";
@@ -12,7 +12,9 @@ var defaultState = {
12
12
  workspace: Node.RootId,
13
13
  previousWorkspace: Node.RootId,
14
14
  history: [],
15
- isPopover: false
15
+ isPopover: false,
16
+ companionVariant: void 0,
17
+ drawerState: "closed"
16
18
  };
17
19
  var state_default = Capability.makeModule(({ initialState } = {}) => Effect.sync(() => {
18
20
  const stateAtom = Atom.make({
@@ -42,4 +44,4 @@ var state_default = Capability.makeModule(({ initialState } = {}) => Effect.sync
42
44
  export {
43
45
  state_default as default
44
46
  };
45
- //# sourceMappingURL=state-H4IGICBB.mjs.map
47
+ //# sourceMappingURL=state-OUFTC2KV.mjs.map
@@ -0,0 +1,7 @@
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';\nimport { Node } from '@dxos/plugin-graph';\n\nimport { type SimpleLayoutState } from '../../types';\nimport { SimpleLayoutState as SimpleLayoutStateCapability } from '../../types';\n\nconst defaultState: SimpleLayoutState = {\n dialogOpen: false,\n workspace: Node.RootId,\n previousWorkspace: Node.RootId,\n history: [],\n isPopover: false,\n companionVariant: undefined,\n drawerState: 'closed',\n};\n\nexport type SimpleLayoutStateOptions = {\n initialState?: Partial<SimpleLayoutState>;\n};\n\nexport default Capability.makeModule(({ initialState }: SimpleLayoutStateOptions = {}) =>\n Effect.sync(() => {\n const stateAtom = Atom.make<SimpleLayoutState>({ ...defaultState, ...initialState });\n\n const layoutAtom = Atom.make((get): Common.Capability.Layout => {\n const state = get(stateAtom);\n return {\n mode: 'simple',\n dialogOpen: state.dialogOpen,\n sidebarOpen: false,\n complementarySidebarOpen: false,\n workspace: state.workspace,\n active: state.active ? [state.active] : [],\n inactive: [],\n scrollIntoView: undefined,\n };\n });\n\n return [\n Capability.contributes(SimpleLayoutStateCapability, stateAtom),\n Capability.contributes(Common.Capability.Layout, layoutAtom),\n ];\n }),\n);\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,YAAY;AAKrB,IAAMC,eAAkC;EACtCC,YAAY;EACZC,WAAWC,KAAKC;EAChBC,mBAAmBF,KAAKC;EACxBE,SAAS,CAAA;EACTC,WAAW;EACXC,kBAAkBC;EAClBC,aAAa;AACf;AAMA,IAAA,gBAAeC,WAAWC,WAAW,CAAC,EAAEC,aAAY,IAA+B,CAAC,MAC3EC,YAAK,MAAA;AACV,QAAMC,YAAYC,KAAKC,KAAwB;IAAE,GAAGjB;IAAc,GAAGa;EAAa,CAAA;AAElF,QAAMK,aAAaF,KAAKC,KAAK,CAACE,QAAAA;AAC5B,UAAMC,QAAQD,IAAIJ,SAAAA;AAClB,WAAO;MACLM,MAAM;MACNpB,YAAYmB,MAAMnB;MAClBqB,aAAa;MACbC,0BAA0B;MAC1BrB,WAAWkB,MAAMlB;MACjBsB,QAAQJ,MAAMI,SAAS;QAACJ,MAAMI;UAAU,CAAA;MACxCC,UAAU,CAAA;MACVC,gBAAgBjB;IAClB;EACF,CAAA;AAEA,SAAO;IACLE,WAAWgB,YAAYC,mBAA6Bb,SAAAA;IACpDJ,WAAWgB,YAAYE,OAAOlB,WAAWmB,QAAQZ,UAAAA;;AAErD,CAAA,CAAA;",
6
+ "names": ["Atom", "Effect", "Capability", "Common", "Node", "defaultState", "dialogOpen", "workspace", "Node", "RootId", "previousWorkspace", "history", "isPopover", "companionVariant", "undefined", "drawerState", "Capability", "makeModule", "initialState", "sync", "stateAtom", "Atom", "make", "layoutAtom", "get", "state", "mode", "sidebarOpen", "complementarySidebarOpen", "active", "inactive", "scrollIntoView", "contributes", "SimpleLayoutStateCapability", "Common", "Layout"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SimpleLayoutState
3
- } from "./chunk-CLPGTNWJ.mjs";
3
+ } from "./chunk-P77G4YTR.mjs";
4
4
 
5
5
  // src/capabilities/url-handler/url-handler.ts
6
6
  import * as Effect from "effect/Effect";
@@ -51,4 +51,4 @@ var url_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
51
51
  export {
52
52
  url_handler_default as default
53
53
  };
54
- //# sourceMappingURL=url-handler-7CFGTLNG.mjs.map
54
+ //# sourceMappingURL=url-handler-DOUFQIAC.mjs.map
@@ -28,4 +28,4 @@ export {
28
28
  SimpleLayoutState,
29
29
  SimpleLayoutEvents
30
30
  };
31
- //# sourceMappingURL=chunk-MUVVYBUE.mjs.map
31
+ //# sourceMappingURL=chunk-F5TEKVJG.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts", "../../../src/types/capabilities.ts", "../../../src/types/events.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/simple-layout',\n name: 'Simple Layout',\n description: trim`\n Minimal layout plugin for simplified UI contexts like popover windows.\n Provides basic content rendering without sidebars or complex navigation.\n `,\n icon: 'ph--layout--regular',\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\nimport { type DrawerState, type Label } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\n\n// TODO(wittjosiah): Handle toasts.\nexport type SimpleLayoutState = {\n /** Data to be passed to the main content Surface. */\n content?: any;\n\n dialogOpen: boolean;\n dialogType?: 'default' | 'alert';\n dialogBlockAlign?: 'start' | 'center' | 'end';\n dialogOverlayClasses?: string;\n dialogOverlayStyle?: Record<string, any>;\n /** Data to be passed to the dialog Surface. */\n dialogContent?: any;\n\n popoverOpen?: boolean;\n popoverSide?: 'top' | 'right' | 'bottom' | 'left';\n popoverVariant?: 'virtual' | 'react';\n popoverAnchor?: HTMLButtonElement;\n popoverAnchorId?: string;\n popoverKind?: 'base' | 'card';\n popoverTitle?: Label;\n popoverContent?: any;\n\n workspace: string;\n previousWorkspace: string;\n active?: string;\n /** Stack of previously active item IDs for back navigation. */\n history: string[];\n\n /** Whether running in popover window context (hides mobile-specific UI). */\n isPopover?: boolean;\n\n /** Variant of the companion to display in the drawer (e.g., \"comments\", \"assistant-chat\"). */\n companionVariant?: string;\n /** State of the companion drawer. */\n drawerState?: DrawerState;\n};\n\nexport const SimpleLayoutState = Capability.make<Atom.Writable<SimpleLayoutState>>(`${meta.id}/state`);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ActivationEvent, Common } from '@dxos/app-framework';\n\nimport { SimpleLayoutState } from './capabilities';\n\nexport namespace SimpleLayoutEvents {\n /** Fired when SimpleLayoutState capability is ready. */\n export const StateReady: ActivationEvent.ActivationEvent = Common.ActivationEvent.createStateEvent(\n SimpleLayoutState.identifier,\n );\n}\n"],
5
+ "mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;AACR;;;ACTA,SAASC,kBAAkB;AA0CpB,IAAMC,oBAAoBC,WAAWC,KAAuC,GAAGC,KAAKC,EAAE,QAAQ;;;AC5CrG,SAA+BC,cAAc;UAI5BC,qBAAAA;sBAEFC,aAA8CC,OAAOC,gBAAgBC,iBAChFC,kBAAkBC,UAAU;AAEhC,GALiBN,uBAAAA,qBAAAA,CAAAA,EAAAA;;",
6
+ "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "Capability", "SimpleLayoutState", "Capability", "make", "meta", "id", "Common", "SimpleLayoutEvents", "StateReady", "Common", "ActivationEvent", "createStateEvent", "SimpleLayoutState", "identifier"]
7
+ }