@dxos/plugin-sheet 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc

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 (195) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs +46 -0
  3. package/dist/lib/neutral/RangeList-HYB5S6KQ.mjs.map +7 -0
  4. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs +33 -0
  5. package/dist/lib/neutral/SheetArticle-5AJRM3V3.mjs.map +7 -0
  6. package/dist/lib/neutral/SheetPlugin.mjs +48 -0
  7. package/dist/lib/neutral/SheetPlugin.mjs.map +7 -0
  8. package/dist/lib/neutral/SheetPlugin.node.mjs +27 -0
  9. package/dist/lib/neutral/SheetPlugin.node.mjs.map +7 -0
  10. package/dist/lib/neutral/SheetPlugin.workerd.mjs +21 -0
  11. package/dist/lib/neutral/SheetPlugin.workerd.mjs.map +7 -0
  12. package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs +22 -0
  13. package/dist/lib/neutral/anchor-sort-TTCKGX7V.mjs.map +7 -0
  14. package/dist/lib/neutral/capabilities/index.mjs +25 -0
  15. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-4SBAIU6F.mjs +234 -0
  17. package/dist/lib/neutral/chunk-4SBAIU6F.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-CGWDLWFZ.mjs +8 -0
  19. package/dist/lib/neutral/chunk-CGWDLWFZ.mjs.map +7 -0
  20. package/dist/lib/{browser/chunk-SVGX3MWY.mjs → neutral/chunk-KC2SMDNF.mjs} +160 -49
  21. package/dist/lib/neutral/chunk-KC2SMDNF.mjs.map +7 -0
  22. package/dist/lib/neutral/chunk-YFY6U524.mjs +83 -0
  23. package/dist/lib/neutral/chunk-YFY6U524.mjs.map +7 -0
  24. package/dist/lib/{browser/index.mjs → neutral/chunk-ZWOQCLH7.mjs} +1 -13
  25. package/dist/lib/neutral/chunk-ZWOQCLH7.mjs.map +7 -0
  26. package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs +20 -0
  27. package/dist/lib/neutral/comment-config-ZBWNCJMZ.mjs.map +7 -0
  28. package/dist/lib/neutral/components/index.mjs +1551 -0
  29. package/dist/lib/neutral/components/index.mjs.map +7 -0
  30. package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs +20 -0
  31. package/dist/lib/neutral/compute-graph-registry-IEQBF5XZ.mjs.map +7 -0
  32. package/dist/lib/neutral/containers/index.mjs +11 -0
  33. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  34. package/dist/lib/neutral/create-object-OKQAXJCW.mjs +27 -0
  35. package/dist/lib/neutral/create-object-OKQAXJCW.mjs.map +7 -0
  36. package/dist/lib/{browser/drop-axis-ZLERPPPH.mjs → neutral/drop-axis-G6UOXG54.mjs} +4 -4
  37. package/dist/lib/neutral/drop-axis-G6UOXG54.mjs.map +7 -0
  38. package/dist/lib/{node-esm/types → neutral}/index.mjs +14 -5
  39. package/dist/lib/{browser/insert-axis-WTRA3HE7.mjs → neutral/insert-axis-ZFFNG22G.mjs} +4 -4
  40. package/dist/lib/neutral/insert-axis-ZFFNG22G.mjs.map +7 -0
  41. package/dist/lib/neutral/markdown-I2AKJYPF.mjs +28 -0
  42. package/dist/lib/neutral/markdown-I2AKJYPF.mjs.map +7 -0
  43. package/dist/lib/neutral/meta.json +1 -0
  44. package/dist/lib/neutral/meta.mjs +8 -0
  45. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs +13 -0
  46. package/dist/lib/neutral/operation-handler-TB6LFV2H.mjs.map +7 -0
  47. package/dist/lib/neutral/operations/index.mjs +8 -0
  48. package/dist/lib/neutral/plugin.mjs +16 -0
  49. package/dist/lib/neutral/plugin.mjs.map +7 -0
  50. package/dist/lib/neutral/react-surface-VSTQNVPT.mjs +44 -0
  51. package/dist/lib/neutral/react-surface-VSTQNVPT.mjs.map +7 -0
  52. package/dist/lib/{browser/restore-axis-PYGPW2TB.mjs → neutral/restore-axis-44DM6N54.mjs} +4 -4
  53. package/dist/lib/neutral/restore-axis-44DM6N54.mjs.map +7 -0
  54. package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs +33 -0
  55. package/dist/lib/neutral/scroll-to-anchor-QPOGMAQG.mjs.map +7 -0
  56. package/dist/lib/neutral/state-HPA27MX2.mjs +29 -0
  57. package/dist/lib/neutral/state-HPA27MX2.mjs.map +7 -0
  58. package/dist/lib/neutral/testing/index.mjs +103 -0
  59. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  60. package/dist/lib/{browser → neutral}/types/index.mjs +5 -3
  61. package/dist/lib/neutral/types/index.mjs.map +7 -0
  62. package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs +31 -0
  63. package/dist/lib/neutral/undo-mappings-3FQLSTCZ.mjs.map +7 -0
  64. package/dist/types/src/SheetPlugin.d.ts.map +1 -1
  65. package/dist/types/src/SheetPlugin.node.d.ts.map +1 -1
  66. package/dist/types/src/SheetPlugin.workerd.d.ts +4 -0
  67. package/dist/types/src/SheetPlugin.workerd.d.ts.map +1 -0
  68. package/dist/types/src/capabilities/comment-config.d.ts +12 -0
  69. package/dist/types/src/capabilities/comment-config.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  71. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  72. package/dist/types/src/capabilities/index.d.ts +16 -2
  73. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  74. package/dist/types/src/capabilities/markdown.d.ts +1 -1
  75. package/dist/types/src/capabilities/state.d.ts +2 -2
  76. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  77. package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
  78. package/dist/types/src/containers/RangeList/RangeList.d.ts +1 -1
  79. package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -1
  80. package/dist/types/src/containers/{SheetContainer/SheetContainer.d.ts → SheetArticle/SheetArticle.d.ts} +3 -3
  81. package/dist/types/src/containers/SheetArticle/SheetArticle.d.ts.map +1 -0
  82. package/dist/types/src/containers/{SheetContainer/SheetContainer.stories.d.ts → SheetArticle/SheetArticle.stories.d.ts} +2 -2
  83. package/dist/types/src/containers/SheetArticle/SheetArticle.stories.d.ts.map +1 -0
  84. package/dist/types/src/containers/SheetArticle/index.d.ts +2 -0
  85. package/dist/types/src/containers/SheetArticle/index.d.ts.map +1 -0
  86. package/dist/types/src/containers/index.d.ts +1 -1
  87. package/dist/types/src/containers/index.d.ts.map +1 -1
  88. package/dist/types/src/index.d.ts +2 -3
  89. package/dist/types/src/index.d.ts.map +1 -1
  90. package/dist/types/src/operations/drop-axis.d.ts +2 -2
  91. package/dist/types/src/operations/drop-axis.d.ts.map +1 -1
  92. package/dist/types/src/operations/index.d.ts +0 -1
  93. package/dist/types/src/operations/index.d.ts.map +1 -1
  94. package/dist/types/src/operations/insert-axis.d.ts +2 -2
  95. package/dist/types/src/operations/insert-axis.d.ts.map +1 -1
  96. package/dist/types/src/operations/restore-axis.d.ts +2 -2
  97. package/dist/types/src/operations/restore-axis.d.ts.map +1 -1
  98. package/dist/types/src/operations/scroll-to-anchor.d.ts +2 -2
  99. package/dist/types/src/operations/scroll-to-anchor.d.ts.map +1 -1
  100. package/dist/types/src/plugin.d.ts +4 -0
  101. package/dist/types/src/plugin.d.ts.map +1 -0
  102. package/dist/types/src/serializer.d.ts +1 -1
  103. package/dist/types/src/serializer.d.ts.map +1 -1
  104. package/dist/types/src/types/{capabilities.d.ts → SheetCapabilities.d.ts} +5 -7
  105. package/dist/types/src/types/SheetCapabilities.d.ts.map +1 -0
  106. package/dist/types/src/{operations/definitions.d.ts → types/SheetOperation.d.ts} +1 -1
  107. package/dist/types/src/types/SheetOperation.d.ts.map +1 -0
  108. package/dist/types/src/types/index.d.ts +3 -2
  109. package/dist/types/src/types/index.d.ts.map +1 -1
  110. package/dist/types/tsconfig.tsbuildinfo +1 -1
  111. package/package.json +107 -81
  112. package/src/SheetPlugin.node.ts +3 -18
  113. package/src/SheetPlugin.test.ts +2 -2
  114. package/src/SheetPlugin.tsx +7 -36
  115. package/src/SheetPlugin.workerd.ts +18 -0
  116. package/src/capabilities/comment-config.ts +24 -0
  117. package/src/capabilities/compute-graph-registry.ts +1 -1
  118. package/src/capabilities/create-object.ts +30 -0
  119. package/src/capabilities/index.ts +4 -0
  120. package/src/capabilities/markdown.ts +1 -1
  121. package/src/capabilities/react-surface.tsx +3 -3
  122. package/src/capabilities/state.ts +3 -3
  123. package/src/capabilities/undo-mappings.ts +1 -1
  124. package/src/components/ComputeGraph/compute-graph.stories.tsx +8 -3
  125. package/src/components/SheetContent/SheetContent.stories.tsx +1 -1
  126. package/src/components/SheetContent/SheetContent.tsx +1 -1
  127. package/src/containers/RangeList/RangeList.tsx +6 -5
  128. package/src/containers/{SheetContainer/SheetContainer.stories.tsx → SheetArticle/SheetArticle.stories.tsx} +11 -10
  129. package/src/containers/{SheetContainer/SheetContainer.tsx → SheetArticle/SheetArticle.tsx} +5 -5
  130. package/src/containers/SheetArticle/index.ts +5 -0
  131. package/src/containers/index.ts +1 -1
  132. package/src/index.ts +2 -8
  133. package/src/integrations/thread-ranges.ts +3 -3
  134. package/src/operations/drop-axis.ts +4 -4
  135. package/src/operations/index.ts +0 -2
  136. package/src/operations/insert-axis.ts +4 -4
  137. package/src/operations/restore-axis.ts +4 -4
  138. package/src/operations/scroll-to-anchor.ts +2 -3
  139. package/src/playwright/sheet.spec.ts +1 -1
  140. package/src/plugin.ts +11 -0
  141. package/src/sanity.test.ts +5 -1
  142. package/src/serializer.ts +1 -1
  143. package/src/types/{capabilities.ts → SheetCapabilities.ts} +8 -8
  144. package/src/{operations/definitions.ts → types/SheetOperation.ts} +2 -0
  145. package/src/types/index.ts +4 -2
  146. package/dist/lib/browser/SheetPlugin-W4PFP6WG.mjs +0 -92
  147. package/dist/lib/browser/SheetPlugin-W4PFP6WG.mjs.map +0 -7
  148. package/dist/lib/browser/chunk-5TXOUIGZ.mjs +0 -118
  149. package/dist/lib/browser/chunk-5TXOUIGZ.mjs.map +0 -7
  150. package/dist/lib/browser/chunk-SVGX3MWY.mjs.map +0 -7
  151. package/dist/lib/browser/drop-axis-ZLERPPPH.mjs.map +0 -7
  152. package/dist/lib/browser/index.mjs.map +0 -7
  153. package/dist/lib/browser/insert-axis-WTRA3HE7.mjs.map +0 -7
  154. package/dist/lib/browser/meta.json +0 -1
  155. package/dist/lib/browser/operations/index.mjs +0 -13
  156. package/dist/lib/browser/operations/index.mjs.map +0 -7
  157. package/dist/lib/browser/restore-axis-PYGPW2TB.mjs.map +0 -7
  158. package/dist/lib/browser/scroll-to-anchor-6I4DNKBW.mjs +0 -65
  159. package/dist/lib/browser/scroll-to-anchor-6I4DNKBW.mjs.map +0 -7
  160. package/dist/lib/node-esm/SheetPlugin-ZJRSEYHB.mjs +0 -93
  161. package/dist/lib/node-esm/SheetPlugin-ZJRSEYHB.mjs.map +0 -7
  162. package/dist/lib/node-esm/chunk-4A2KAXTF.mjs +0 -263
  163. package/dist/lib/node-esm/chunk-4A2KAXTF.mjs.map +0 -7
  164. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  165. package/dist/lib/node-esm/chunk-MCZFRYOP.mjs +0 -119
  166. package/dist/lib/node-esm/chunk-MCZFRYOP.mjs.map +0 -7
  167. package/dist/lib/node-esm/drop-axis-FV2GXSZP.mjs +0 -24
  168. package/dist/lib/node-esm/drop-axis-FV2GXSZP.mjs.map +0 -7
  169. package/dist/lib/node-esm/index.mjs +0 -34
  170. package/dist/lib/node-esm/index.mjs.map +0 -7
  171. package/dist/lib/node-esm/insert-axis-THXK6DCC.mjs +0 -17
  172. package/dist/lib/node-esm/insert-axis-THXK6DCC.mjs.map +0 -7
  173. package/dist/lib/node-esm/meta.json +0 -1
  174. package/dist/lib/node-esm/operations/index.mjs +0 -14
  175. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  176. package/dist/lib/node-esm/restore-axis-JIFT3Q7Z.mjs +0 -17
  177. package/dist/lib/node-esm/restore-axis-JIFT3Q7Z.mjs.map +0 -7
  178. package/dist/lib/node-esm/scroll-to-anchor-JRDC5KK2.mjs +0 -66
  179. package/dist/lib/node-esm/scroll-to-anchor-JRDC5KK2.mjs.map +0 -7
  180. package/dist/lib/node-esm/translations.mjs +0 -56
  181. package/dist/lib/node-esm/translations.mjs.map +0 -7
  182. package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts.map +0 -1
  183. package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
  184. package/dist/types/src/containers/SheetContainer/index.d.ts +0 -2
  185. package/dist/types/src/containers/SheetContainer/index.d.ts.map +0 -1
  186. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  187. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  188. package/src/containers/SheetContainer/index.ts +0 -5
  189. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  190. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  191. /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
  192. /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
  193. /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  194. /package/dist/lib/{browser → neutral}/translations.mjs +0 -0
  195. /package/dist/lib/{browser → neutral}/translations.mjs.map +0 -0
@@ -14,21 +14,22 @@ import { corePlugins } from '@dxos/plugin-testing';
14
14
  import { useSpaces } from '@dxos/react-client/echo';
15
15
  import { withClientProvider } from '@dxos/react-client/testing';
16
16
  import { AttendableContainer } from '@dxos/react-ui-attention';
17
- import { withLayout } from '@dxos/react-ui/testing';
17
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
18
18
 
19
19
  import { ComputeGraphContext, useComputeGraph } from '#components';
20
- import { SheetOperation } from '#operations';
21
20
  import { createTestCells, useTestSheet, withComputeGraphDecorator } from '#testing';
22
21
  import { translations } from '#translations';
22
+ import { SheetOperation } from '#types';
23
23
  import { Sheet } from '#types';
24
24
 
25
25
  import RangeList from '../RangeList';
26
- import { SheetContainer } from './SheetContainer';
26
+ import { SheetArticle } from './SheetArticle';
27
27
 
28
28
  const meta = {
29
- title: 'plugins/plugin-sheet/containers/SheetContainer',
30
- component: SheetContainer,
29
+ title: 'plugins/plugin-sheet/containers/SheetArticle',
30
+ component: SheetArticle,
31
31
  decorators: [
32
+ withTheme(),
32
33
  withLayout({ layout: 'fullscreen' }),
33
34
  withClientProvider({ types: [Sheet.Sheet], createSpace: true }),
34
35
  withComputeGraphDecorator(),
@@ -53,7 +54,7 @@ const meta = {
53
54
  layout: 'fullscreen',
54
55
  translations,
55
56
  },
56
- } satisfies Meta<typeof SheetContainer>;
57
+ } satisfies Meta<typeof SheetArticle>;
57
58
 
58
59
  export default meta;
59
60
 
@@ -68,7 +69,7 @@ export const Default = () => {
68
69
 
69
70
  return (
70
71
  <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
71
- <SheetContainer
72
+ <SheetArticle
72
73
  role='article'
73
74
  space={space}
74
75
  subject={sheet}
@@ -91,8 +92,8 @@ export const Spec = () => {
91
92
 
92
93
  return (
93
94
  <AttendableContainer id={Obj.getDXN(sheet).toString()} classNames='contents'>
94
- <div role='none' className='w-full grid grid-cols-[1fr_20rem]'>
95
- <SheetContainer
95
+ <div className='w-full grid grid-cols-[1fr_20rem]'>
96
+ <SheetArticle
96
97
  role='article'
97
98
  space={space}
98
99
  subject={sheet}
@@ -100,7 +101,7 @@ export const Spec = () => {
100
101
  registry={registry}
101
102
  ignoreAttention
102
103
  />
103
- <div role='none' data-testid='grid.range-list'>
104
+ <div data-testid='grid.range-list'>
104
105
  <RangeList sheet={sheet} />
105
106
  </div>
106
107
  </div>
@@ -12,7 +12,7 @@ import { Panel } from '@dxos/react-ui';
12
12
  import { ComputeGraphContextProvider, Sheet, useComputeGraph } from '#components';
13
13
  import { type Sheet as SheetType } from '#types';
14
14
 
15
- export type SheetContainerProps = AppSurface.ObjectArticleProps<
15
+ export type SheetArticleProps = AppSurface.ObjectArticleProps<
16
16
  SheetType.Sheet,
17
17
  {
18
18
  space: Space;
@@ -21,19 +21,19 @@ export type SheetContainerProps = AppSurface.ObjectArticleProps<
21
21
  }
22
22
  >;
23
23
 
24
- export const SheetContainer = ({ registry, ...props }: SheetContainerProps) => (
24
+ export const SheetArticle = ({ registry, ...props }: SheetArticleProps) => (
25
25
  <ComputeGraphContextProvider registry={registry}>
26
- <SheetContainerInner {...props} />
26
+ <SheetArticleInner {...props} />
27
27
  </ComputeGraphContextProvider>
28
28
  );
29
29
 
30
- const SheetContainerInner = ({
30
+ const SheetArticleInner = ({
31
31
  role,
32
32
  subject: sheet,
33
33
  attendableId,
34
34
  space,
35
35
  ignoreAttention,
36
- }: Omit<SheetContainerProps, 'registry'>) => {
36
+ }: Omit<SheetArticleProps, 'registry'>) => {
37
37
  const graph = useComputeGraph(space);
38
38
  if (!graph) {
39
39
  return null;
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export { SheetArticle as default } from './SheetArticle';
@@ -5,4 +5,4 @@
5
5
  import { type ComponentType, lazy } from 'react';
6
6
 
7
7
  export const RangeList: ComponentType<any> = lazy(() => import('./RangeList'));
8
- export const SheetContainer: ComponentType<any> = lazy(() => import('./SheetContainer'));
8
+ export const SheetArticle: ComponentType<any> = lazy(() => import('./SheetArticle'));
package/src/index.ts CHANGED
@@ -2,12 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Plugin } from '@dxos/app-framework';
6
-
7
- import { meta } from './meta';
8
-
9
- export const SheetPlugin = Plugin.lazy(meta, () => import('./SheetPlugin'));
10
-
11
5
  export * from './meta';
12
-
13
- export { SheetCapabilities } from './types';
6
+ export * from './operations';
7
+ export * from './types';
@@ -8,9 +8,9 @@ import { useOperationInvoker } from '@dxos/app-framework/ui';
8
8
  import { LayoutOperation } from '@dxos/app-toolkit';
9
9
  import { debounce } from '@dxos/async';
10
10
  import { type CellAddress, type CompleteCellRange, inRange } from '@dxos/compute-hyperformula';
11
- import { Obj, Relation } from '@dxos/echo';
12
- import { ThreadOperation } from '@dxos/plugin-thread/operations';
13
- import { Filter, Query, useQuery } from '@dxos/react-client/echo';
11
+ import { Filter, Obj, Query, Relation } from '@dxos/echo';
12
+ import { ThreadOperation } from '@dxos/plugin-thread';
13
+ import { useQuery } from '@dxos/react-client/echo';
14
14
  import { linkedSegment } from '@dxos/react-ui-attention';
15
15
  import { AnchoredTo, Thread } from '@dxos/types';
16
16
 
@@ -1,14 +1,14 @@
1
1
  //
2
- // Copyright 2025 DXOS.org
3
- //
4
2
 
5
3
  import * as Effect from 'effect/Effect';
4
+ // Copyright 2025 DXOS.org
5
+ //
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
8
 
9
- import { DropAxis } from './definitions';
9
+ import { SheetOperation } from '../types';
10
10
 
11
- const handler: Operation.WithHandler<typeof DropAxis> = DropAxis.pipe(
11
+ const handler: Operation.WithHandler<typeof SheetOperation.DropAxis> = SheetOperation.DropAxis.pipe(
12
12
  Operation.withHandler(({ model, axis, axisIndex }) =>
13
13
  Effect.sync(() => {
14
14
  const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
@@ -4,8 +4,6 @@
4
4
 
5
5
  import { OperationHandlerSet } from '@dxos/compute';
6
6
 
7
- export * as SheetOperation from './definitions';
8
-
9
7
  export const SheetOperationHandlerSet = OperationHandlerSet.lazy(
10
8
  () => import('./drop-axis'),
11
9
  () => import('./insert-axis'),
@@ -1,14 +1,14 @@
1
1
  //
2
- // Copyright 2025 DXOS.org
3
- //
4
2
 
5
3
  import * as Effect from 'effect/Effect';
4
+ // Copyright 2025 DXOS.org
5
+ //
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
8
 
9
- import { InsertAxis } from './definitions';
9
+ import { SheetOperation } from '../types';
10
10
 
11
- const handler: Operation.WithHandler<typeof InsertAxis> = InsertAxis.pipe(
11
+ const handler: Operation.WithHandler<typeof SheetOperation.InsertAxis> = SheetOperation.InsertAxis.pipe(
12
12
  Operation.withHandler(({ model, axis, index, count }) =>
13
13
  Effect.sync(() => {
14
14
  model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
@@ -1,14 +1,14 @@
1
1
  //
2
- // Copyright 2025 DXOS.org
3
- //
4
2
 
5
3
  import * as Effect from 'effect/Effect';
4
+ // Copyright 2025 DXOS.org
5
+ //
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
8
 
9
- import { RestoreAxis } from './definitions';
9
+ import { SheetOperation } from '../types';
10
10
 
11
- const handler: Operation.WithHandler<typeof RestoreAxis> = RestoreAxis.pipe(
11
+ const handler: Operation.WithHandler<typeof SheetOperation.RestoreAxis> = SheetOperation.RestoreAxis.pipe(
12
12
  Operation.withHandler(({ model, axis, ...restoreData }) =>
13
13
  Effect.sync(() => {
14
14
  model[axis === 'col' ? 'restoreColumn' : 'restoreRow'](restoreData);
@@ -8,10 +8,9 @@ import { Capability } from '@dxos/app-framework';
8
8
  import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { parseThreadAnchorAsCellRange } from '../integrations/thread-ranges';
11
- import { SheetCapabilities } from '../types';
12
- import { ScrollToAnchor } from './definitions';
11
+ import { SheetCapabilities, SheetOperation } from '../types';
13
12
 
14
- const handler: Operation.WithHandler<typeof ScrollToAnchor> = ScrollToAnchor.pipe(
13
+ const handler: Operation.WithHandler<typeof SheetOperation.ScrollToAnchor> = SheetOperation.ScrollToAnchor.pipe(
15
14
  Operation.withHandler(
16
15
  Effect.fnUntraced(function* ({ subject, cursor, ref }) {
17
16
  const gridInstances = yield* Capability.get(SheetCapabilities.GridInstances);
@@ -15,7 +15,7 @@ test.describe('plugin-sheet', () => {
15
15
 
16
16
  test.beforeEach(async ({ browser }) => {
17
17
  const setup = await setupPage(browser, {
18
- url: storybookUrl('plugins-plugin-sheet-containers-sheetcontainer--spec', 9005),
18
+ url: storybookUrl('plugins-plugin-sheet-containers-sheetarticle--spec', 9005),
19
19
  viewportSize: { width: 1280, height: 720 },
20
20
  });
21
21
  page = setup.page;
package/src/plugin.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const SheetPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
11
+ export { SheetOperationHandlerSet } from './operations';
@@ -35,7 +35,11 @@ describe('test', () => {
35
35
  // - ERROR "Identifier 'Buffer' has already been declared" if { nodeExternal: true }
36
36
  const space = await client.spaces.create();
37
37
  const fn = space.db.add(
38
- Obj.make(Operation.PersistentOperation, { name: 'test', version: '0.0.1', binding: 'HELLO' }),
38
+ Obj.make(Operation.PersistentOperation, {
39
+ [Obj.Meta]: { key: 'com.example.function.test', version: '0.0.1' },
40
+ name: 'test',
41
+ binding: 'HELLO',
42
+ }),
39
43
  );
40
44
  expect(fn).to.exist;
41
45
  });
package/src/serializer.ts CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { Obj } from '@dxos/echo';
6
6
  import { getObjectCore } from '@dxos/echo-db';
7
- import { type TypedObjectSerializer } from '@dxos/plugin-space/types';
7
+ import { type TypedObjectSerializer } from '@dxos/plugin-space';
8
8
 
9
9
  import { Sheet } from '#types';
10
10
 
@@ -2,8 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ // @import-as-namespace
6
+
5
7
  import { Capability } from '@dxos/app-framework';
6
- import { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';
8
+ import { type ComputeGraphRegistry as ComputeGraphRegistryType } from '@dxos/compute-hyperformula';
7
9
  import { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';
8
10
 
9
11
  import { meta } from '#meta';
@@ -16,11 +18,9 @@ export type GridRegistry = {
16
18
  get: (attendableId: string) => GridEntry | undefined;
17
19
  };
18
20
 
19
- export namespace SheetCapabilities {
20
- export const ComputeGraphRegistry = Capability.make<ComputeGraphRegistry>(
21
- `${meta.id}.capability.compute-graph-registry`,
22
- );
21
+ export const ComputeGraphRegistry = Capability.make<ComputeGraphRegistryType>(
22
+ `${meta.id}.capability.compute-graph-registry`,
23
+ );
23
24
 
24
- /** Registry of active grid instances keyed by attendable ID. */
25
- export const GridInstances = Capability.make<GridRegistry>(`${meta.id}.capability.grid-instances`);
26
- }
25
+ /** Registry of active grid instances keyed by attendable ID. */
26
+ export const GridInstances = Capability.make<GridRegistry>(`${meta.id}.capability.grid-instances`);
@@ -2,6 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ // @import-as-namespace
6
+
5
7
  import * as Schema from 'effect/Schema';
6
8
 
7
9
  import { Capability } from '@dxos/app-framework';
@@ -2,8 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './capabilities';
6
- export * as Sheet from './Sheet';
7
5
  export * from './sheet-range-types';
8
6
  export * from './types';
9
7
  export * from './util';
8
+
9
+ export * as Sheet from './Sheet';
10
+ export * as SheetCapabilities from './SheetCapabilities';
11
+ export * as SheetOperation from './SheetOperation';
@@ -1,92 +0,0 @@
1
- import "./chunk-J5LGTIGS.mjs";
2
-
3
- // src/SheetPlugin.tsx
4
- import * as Effect from "effect/Effect";
5
- import * as Option from "effect/Option";
6
- import { ActivationEvent, Plugin } from "@dxos/app-framework";
7
- import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
8
- import { Operation } from "@dxos/compute";
9
- import { Annotation } from "@dxos/echo";
10
- import { AutomationEvents } from "@dxos/plugin-automation/types";
11
- import { ClientEvents } from "@dxos/plugin-client/types";
12
- import { MarkdownEvents } from "@dxos/plugin-markdown/types";
13
- import { SpaceOperation } from "@dxos/plugin-space/operations";
14
- import { AnchorSort, ComputeGraphRegistry, Markdown, OperationHandler, UndoMappings, ReactSurface, SheetState } from "#capabilities";
15
- import { meta } from "#meta";
16
- import { SheetOperation } from "#operations";
17
- import { translations } from "#translations";
18
- import { Sheet as Sheet2 } from "#types";
19
-
20
- // src/serializer.ts
21
- import { Obj } from "@dxos/echo";
22
- import { getObjectCore } from "@dxos/echo-db";
23
- import { Sheet } from "#types";
24
- var serializer = {
25
- serialize: async ({ object }) => {
26
- return JSON.stringify(object, null, 2);
27
- },
28
- deserialize: async ({ content, newId }) => {
29
- const { id, ...parsed } = JSON.parse(content);
30
- const sheet = Obj.make(Sheet.Sheet, parsed);
31
- if (!newId) {
32
- const core = getObjectCore(sheet);
33
- core.id = id;
34
- }
35
- return sheet;
36
- }
37
- };
38
-
39
- // src/SheetPlugin.tsx
40
- var SheetPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
41
- metadata: {
42
- id: Sheet2.Sheet.typename,
43
- metadata: {
44
- label: (object) => object.name,
45
- icon: Annotation.IconAnnotation.get(Sheet2.Sheet).pipe(Option.getOrThrow).icon,
46
- iconHue: Annotation.IconAnnotation.get(Sheet2.Sheet).pipe(Option.getOrThrow).hue ?? "white",
47
- serializer,
48
- comments: "anchored",
49
- createObject: (props, options) => Effect.gen(function* () {
50
- const object = Sheet2.make(props);
51
- return yield* Operation.invoke(SpaceOperation.AddObject, {
52
- object,
53
- target: options.target,
54
- hidden: true,
55
- targetNodeId: options.targetNodeId
56
- });
57
- }),
58
- scrollToAnchor: SheetOperation.ScrollToAnchor
59
- }
60
- }
61
- }), AppPlugin.addOperationHandlerModule({
62
- activate: OperationHandler
63
- }), AppPlugin.addUndoMappingsModule({
64
- activate: UndoMappings
65
- }), AppPlugin.addSchemaModule({
66
- schema: [
67
- Sheet2.Sheet
68
- ]
69
- }), AppPlugin.addSurfaceModule({
70
- activate: ReactSurface
71
- }), AppPlugin.addTranslationsModule({
72
- translations
73
- }), Plugin.addModule({
74
- activatesOn: AppActivationEvents.SetupSettings,
75
- activate: SheetState
76
- }), Plugin.addModule({
77
- activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, AutomationEvents.ComputeRuntimeReady),
78
- activate: ComputeGraphRegistry
79
- }), Plugin.addModule({
80
- activatesOn: MarkdownEvents.SetupExtensions,
81
- activate: Markdown
82
- }), Plugin.addModule({
83
- // TODO(wittjosiah): More relevant event?
84
- activatesOn: AppActivationEvents.AppGraphReady,
85
- activate: AnchorSort
86
- }), Plugin.make);
87
- var SheetPlugin_default = SheetPlugin;
88
- export {
89
- SheetPlugin,
90
- SheetPlugin_default as default
91
- };
92
- //# sourceMappingURL=SheetPlugin-W4PFP6WG.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/SheetPlugin.tsx", "../../../src/serializer.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { ActivationEvent, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Annotation } from '@dxos/echo';\nimport { AutomationEvents } from '@dxos/plugin-automation/types';\nimport { ClientEvents } from '@dxos/plugin-client/types';\nimport { MarkdownEvents } from '@dxos/plugin-markdown/types';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\n\nimport {\n AnchorSort,\n ComputeGraphRegistry,\n Markdown,\n OperationHandler,\n UndoMappings,\n ReactSurface,\n SheetState,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { SheetOperation } from '#operations';\nimport { translations } from '#translations';\nimport { Sheet } from '#types';\n\nimport { serializer } from './serializer';\n\nexport const SheetPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: Sheet.Sheet.typename,\n metadata: {\n label: (object: Sheet.Sheet) => object.name,\n icon: Annotation.IconAnnotation.get(Sheet.Sheet).pipe(Option.getOrThrow).icon,\n iconHue: Annotation.IconAnnotation.get(Sheet.Sheet).pipe(Option.getOrThrow).hue ?? 'white',\n serializer,\n comments: 'anchored',\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = Sheet.make(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n scrollToAnchor: SheetOperation.ScrollToAnchor,\n },\n },\n }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addUndoMappingsModule({ activate: UndoMappings }),\n AppPlugin.addSchemaModule({ schema: [Sheet.Sheet] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n activatesOn: AppActivationEvents.SetupSettings,\n activate: SheetState,\n }),\n Plugin.addModule({\n activatesOn: ActivationEvent.allOf(ClientEvents.ClientReady, AutomationEvents.ComputeRuntimeReady),\n activate: ComputeGraphRegistry,\n }),\n Plugin.addModule({\n activatesOn: MarkdownEvents.SetupExtensions,\n activate: Markdown,\n }),\n Plugin.addModule({\n // TODO(wittjosiah): More relevant event?\n activatesOn: AppActivationEvents.AppGraphReady,\n activate: AnchorSort,\n }),\n Plugin.make,\n);\n\nexport default SheetPlugin;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Obj } from '@dxos/echo';\nimport { getObjectCore } from '@dxos/echo-db';\nimport { type TypedObjectSerializer } from '@dxos/plugin-space/types';\n\nimport { Sheet } from '#types';\n\nexport const serializer: TypedObjectSerializer<Sheet.Sheet> = {\n serialize: async ({ object }): Promise<string> => {\n return JSON.stringify(object, null, 2);\n },\n\n deserialize: async ({ content, newId }) => {\n const { id, ...parsed } = JSON.parse(content);\n const sheet = Obj.make(Sheet.Sheet, parsed);\n\n if (!newId) {\n const core = getObjectCore(sheet);\n core.id = id;\n }\n\n return sheet;\n },\n};\n"],
5
- "mappings": ";;;AAIA,YAAYA,YAA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,KAAAA;AAC1B,eAAO,OAAOI,UAAUC,OAAOC,eAAeC,WAAW;UACvDnB;UACAoB,QAAQP,QAAQO;UAChBC,QAAQ;UACRC,cAAcT,QAAQS;QACxB,CAAA;MACF,CAAA;MACFC,gBAAgBC,eAAeC;IACjC;EACF;AACF,CAAA,GACAhC,UAAUiC,0BAA0B;EAAEC,UAAUC;AAAiB,CAAA,GACjEnC,UAAUoC,sBAAsB;EAAEF,UAAUG;AAAa,CAAA,GACzDrC,UAAUsC,gBAAgB;EAAEC,QAAQ;IAACnC,OAAMA;;AAAO,CAAA,GAClDJ,UAAUwC,iBAAiB;EAAEN,UAAUO;AAAa,CAAA,GACpDzC,UAAU0C,sBAAsB;EAAEC;AAAa,CAAA,GAC/C/C,OAAOgD,UAAU;EACfC,aAAaC,oBAAoBC;EACjCb,UAAUc;AACZ,CAAA,GACApD,OAAOgD,UAAU;EACfC,aAAaI,gBAAgBC,MAAMC,aAAaC,aAAaC,iBAAiBC,mBAAmB;EACjGpB,UAAUqB;AACZ,CAAA,GACA3D,OAAOgD,UAAU;EACfC,aAAaW,eAAeC;EAC5BvB,UAAUwB;AACZ,CAAA,GACA9D,OAAOgD,UAAU;;EAEfC,aAAaC,oBAAoBa;EACjCzB,UAAU0B;AACZ,CAAA,GACAhE,OAAO0B,IAAI;AAGb,IAAA,sBAAe3B;",
6
- "names": ["Effect", "Option", "ActivationEvent", "Plugin", "AppActivationEvents", "AppPlugin", "Operation", "Annotation", "AutomationEvents", "ClientEvents", "MarkdownEvents", "SpaceOperation", "AnchorSort", "ComputeGraphRegistry", "Markdown", "OperationHandler", "UndoMappings", "ReactSurface", "SheetState", "meta", "SheetOperation", "translations", "Sheet", "Obj", "getObjectCore", "Sheet", "serializer", "serialize", "object", "JSON", "stringify", "deserialize", "content", "newId", "id", "parsed", "parse", "sheet", "make", "core", "SheetPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Sheet", "typename", "label", "object", "name", "icon", "Annotation", "IconAnnotation", "get", "getOrThrow", "iconHue", "hue", "serializer", "comments", "createObject", "props", "options", "gen", "make", "Operation", "invoke", "SpaceOperation", "AddObject", "target", "hidden", "targetNodeId", "scrollToAnchor", "SheetOperation", "ScrollToAnchor", "addOperationHandlerModule", "activate", "OperationHandler", "addUndoMappingsModule", "UndoMappings", "addSchemaModule", "schema", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "AppActivationEvents", "SetupSettings", "SheetState", "ActivationEvent", "allOf", "ClientEvents", "ClientReady", "AutomationEvents", "ComputeRuntimeReady", "ComputeGraphRegistry", "MarkdownEvents", "SetupExtensions", "Markdown", "AppGraphReady", "AnchorSort"]
7
- }
@@ -1,118 +0,0 @@
1
- import {
2
- __export
3
- } from "./chunk-J5LGTIGS.mjs";
4
-
5
- // src/operations/definitions.ts
6
- var definitions_exports = {};
7
- __export(definitions_exports, {
8
- DropAxis: () => DropAxis,
9
- DropAxisOutput: () => DropAxisOutput,
10
- InsertAxis: () => InsertAxis,
11
- RestoreAxis: () => RestoreAxis,
12
- ScrollToAnchor: () => ScrollToAnchor
13
- });
14
- import * as Schema from "effect/Schema";
15
- import { Capability } from "@dxos/app-framework";
16
- import { Operation } from "@dxos/compute";
17
- import { meta } from "#meta";
18
- var SHEET_OPERATION = `${meta.id}.operation`;
19
- var Axis = Schema.Union(Schema.Literal("row"), Schema.Literal("col"));
20
- var InsertAxis = Operation.make({
21
- meta: {
22
- key: `${SHEET_OPERATION}.axis-insert`,
23
- name: "Insert Axis"
24
- },
25
- input: Schema.Struct({
26
- model: Schema.Any,
27
- axis: Axis,
28
- index: Schema.Number,
29
- count: Schema.optional(Schema.Number)
30
- }),
31
- output: Schema.Void
32
- });
33
- var DropAxisOutput = Schema.Struct({
34
- axis: Axis.annotations({
35
- description: "The axis type (row or col)."
36
- }),
37
- axisIndex: Schema.String.annotations({
38
- description: "The dropped axis index."
39
- }),
40
- index: Schema.Number.annotations({
41
- description: "The position the axis was at."
42
- }),
43
- axisMeta: Schema.Any.annotations({
44
- description: "The row/column metadata."
45
- }),
46
- values: Schema.Array(Schema.Any).annotations({
47
- description: "The cell values that were dropped."
48
- })
49
- });
50
- var DropAxis = Operation.make({
51
- meta: {
52
- key: `${SHEET_OPERATION}.axis-drop`,
53
- name: "Drop Axis"
54
- },
55
- input: Schema.Struct({
56
- model: Schema.Any,
57
- axis: Axis,
58
- axisIndex: Schema.String
59
- }),
60
- output: DropAxisOutput
61
- });
62
- var ScrollToAnchor = Operation.make({
63
- meta: {
64
- key: `${SHEET_OPERATION}.scroll-to-anchor`,
65
- name: "Scroll To Anchor"
66
- },
67
- services: [
68
- Capability.Service
69
- ],
70
- input: Schema.Struct({
71
- subject: Schema.String.annotations({
72
- description: "Attendable ID of the sheet."
73
- }),
74
- cursor: Schema.String.annotations({
75
- description: "Cell range coordinates."
76
- }),
77
- ref: Schema.optional(Schema.Any.annotations({
78
- description: "Active refs for highlighting."
79
- }))
80
- }),
81
- output: Schema.Void
82
- });
83
- var RestoreAxis = Operation.make({
84
- meta: {
85
- key: `${SHEET_OPERATION}.restore-axis`,
86
- name: "Restore Axis"
87
- },
88
- input: Schema.Struct({
89
- model: Schema.Any.annotations({
90
- description: "The sheet model."
91
- }),
92
- axis: Axis.annotations({
93
- description: "The axis type (row or col)."
94
- }),
95
- axisIndex: Schema.String.annotations({
96
- description: "The axis index to restore."
97
- }),
98
- index: Schema.Number.annotations({
99
- description: "The position to restore at."
100
- }),
101
- axisMeta: Schema.Any.annotations({
102
- description: "The row/column metadata."
103
- }),
104
- values: Schema.Array(Schema.Any).annotations({
105
- description: "The cell values to restore."
106
- })
107
- }),
108
- output: Schema.Void
109
- });
110
-
111
- export {
112
- InsertAxis,
113
- DropAxis,
114
- ScrollToAnchor,
115
- RestoreAxis,
116
- definitions_exports
117
- };
118
- //# sourceMappingURL=chunk-5TXOUIGZ.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\n\nimport { meta } from '#meta';\n\nconst SHEET_OPERATION = `${meta.id}.operation`;\n\n// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.\nconst Axis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));\n\nexport const InsertAxis = Operation.make({\n meta: { key: `${SHEET_OPERATION}.axis-insert`, name: 'Insert Axis' },\n input: Schema.Struct({\n model: Schema.Any,\n axis: Axis,\n index: Schema.Number,\n count: Schema.optional(Schema.Number),\n }),\n output: Schema.Void,\n});\n\nexport const DropAxisOutput = Schema.Struct({\n axis: Axis.annotations({ description: 'The axis type (row or col).' }),\n axisIndex: Schema.String.annotations({ description: 'The dropped axis index.' }),\n index: Schema.Number.annotations({ description: 'The position the axis was at.' }),\n axisMeta: Schema.Any.annotations({ description: 'The row/column metadata.' }),\n values: Schema.Array(Schema.Any).annotations({ description: 'The cell values that were dropped.' }),\n});\n\nexport type DropAxisOutput = Schema.Schema.Type<typeof DropAxisOutput>;\n\nexport const DropAxis = Operation.make({\n meta: { key: `${SHEET_OPERATION}.axis-drop`, name: 'Drop Axis' },\n input: Schema.Struct({\n model: Schema.Any,\n axis: Axis,\n axisIndex: Schema.String,\n }),\n output: DropAxisOutput,\n});\n\nexport const ScrollToAnchor = Operation.make({\n meta: { key: `${SHEET_OPERATION}.scroll-to-anchor`, name: 'Scroll To Anchor' },\n services: [Capability.Service],\n input: Schema.Struct({\n subject: Schema.String.annotations({ description: 'Attendable ID of the sheet.' }),\n cursor: Schema.String.annotations({ description: 'Cell range coordinates.' }),\n ref: Schema.optional(Schema.Any.annotations({ description: 'Active refs for highlighting.' })),\n }),\n output: Schema.Void,\n});\n\n/**\n * Restore a dropped axis (inverse of DropAxis).\n */\nexport const RestoreAxis = Operation.make({\n meta: { key: `${SHEET_OPERATION}.restore-axis`, name: 'Restore Axis' },\n input: Schema.Struct({\n model: Schema.Any.annotations({ description: 'The sheet model.' }),\n axis: Axis.annotations({ description: 'The axis type (row or col).' }),\n axisIndex: Schema.String.annotations({ description: 'The axis index to restore.' }),\n index: Schema.Number.annotations({ description: 'The position to restore at.' }),\n axisMeta: Schema.Any.annotations({ description: 'The row/column metadata.' }),\n values: Schema.Array(Schema.Any).annotations({ description: 'The cell values to restore.' }),\n }),\n output: Schema.Void,\n});\n"],
5
- "mappings": ";;;;;AAAA;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AAErB,IAAMC,kBAAkB,GAAGD,KAAKE,EAAE;AAGlC,IAAMC,OAAcC,aAAaC,eAAQ,KAAA,GAAeA,eAAQ,KAAA,CAAA;AAEzD,IAAMC,aAAaP,UAAUQ,KAAK;EACvCP,MAAM;IAAEQ,KAAK,GAAGP,eAAAA;IAA+BQ,MAAM;EAAc;EACnEC,OAAcC,cAAO;IACnBC,OAAcC;IACdC,MAAMX;IACNY,OAAcC;IACdC,OAAcC,gBAAgBF,aAAM;EACtC,CAAA;EACAG,QAAeC;AACjB,CAAA;AAEO,IAAMC,iBAAwBV,cAAO;EAC1CG,MAAMX,KAAKmB,YAAY;IAAEC,aAAa;EAA8B,CAAA;EACpEC,WAAkBC,cAAOH,YAAY;IAAEC,aAAa;EAA0B,CAAA;EAC9ER,OAAcC,cAAOM,YAAY;IAAEC,aAAa;EAAgC,CAAA;EAChFG,UAAiBb,WAAIS,YAAY;IAAEC,aAAa;EAA2B,CAAA;EAC3EI,QAAeC,aAAaf,UAAG,EAAES,YAAY;IAAEC,aAAa;EAAqC,CAAA;AACnG,CAAA;AAIO,IAAMM,WAAW9B,UAAUQ,KAAK;EACrCP,MAAM;IAAEQ,KAAK,GAAGP,eAAAA;IAA6BQ,MAAM;EAAY;EAC/DC,OAAcC,cAAO;IACnBC,OAAcC;IACdC,MAAMX;IACNqB,WAAkBC;EACpB,CAAA;EACAN,QAAQE;AACV,CAAA;AAEO,IAAMS,iBAAiB/B,UAAUQ,KAAK;EAC3CP,MAAM;IAAEQ,KAAK,GAAGP,eAAAA;IAAoCQ,MAAM;EAAmB;EAC7EsB,UAAU;IAACjC,WAAWkC;;EACtBtB,OAAcC,cAAO;IACnBsB,SAAgBR,cAAOH,YAAY;MAAEC,aAAa;IAA8B,CAAA;IAChFW,QAAeT,cAAOH,YAAY;MAAEC,aAAa;IAA0B,CAAA;IAC3EY,KAAYjB,gBAAgBL,WAAIS,YAAY;MAAEC,aAAa;IAAgC,CAAA,CAAA;EAC7F,CAAA;EACAJ,QAAeC;AACjB,CAAA;AAKO,IAAMgB,cAAcrC,UAAUQ,KAAK;EACxCP,MAAM;IAAEQ,KAAK,GAAGP,eAAAA;IAAgCQ,MAAM;EAAe;EACrEC,OAAcC,cAAO;IACnBC,OAAcC,WAAIS,YAAY;MAAEC,aAAa;IAAmB,CAAA;IAChET,MAAMX,KAAKmB,YAAY;MAAEC,aAAa;IAA8B,CAAA;IACpEC,WAAkBC,cAAOH,YAAY;MAAEC,aAAa;IAA6B,CAAA;IACjFR,OAAcC,cAAOM,YAAY;MAAEC,aAAa;IAA8B,CAAA;IAC9EG,UAAiBb,WAAIS,YAAY;MAAEC,aAAa;IAA2B,CAAA;IAC3EI,QAAeC,aAAaf,UAAG,EAAES,YAAY;MAAEC,aAAa;IAA8B,CAAA;EAC5F,CAAA;EACAJ,QAAeC;AACjB,CAAA;",
6
- "names": ["Schema", "Capability", "Operation", "meta", "SHEET_OPERATION", "id", "Axis", "Union", "Literal", "InsertAxis", "make", "key", "name", "input", "Struct", "model", "Any", "axis", "index", "Number", "count", "optional", "output", "Void", "DropAxisOutput", "annotations", "description", "axisIndex", "String", "axisMeta", "values", "Array", "DropAxis", "ScrollToAnchor", "services", "Service", "subject", "cursor", "ref", "RestoreAxis"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/capabilities.ts", "../../../src/types/Sheet.ts", "../../../src/types/util.ts", "../../../src/types/sheet-range-types.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { type ComputeGraphRegistry } from '@dxos/compute-hyperformula';\nimport { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';\n\nimport { meta } from '#meta';\n\nexport type GridEntry = { grid: DxGridElement; setActiveRefs: (refs: GridContentProps['activeRefs']) => void };\n\nexport type GridRegistry = {\n register: (attendableId: string, grid: DxGridElement, setActiveRefs: GridEntry['setActiveRefs']) => void;\n unregister: (attendableId: string) => void;\n get: (attendableId: string) => GridEntry | undefined;\n};\n\nexport namespace SheetCapabilities {\n export const ComputeGraphRegistry = Capability.make<ComputeGraphRegistry>(\n `${meta.id}.capability.compute-graph-registry`,\n );\n\n /** Registry of active grid instances keyed by attendable ID. */\n export const GridInstances = Capability.make<GridRegistry>(`${meta.id}.capability.grid-instances`);\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { addressFromA1Notation, isFormula } from '@dxos/compute-hyperformula';\nimport { Annotation, Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\n\nimport { addressToIndex, initialize, mapFormulaRefsToIndices } from './util';\n\nexport type SheetSize = {\n rows: number;\n columns: number;\n};\n\nexport const CellValue = Schema.Struct({\n // TODO(burdon): How to store dates (datetime, date, time), percentages, etc.\n // Consider import/export; natural access for other plugins. Special handling for currency (precision).\n // TODO(burdon): Automerge (long string) or short string or number.\n value: Schema.Any,\n});\n\nexport type CellValue = Schema.Schema.Type<typeof CellValue>;\n\n// TODO(burdon): IMPORTANT: Reconcile with Field definition.\nexport const Range = Schema.Struct({\n range: Schema.String,\n key: Schema.String,\n value: Schema.String,\n});\n\nexport type Range = Schema.Schema.Type<typeof Range>;\n\n// TODO(burdon): Visibility, locked, frozen, etc.\nexport const RowColumnMeta = Schema.Struct({\n size: Schema.optional(Schema.Number),\n});\n\n// TODO(burdon): Reconcile col/column (across packages).\n// TODO(burdon): Index to all updates when rows/columns are inserted/deleted.\nexport const Sheet = Schema.Struct({\n name: Schema.optional(Schema.String),\n\n // Sparse map of cells referenced by index.\n cells: Schema.Record({ key: Schema.String, value: CellValue }).pipe(FormInputAnnotation.set(false)),\n\n // Ordered row indices.\n rows: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),\n\n // Ordered column indices.\n columns: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),\n\n // Row metadata referenced by index.\n rowMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),\n\n // Column metadata referenced by index.\n columnMeta: Schema.Record({ key: Schema.String, value: RowColumnMeta }).pipe(FormInputAnnotation.set(false)),\n\n // Cell formatting referenced by indexed range.\n ranges: Schema.Array(Range).pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.sheet',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--grid-nine--regular',\n hue: 'indigo',\n }),\n);\n\nexport interface Sheet extends Schema.Schema.Type<typeof Sheet> {}\n\nexport type SheetProps = {\n name?: string;\n cells?: Record<string, CellValue>;\n} & Partial<SheetSize>;\n\nexport const make = ({ name, cells = {}, ...size }: SheetProps = {}) => {\n const sheet = Obj.make(Sheet, { name, cells: {}, rows: [], columns: [], rowMeta: {}, columnMeta: {}, ranges: [] });\n\n // Initialize and set cells within Obj.update to satisfy change context requirements.\n Obj.update(sheet, (sheet) => {\n initialize(sheet, size);\n\n if (cells) {\n Object.entries(cells).forEach(([key, { value }]) => {\n const idx = addressToIndex(sheet, addressFromA1Notation(key));\n if (isFormula(value)) {\n value = mapFormulaRefsToIndices(sheet, value);\n }\n\n sheet.cells[idx] = { value };\n });\n }\n });\n\n return sheet;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport {\n type CellAddress,\n type CellRange,\n type CompleteCellRange,\n addressFromA1Notation,\n addressToA1Notation,\n isFormula,\n} from '@dxos/compute-hyperformula';\nimport { randomBytes } from '@dxos/crypto';\nimport { type Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\n\nimport { type Sheet } from '../types';\n\nexport const MAX_ROWS = 500;\nexport const MAX_COLS = 676; // 26^2;\n\nexport const DEFAULT_ROWS = 50;\nexport const DEFAULT_COLS = 26;\n\n// TODO(burdon): Factor out from dxos/protocols to new common package.\nexport class ApiError extends Error {}\n\nexport class ReadonlyException extends ApiError {}\n\nexport class RangeException extends ApiError {\n constructor(n: number) {\n super();\n }\n}\n\n/**\n * With a string length of 8, the chance of a collision is 0.02% for a sheet with 10,000 strings.\n */\nexport const createIndex = (length = 8): string => {\n const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n const randomBuffer = randomBytes(length);\n return Array.from(randomBuffer, (byte) => characters[byte % charactersLength]).join('');\n};\n\nexport const createIndices = (length: number): string[] => Array.from({ length }).map(() => createIndex());\n\nexport const insertIndices = (indices: string[], i: number, n: number, max: number) => {\n if (i + n > max) {\n throw new RangeException(i + n);\n }\n\n const idx = createIndices(n);\n indices.splice(i, 0, ...idx);\n return idx;\n};\n\nexport const initialize = (\n sheet: Obj.Mutable<Sheet.Sheet>,\n { rows = DEFAULT_ROWS, columns = DEFAULT_COLS }: Partial<Sheet.SheetSize> = {},\n) => {\n if (!sheet.rows.length) {\n insertIndices(sheet.rows, 0, rows, MAX_ROWS);\n }\n if (!sheet.columns.length) {\n insertIndices(sheet.columns, 0, columns, MAX_COLS);\n }\n};\n\n/**\n * E.g., \"A1\" => \"CA2@CB3\".\n */\nexport const addressToIndex = (sheet: Sheet.Sheet, cell: CellAddress): string => {\n return `${sheet.columns[cell.col]}@${sheet.rows[cell.row]}`;\n};\n\n/**\n * E.g., \"CA2@CB3\" => \"A1\".\n */\nexport const addressFromIndex = (sheet: Sheet.Sheet, idx: string): CellAddress => {\n const [column, row] = idx.split('@');\n return {\n col: sheet.columns.indexOf(column),\n row: sheet.rows.indexOf(row),\n };\n};\n\n/**\n * E.g., \"A1:B2\" => \"CA2@CB3:CC4@CD5\".\n */\nexport const rangeToIndex = (sheet: Sheet.Sheet, range: CellRange): string => {\n return [range.from, range.to ?? range.from].map((cell) => addressToIndex(sheet, cell)).join(':');\n};\n\n/**\n * E.g., \"CA2@CB3:CC4@CD5\" => \"A1:B2\".\n */\nexport const rangeFromIndex = (sheet: Sheet.Sheet, idx: string): CompleteCellRange => {\n const [from, to] = idx.split(':').map((index) => addressFromIndex(sheet, index));\n return { from, to };\n};\n\n/**\n * Compares the positions of two cell indexes in a sheet.\n * Sorts primarily by row, then by column if rows are equal.\n */\nexport const compareIndexPositions = (sheet: Sheet.Sheet, indexA: string, indexB: string): number => {\n const { row: rowA, col: columnA } = addressFromIndex(sheet, indexA);\n const { row: rowB, col: columnB } = addressFromIndex(sheet, indexB);\n\n // Sort by row first, then by column.\n if (rowA !== rowB) {\n return rowA - rowB;\n } else {\n return columnA - columnB;\n }\n};\n\n// TODO(burdon): Tests.\n\n/**\n * Map from A1 notation to indices.\n */\nexport const mapFormulaRefsToIndices = (sheet: Sheet.Sheet, formula: string): string => {\n invariant(isFormula(formula));\n return formula.replace(/([a-zA-Z]+)([0-9]+)/g, (match) => {\n return addressToIndex(sheet, addressFromA1Notation(match));\n });\n};\n\n/**\n * Map from indices to A1 notation.\n */\nexport const mapFormulaIndicesToRefs = (sheet: Sheet.Sheet, formula: string): string => {\n invariant(isFormula(formula));\n return formula.replace(/([a-zA-Z0-9]+)@([a-zA-Z0-9]+)/g, (idx) => {\n return addressToA1Notation(addressFromIndex(sheet, idx));\n });\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ClassNameValue } from '@dxos/react-ui';\n\nimport { type Sheet } from '../types';\n\nexport const alignKey = 'alignment';\nexport type AlignKey = typeof alignKey;\nexport type AlignValue = 'start' | 'center' | 'end';\n\nexport const commentKey = 'comment';\nexport type CommentKey = typeof commentKey;\nexport type CommentValue = string;\n\nexport const styleKey = 'style';\nexport type StyleKey = typeof styleKey;\nexport type StyleValue = 'highlight' | 'softwrap';\n\n// TODO(burdon): Reconcile with plugin-table.\nexport const cellClassNameForRange = ({ key, value }: Sheet.Sheet['ranges'][number]): ClassNameValue => {\n switch (key) {\n case alignKey:\n switch (value) {\n case 'start':\n return 'text-start';\n case 'center':\n return 'text-center';\n case 'end':\n return 'text-end';\n default:\n return undefined;\n }\n\n case commentKey:\n return 'bg-grid-comment';\n\n case styleKey:\n switch (value) {\n case 'highlight':\n return 'bg-grid-highlight!';\n case 'softwrap':\n return 'whitespace-normal!';\n default:\n return undefined;\n }\n\n default:\n return undefined;\n }\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Sheet from './Sheet';\n\n// TODO(wittjosiah): Factor out. This is `DxGridAxis` from `@dxos/react-ui-grid`.\nconst ActionAxis = Schema.Union(Schema.Literal('row'), Schema.Literal('col'));\n\nexport namespace SheetAction {\n export const RestoreAxis = Schema.Struct({\n axis: ActionAxis,\n axisIndex: Schema.String,\n index: Schema.Number,\n axisMeta: Sheet.RowColumnMeta,\n values: Schema.Array(Schema.Any),\n });\n\n export type RestoreAxis = Schema.Schema.Type<typeof RestoreAxis>;\n}\n"],
5
- "mappings": ";;;;;AAIA,SAASA,kBAAkB;AAI3B,SAASC,YAAY;UAUJC,oBAAAA;qBACFC,uBAAuBH,WAAWI,KAC7C,GAAGH,KAAKI,EAAE,oCAAoC;qBAInCC,gBAAgBN,WAAWI,KAAmB,GAAGH,KAAKI,EAAE,4BAA4B;AACnG,GAPiBH,sBAAAA,oBAAAA,CAAAA,EAAAA;;;;AClBjB;;;;;;;;AAMA,YAAYK,YAAY;AAExB,SAASC,yBAAAA,wBAAuBC,aAAAA,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AeC,cAAaC,WAAG;EACjC,CAAA;AAGF,GAViBZ,gBAAAA,cAAAA,CAAAA,EAAAA;;",
6
- "names": ["Capability", "meta", "SheetCapabilities", "ComputeGraphRegistry", "make", "id", "GridInstances", "Schema", "addressFromA1Notation", "isFormula", "Annotation", "Obj", "Type", "FormInputAnnotation", "addressFromA1Notation", "addressToA1Notation", "isFormula", "randomBytes", "invariant", "MAX_ROWS", "DEFAULT_ROWS", "DEFAULT_COLS", "ApiError", "ReadonlyException", "RangeException", "charactersLength", "characters", "length", "randomBuffer", "byte", "createIndices", "Array", "map", "createIndex", "i", "n", "idx", "indices", "insertIndices", "sheet", "col", "columns", "indexOf", "column", "row", "range", "from", "cell", "to", "rowB", "addressFromIndex", "indexB", "rowA", "columnA", "formula", "match", "addressToIndex", "CellValue", "Struct", "value", "Any", "Range", "range", "String", "key", "RowColumnMeta", "size", "optional", "Number", "Sheet", "name", "cells", "Record", "pipe", "FormInputAnnotation", "set", "rows", "Array", "columns", "rowMeta", "columnMeta", "ranges", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "icon", "hue", "make", "sheet", "Obj", "update", "initialize", "Object", "entries", "forEach", "idx", "addressToIndex", "addressFromA1Notation", "isFormula", "mapFormulaRefsToIndices", "alignKey", "commentKey", "styleKey", "cellClassNameForRange", "key", "value", "undefined", "Schema", "ActionAxis", "Union", "Literal", "SheetAction", "RestoreAxis", "Struct", "axis", "axisIndex", "String", "index", "Number", "axisMeta", "RowColumnMeta", "values", "Array", "Any"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/drop-axis.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\n\nimport { DropAxis } from './definitions';\n\nconst handler: Operation.WithHandler<typeof DropAxis> = DropAxis.pipe(\n Operation.withHandler(({ model, axis, axisIndex }) =>\n Effect.sync(() => {\n const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);\n return {\n axis: undoData.axis,\n axisIndex: undoData.axisIndex,\n index: undoData.index,\n axisMeta: undoData.axisMeta,\n values: undoData.values,\n };\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAI1B,IAAMC,UAAkDC,SAASC,KAC/DC,UAAUC,YAAY,CAAC,EAAEC,OAAOC,MAAMC,UAAS,MACtCC,YAAK,MAAA;AACV,QAAMC,WAAWJ,MAAMC,SAAS,QAAQ,eAAe,SAAA,EAAWC,SAAAA;AAClE,SAAO;IACLD,MAAMG,SAASH;IACfC,WAAWE,SAASF;IACpBG,OAAOD,SAASC;IAChBC,UAAUF,SAASE;IACnBC,QAAQH,SAASG;EACnB;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,oBAAeZ;",
6
- "names": ["Effect", "Operation", "handler", "DropAxis", "pipe", "Operation", "withHandler", "model", "axis", "axisIndex", "sync", "undoData", "index", "axisMeta", "values"]
7
- }