@dxos/plugin-sheet 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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.
- package/dist/lib/browser/RangeList-S3SHV7T6.mjs +53 -0
- package/dist/lib/browser/RangeList-S3SHV7T6.mjs.map +7 -0
- package/dist/lib/browser/SheetContainer-I3NFVVDQ.mjs +1805 -0
- package/dist/lib/browser/SheetContainer-I3NFVVDQ.mjs.map +7 -0
- package/dist/lib/browser/anchor-sort-DZ3IHHJJ.mjs +24 -0
- package/dist/lib/browser/anchor-sort-DZ3IHHJJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SSN4HYJL.mjs → chunk-NNWF7EKC.mjs} +17 -17
- package/dist/lib/browser/chunk-NNWF7EKC.mjs.map +7 -0
- package/dist/lib/browser/chunk-S445OQGW.mjs +397 -0
- package/dist/lib/browser/chunk-S445OQGW.mjs.map +7 -0
- package/dist/lib/browser/compute-graph-registry-W6HO2G3P.mjs +21 -0
- package/dist/lib/browser/compute-graph-registry-W6HO2G3P.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +71 -80
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/markdown-S6GVLHB4.mjs +29 -0
- package/dist/lib/browser/markdown-S6GVLHB4.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-Z4X4UWNR.mjs +79 -0
- package/dist/lib/browser/operation-resolver-Z4X4UWNR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-KIU6DGKW.mjs +51 -0
- package/dist/lib/browser/react-surface-KIU6DGKW.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -12
- package/dist/lib/node-esm/RangeList-IB23OJK2.mjs +54 -0
- package/dist/lib/node-esm/RangeList-IB23OJK2.mjs.map +7 -0
- package/dist/lib/node-esm/SheetContainer-KUXNCSFP.mjs +1806 -0
- package/dist/lib/node-esm/SheetContainer-KUXNCSFP.mjs.map +7 -0
- package/dist/lib/node-esm/anchor-sort-24OXMOSX.mjs +25 -0
- package/dist/lib/node-esm/anchor-sort-24OXMOSX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IK4O7FUJ.mjs → chunk-M52YLLWU.mjs} +17 -17
- package/dist/lib/node-esm/chunk-M52YLLWU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NKZ3O4OR.mjs +398 -0
- package/dist/lib/node-esm/chunk-NKZ3O4OR.mjs.map +7 -0
- package/dist/lib/node-esm/compute-graph-registry-2C3Y2RPQ.mjs +22 -0
- package/dist/lib/node-esm/compute-graph-registry-2C3Y2RPQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +71 -80
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/markdown-YT5KJTQT.mjs +30 -0
- package/dist/lib/node-esm/markdown-YT5KJTQT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-7VD2YXSQ.mjs +80 -0
- package/dist/lib/node-esm/operation-resolver-7VD2YXSQ.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-7FZAE3S7.mjs +52 -0
- package/dist/lib/node-esm/react-surface-7FZAE3S7.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -12
- package/dist/types/src/SheetPlugin.d.ts +2 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts +6 -0
- package/dist/types/src/capabilities/anchor-sort/anchor-sort.d.ts.map +1 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts +3 -0
- package/dist/types/src/capabilities/anchor-sort/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts +5 -0
- package/dist/types/src/capabilities/compute-graph-registry/compute-graph-registry.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-graph-registry/index.d.ts +3 -0
- package/dist/types/src/capabilities/compute-graph-registry/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
- package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts +11 -0
- package/dist/types/src/components/Sheet/Sheet.d.ts.map +1 -0
- package/dist/types/src/components/Sheet/index.d.ts +2 -0
- package/dist/types/src/components/Sheet/index.d.ts.map +1 -0
- package/dist/types/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.d.ts +1 -1
- package/dist/types/src/components/SheetContent/SheetCellEditor.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts +5 -0
- package/dist/types/src/components/SheetContent/SheetContent.d.ts.map +1 -0
- package/dist/types/src/components/{GridSheet/GridSheet.stories.d.ts → SheetContent/SheetContent.stories.d.ts} +5 -4
- package/dist/types/src/components/SheetContent/SheetContent.stories.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/index.d.ts +2 -0
- package/dist/types/src/components/SheetContent/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetContent/util.d.ts.map +1 -0
- package/dist/types/src/components/{SheetContext/SheetContext.d.ts → SheetRoot/SheetRoot.d.ts} +6 -6
- package/dist/types/src/components/SheetRoot/SheetRoot.d.ts.map +1 -0
- package/dist/types/src/components/SheetRoot/index.d.ts +2 -0
- package/dist/types/src/components/SheetRoot/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts +5 -0
- package/dist/types/src/components/SheetStatusbar/SheetStatusbar.d.ts.map +1 -0
- package/dist/types/src/components/SheetStatusbar/index.d.ts +2 -0
- package/dist/types/src/components/SheetStatusbar/index.d.ts.map +1 -0
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts +6 -4
- package/dist/types/src/components/SheetToolbar/SheetToolbar.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +2 -0
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/align.d.ts +12 -19
- package/dist/types/src/components/SheetToolbar/align.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/style.d.ts +12 -18
- package/dist/types/src/components/SheetToolbar/style.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts +14 -1
- package/dist/types/src/components/SheetToolbar/useToolbarState.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers}/RangeList/RangeList.d.ts +2 -2
- package/dist/types/src/containers/RangeList/RangeList.d.ts.map +1 -0
- package/dist/types/src/containers/RangeList/index.d.ts +3 -0
- package/dist/types/src/containers/RangeList/index.d.ts.map +1 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts +12 -0
- package/dist/types/src/containers/SheetContainer/SheetContainer.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SheetContainer/SheetContainer.stories.d.ts +4 -3
- package/dist/types/src/containers/SheetContainer/SheetContainer.stories.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SheetContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/editor/sheet-extension.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +6 -6
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/model/testing.d.ts +2 -2
- package/dist/types/src/model/testing.d.ts.map +1 -1
- package/dist/types/src/model/useSheetModel.d.ts +2 -2
- package/dist/types/src/model/useSheetModel.d.ts.map +1 -1
- package/dist/types/src/serializer.d.ts +2 -2
- package/dist/types/src/serializer.d.ts.map +1 -1
- package/dist/types/src/testing/data.d.ts +2 -2
- package/dist/types/src/testing/data.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +26 -2
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Sheet.d.ts +76 -0
- package/dist/types/src/types/Sheet.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +6 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/sheet-range-types.d.ts +2 -2
- package/dist/types/src/types/sheet-range-types.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +91 -74
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/types/util.d.ts +10 -10
- package/dist/types/src/types/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +74 -67
- package/src/SheetPlugin.tsx +41 -61
- package/src/capabilities/anchor-sort/anchor-sort.ts +27 -0
- package/src/capabilities/anchor-sort/index.ts +7 -0
- package/src/capabilities/compute-graph-registry/compute-graph-registry.ts +27 -0
- package/src/capabilities/compute-graph-registry/index.ts +7 -0
- package/src/capabilities/index.ts +5 -9
- package/src/capabilities/markdown/index.ts +7 -0
- package/src/capabilities/markdown/markdown.ts +30 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +77 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +46 -0
- package/src/components/ComputeGraph/compute-graph.stories.tsx +10 -10
- package/src/components/Sheet/Sheet.tsx +20 -0
- package/src/components/Sheet/index.ts +5 -0
- package/src/components/{GridSheet → SheetContent}/SheetCellEditor.stories.tsx +13 -10
- package/src/components/{GridSheet/GridSheet.stories.tsx → SheetContent/SheetContent.stories.tsx} +16 -15
- package/src/components/{GridSheet/GridSheet.tsx → SheetContent/SheetContent.tsx} +52 -39
- package/src/components/{RangeList → SheetContent}/index.ts +1 -1
- package/src/components/{GridSheet → SheetContent}/util.ts +14 -8
- package/src/components/{SheetContext/SheetContext.tsx → SheetRoot/SheetRoot.tsx} +42 -40
- package/src/components/{GridSheet → SheetRoot}/index.ts +1 -1
- package/src/components/{FunctionEditor/FunctionEditor.tsx → SheetStatusbar/SheetStatusbar.tsx} +10 -5
- package/src/components/{FunctionEditor → SheetStatusbar}/index.ts +1 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +4 -4
- package/src/components/SheetToolbar/SheetToolbar.tsx +45 -35
- package/src/components/SheetToolbar/align.ts +44 -19
- package/src/components/SheetToolbar/style.ts +48 -18
- package/src/components/SheetToolbar/useToolbarState.ts +22 -5
- package/src/components/index.ts +1 -7
- package/src/{components → containers}/RangeList/RangeList.tsx +17 -12
- package/src/containers/RangeList/index.ts +7 -0
- package/src/containers/SheetContainer/SheetContainer.stories.tsx +94 -0
- package/src/containers/SheetContainer/SheetContainer.tsx +57 -0
- package/src/{components → containers}/SheetContainer/index.ts +1 -1
- package/src/containers/index.ts +8 -0
- package/src/extensions/compute.stories.tsx +24 -14
- package/src/extensions/compute.ts +1 -1
- package/src/extensions/editor/sheet-extension.ts +16 -13
- package/src/index.ts +1 -1
- package/src/integrations/thread-ranges.ts +38 -49
- package/src/meta.ts +8 -4
- package/src/model/sheet-model.test.ts +4 -4
- package/src/model/sheet-model.ts +80 -48
- package/src/model/testing.ts +4 -4
- package/src/model/useSheetModel.ts +2 -2
- package/src/playwright/playwright.config.ts +1 -1
- package/src/playwright/sheet.spec.ts +2 -1
- package/src/sanity.test.ts +3 -4
- package/src/serializer.ts +4 -4
- package/src/testing/data.ts +2 -2
- package/src/testing/testing.tsx +3 -3
- package/src/translations.ts +3 -2
- package/src/types/Sheet.ts +97 -0
- package/src/{capabilities → types}/capabilities.ts +2 -2
- package/src/types/index.ts +2 -1
- package/src/types/sheet-range-types.ts +5 -5
- package/src/types/types.ts +82 -48
- package/src/types/util.ts +11 -38
- package/dist/lib/browser/SheetContainer-VL34UND4.mjs +0 -351
- package/dist/lib/browser/SheetContainer-VL34UND4.mjs.map +0 -7
- package/dist/lib/browser/anchor-sort-3N44DS5F.mjs +0 -24
- package/dist/lib/browser/anchor-sort-3N44DS5F.mjs.map +0 -7
- package/dist/lib/browser/chunk-ADK2HW4A.mjs +0 -906
- package/dist/lib/browser/chunk-ADK2HW4A.mjs.map +0 -7
- package/dist/lib/browser/chunk-CSBSADPQ.mjs +0 -16
- package/dist/lib/browser/chunk-CSBSADPQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-SSN4HYJL.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZJWJMX4E.mjs +0 -852
- package/dist/lib/browser/chunk-ZJWJMX4E.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZMPNHFIP.mjs +0 -15
- package/dist/lib/browser/chunk-ZMPNHFIP.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-MF65HGGM.mjs +0 -21
- package/dist/lib/browser/compute-graph-registry-MF65HGGM.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BQLV6IAA.mjs +0 -56
- package/dist/lib/browser/intent-resolver-BQLV6IAA.mjs.map +0 -7
- package/dist/lib/browser/markdown-RMTMI237.mjs +0 -26
- package/dist/lib/browser/markdown-RMTMI237.mjs.map +0 -7
- package/dist/lib/browser/react-surface-7ZDMQDCT.mjs +0 -53
- package/dist/lib/browser/react-surface-7ZDMQDCT.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-NWJ7L6FC.mjs +0 -352
- package/dist/lib/node-esm/SheetContainer-NWJ7L6FC.mjs.map +0 -7
- package/dist/lib/node-esm/anchor-sort-YL2OZHYM.mjs +0 -25
- package/dist/lib/node-esm/anchor-sort-YL2OZHYM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BZAPYBSH.mjs +0 -907
- package/dist/lib/node-esm/chunk-BZAPYBSH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H3GSD33H.mjs +0 -18
- package/dist/lib/node-esm/chunk-H3GSD33H.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IK4O7FUJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LN6ZSAII.mjs +0 -16
- package/dist/lib/node-esm/chunk-LN6ZSAII.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YL7BVJPC.mjs +0 -853
- package/dist/lib/node-esm/chunk-YL7BVJPC.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-P2O5LDFZ.mjs +0 -22
- package/dist/lib/node-esm/compute-graph-registry-P2O5LDFZ.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-MV5ZFXAQ.mjs +0 -57
- package/dist/lib/node-esm/intent-resolver-MV5ZFXAQ.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-EDIWHA3P.mjs +0 -27
- package/dist/lib/node-esm/markdown-EDIWHA3P.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-TUME5MM2.mjs +0 -54
- package/dist/lib/node-esm/react-surface-TUME5MM2.mjs.map +0 -7
- package/dist/types/src/capabilities/anchor-sort.d.ts +0 -6
- package/dist/types/src/capabilities/anchor-sort.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-graph-registry.d.ts +0 -4
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts +0 -3
- package/dist/types/src/components/FunctionEditor/FunctionEditor.d.ts.map +0 -1
- package/dist/types/src/components/FunctionEditor/index.d.ts +0 -2
- package/dist/types/src/components/FunctionEditor/index.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts +0 -3
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/index.d.ts +0 -2
- package/dist/types/src/components/GridSheet/index.d.ts.map +0 -1
- package/dist/types/src/components/GridSheet/util.d.ts.map +0 -1
- package/dist/types/src/components/RangeList/RangeList.d.ts.map +0 -1
- package/dist/types/src/components/RangeList/index.d.ts +0 -2
- package/dist/types/src/components/RangeList/index.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts +0 -11
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +0 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/SheetContext/SheetContext.d.ts.map +0 -1
- package/dist/types/src/components/SheetContext/index.d.ts +0 -2
- package/dist/types/src/components/SheetContext/index.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -37
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/anchor-sort.ts +0 -22
- package/src/capabilities/compute-graph-registry.ts +0 -23
- package/src/capabilities/intent-resolver.ts +0 -38
- package/src/capabilities/markdown.ts +0 -23
- package/src/capabilities/react-surface.tsx +0 -40
- package/src/components/SheetContainer/SheetContainer.stories.tsx +0 -90
- package/src/components/SheetContainer/SheetContainer.tsx +0 -40
- package/src/components/SheetContext/index.ts +0 -5
- package/src/types/schema.ts +0 -61
- /package/dist/types/src/components/{GridSheet → SheetContent}/util.d.ts +0 -0
- /package/dist/types/src/{components → containers}/SheetContainer/index.d.ts +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { AutomationCapabilities } from '@dxos/plugin-automation';
|
|
7
|
-
|
|
8
|
-
import { SheetCapabilities } from './capabilities';
|
|
9
|
-
|
|
10
|
-
// Locally declare the Automation ComputeRuntime capability by ID to avoid direct import dependency.
|
|
11
|
-
|
|
12
|
-
export default async (context: PluginContext) => {
|
|
13
|
-
// TODO(wittjosiah): This can probably be a module level import now due to lazy capability loading.
|
|
14
|
-
// Async import removes direct dependency on hyperformula.
|
|
15
|
-
const { defaultPlugins, ComputeGraphRegistry } = await import('@dxos/compute');
|
|
16
|
-
const computeRuntimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
|
|
17
|
-
|
|
18
|
-
const computeGraphRegistry = new ComputeGraphRegistry({
|
|
19
|
-
plugins: defaultPlugins,
|
|
20
|
-
computeRuntime: computeRuntimeResolver,
|
|
21
|
-
});
|
|
22
|
-
return contributes(SheetCapabilities.ComputeGraphRegistry, computeGraphRegistry);
|
|
23
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { meta } from '../meta';
|
|
8
|
-
import { SheetAction, createSheet } from '../types';
|
|
9
|
-
|
|
10
|
-
export default () =>
|
|
11
|
-
contributes(Capabilities.IntentResolver, [
|
|
12
|
-
createResolver({
|
|
13
|
-
intent: SheetAction.Create,
|
|
14
|
-
resolve: ({ name }) => ({ data: { object: createSheet({ name }) } }),
|
|
15
|
-
}),
|
|
16
|
-
createResolver({
|
|
17
|
-
intent: SheetAction.InsertAxis,
|
|
18
|
-
resolve: ({ model, axis, index, count }) => {
|
|
19
|
-
const _indices = model[axis === 'col' ? 'insertColumns' : 'insertRows'](index, count);
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
createResolver({
|
|
23
|
-
intent: SheetAction.DropAxis,
|
|
24
|
-
resolve: ({ model, axis, axisIndex, deletionData }, undo) => {
|
|
25
|
-
if (!undo) {
|
|
26
|
-
const undoData = model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
27
|
-
return {
|
|
28
|
-
undoable: {
|
|
29
|
-
message: [`${axis} dropped label`, { ns: meta.id }],
|
|
30
|
-
data: { ...undoData, model },
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
} else if (undo && deletionData) {
|
|
34
|
-
model[deletionData.axis === 'col' ? 'restoreColumn' : 'restoreRow'](deletionData);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
|
-
]);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { getSpace } from '@dxos/client/echo';
|
|
7
|
-
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
8
|
-
|
|
9
|
-
import { computeGraphFacet } from '../extensions';
|
|
10
|
-
|
|
11
|
-
import { SheetCapabilities } from './capabilities';
|
|
12
|
-
|
|
13
|
-
export default (context: PluginContext) =>
|
|
14
|
-
contributes(MarkdownCapabilities.Extensions, [
|
|
15
|
-
({ document: doc }) => {
|
|
16
|
-
const computeGraphRegistry = context.getCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
17
|
-
const space = getSpace(doc);
|
|
18
|
-
if (space) {
|
|
19
|
-
const computeGraph = computeGraphRegistry.getOrCreateGraph(space);
|
|
20
|
-
return computeGraphFacet.of(computeGraph);
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
]);
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
10
|
-
|
|
11
|
-
import { ComputeGraphContextProvider, RangeList, SheetContainer } from '../components';
|
|
12
|
-
import { meta } from '../meta';
|
|
13
|
-
import { SheetType } from '../types';
|
|
14
|
-
|
|
15
|
-
import { SheetCapabilities } from './capabilities';
|
|
16
|
-
|
|
17
|
-
export default () =>
|
|
18
|
-
contributes(Capabilities.ReactSurface, [
|
|
19
|
-
createSurface({
|
|
20
|
-
id: `${meta.id}/sheet`,
|
|
21
|
-
role: ['article', 'section'],
|
|
22
|
-
filter: (data): data is { subject: SheetType } =>
|
|
23
|
-
Obj.instanceOf(SheetType, data.subject) && !!getSpace(data.subject),
|
|
24
|
-
component: ({ data, role }) => {
|
|
25
|
-
const computeGraphRegistry = useCapability(SheetCapabilities.ComputeGraphRegistry);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<ComputeGraphContextProvider registry={computeGraphRegistry}>
|
|
29
|
-
<SheetContainer space={getSpace(data.subject)!} sheet={data.subject} role={role} />
|
|
30
|
-
</ComputeGraphContextProvider>
|
|
31
|
-
);
|
|
32
|
-
},
|
|
33
|
-
}),
|
|
34
|
-
createSurface({
|
|
35
|
-
id: `${meta.id}/object-settings`,
|
|
36
|
-
role: 'object-settings',
|
|
37
|
-
filter: (data): data is { subject: SheetType } => Obj.instanceOf(SheetType, data.subject),
|
|
38
|
-
component: ({ data }) => <RangeList sheet={data.subject} />,
|
|
39
|
-
}),
|
|
40
|
-
]);
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta } from '@storybook/react-vite';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, IntentPlugin, contributes, createResolver } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
11
|
-
import { fullyQualifiedId, useSpace } from '@dxos/react-client/echo';
|
|
12
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
|
-
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
15
|
-
import { withAttention } from '@dxos/react-ui-attention/testing';
|
|
16
|
-
|
|
17
|
-
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '../../testing';
|
|
18
|
-
import { translations } from '../../translations';
|
|
19
|
-
import { SheetAction, SheetType } from '../../types';
|
|
20
|
-
import { useComputeGraph } from '../ComputeGraph';
|
|
21
|
-
import { RangeList } from '../RangeList';
|
|
22
|
-
|
|
23
|
-
import { SheetContainer } from './SheetContainer';
|
|
24
|
-
|
|
25
|
-
const meta = {
|
|
26
|
-
title: 'plugins/plugin-sheet/SheetContainer',
|
|
27
|
-
component: SheetContainer,
|
|
28
|
-
decorators: [
|
|
29
|
-
withTheme,
|
|
30
|
-
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
31
|
-
withComputeGraphDecorator(),
|
|
32
|
-
withAttention,
|
|
33
|
-
// TODO(wittjosiah): Consider whether we should refactor component so story doesn't need to depend on intents.
|
|
34
|
-
withPluginManager({
|
|
35
|
-
plugins: [IntentPlugin(), GraphPlugin()],
|
|
36
|
-
capabilities: [
|
|
37
|
-
contributes(
|
|
38
|
-
Capabilities.IntentResolver,
|
|
39
|
-
createResolver({
|
|
40
|
-
intent: SheetAction.DropAxis,
|
|
41
|
-
resolve: ({ model, axis, axisIndex }) => {
|
|
42
|
-
model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
45
|
-
),
|
|
46
|
-
],
|
|
47
|
-
}),
|
|
48
|
-
],
|
|
49
|
-
parameters: {
|
|
50
|
-
layout: 'fullscreen',
|
|
51
|
-
translations,
|
|
52
|
-
},
|
|
53
|
-
} satisfies Meta<typeof SheetContainer>;
|
|
54
|
-
|
|
55
|
-
export default meta;
|
|
56
|
-
|
|
57
|
-
export const Default = () => {
|
|
58
|
-
const space = useSpace();
|
|
59
|
-
const graph = useComputeGraph(space);
|
|
60
|
-
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
61
|
-
if (!sheet || !space) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
|
|
67
|
-
<SheetContainer space={space} sheet={sheet} role='story' ignoreAttention />
|
|
68
|
-
</AttendableContainer>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const Spec = () => {
|
|
73
|
-
const space = useSpace();
|
|
74
|
-
const graph = useComputeGraph(space);
|
|
75
|
-
const sheet = useTestSheet(space, graph, { cells: { A1: { value: 'Ready' } } });
|
|
76
|
-
if (!sheet || !space) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
|
|
82
|
-
<div role='none' className='grid grid-rows-[66%_33%] bs-full grid-cols-1'>
|
|
83
|
-
<SheetContainer space={space} sheet={sheet} role='story' ignoreAttention />
|
|
84
|
-
<div role='none' data-testid='grid.range-list'>
|
|
85
|
-
<RangeList sheet={sheet} />
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</AttendableContainer>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space, fullyQualifiedId } from '@dxos/react-client/echo';
|
|
8
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
9
|
-
|
|
10
|
-
import { type SheetType } from '../../types';
|
|
11
|
-
import { useComputeGraph } from '../ComputeGraph';
|
|
12
|
-
import { FunctionEditor } from '../FunctionEditor';
|
|
13
|
-
import { GridSheet } from '../GridSheet';
|
|
14
|
-
import { SheetProvider } from '../SheetContext';
|
|
15
|
-
import { SheetToolbar } from '../SheetToolbar';
|
|
16
|
-
|
|
17
|
-
export type SheetContainerProps = {
|
|
18
|
-
space: Space;
|
|
19
|
-
sheet: SheetType;
|
|
20
|
-
role?: string;
|
|
21
|
-
ignoreAttention?: boolean;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const SheetContainer = ({ space, sheet, role, ignoreAttention }: SheetContainerProps) => {
|
|
25
|
-
const graph = useComputeGraph(space);
|
|
26
|
-
|
|
27
|
-
return graph ? (
|
|
28
|
-
<SheetProvider sheet={sheet} graph={graph} ignoreAttention={ignoreAttention}>
|
|
29
|
-
<StackItem.Content
|
|
30
|
-
toolbar
|
|
31
|
-
statusbar
|
|
32
|
-
classNames={[role === 'section' && 'aspect-video', role === 'story' && 'bs-full']}
|
|
33
|
-
>
|
|
34
|
-
<SheetToolbar id={fullyQualifiedId(sheet)} />
|
|
35
|
-
<GridSheet />
|
|
36
|
-
<FunctionEditor />
|
|
37
|
-
</StackItem.Content>
|
|
38
|
-
</SheetProvider>
|
|
39
|
-
) : null;
|
|
40
|
-
};
|
package/src/types/schema.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
|
|
9
|
-
export const CellValue = Schema.Struct({
|
|
10
|
-
// TODO(burdon): How to store dates (datetime, date, time), percentages, etc.
|
|
11
|
-
// Consider import/export; natural access for other plugins. Special handling for currency (precision).
|
|
12
|
-
// TODO(burdon): Automerge (long string) or short string or number.
|
|
13
|
-
value: Schema.Any,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type CellValue = Schema.Schema.Type<typeof CellValue>;
|
|
17
|
-
|
|
18
|
-
// TODO(burdon): IMPORTANT: Reconcile with Field definition.
|
|
19
|
-
export const Range = Schema.Struct({
|
|
20
|
-
range: Schema.String,
|
|
21
|
-
key: Schema.String,
|
|
22
|
-
value: Schema.String,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export type Range = Schema.Schema.Type<typeof Range>;
|
|
26
|
-
|
|
27
|
-
// TODO(burdon): Visibility, locked, frozen, etc.
|
|
28
|
-
export const RowColumnMeta = Schema.Struct({
|
|
29
|
-
size: Schema.optional(Schema.Number),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// TODO(burdon): Reconcile col/column (across packages).
|
|
33
|
-
// TODO(burdon): Index to all updates when rows/columns are inserted/deleted.
|
|
34
|
-
export const SheetType = Schema.Struct({
|
|
35
|
-
name: Schema.optional(Schema.String),
|
|
36
|
-
|
|
37
|
-
// Sparse map of cells referenced by index.
|
|
38
|
-
cells: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(CellValue) })),
|
|
39
|
-
|
|
40
|
-
// Ordered row indices.
|
|
41
|
-
rows: Schema.mutable(Schema.Array(Schema.String)),
|
|
42
|
-
|
|
43
|
-
// Ordered column indices.
|
|
44
|
-
columns: Schema.mutable(Schema.Array(Schema.String)),
|
|
45
|
-
|
|
46
|
-
// Row metadata referenced by index.
|
|
47
|
-
rowMeta: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(RowColumnMeta) })),
|
|
48
|
-
|
|
49
|
-
// Column metadata referenced by index.
|
|
50
|
-
columnMeta: Schema.mutable(Schema.Record({ key: Schema.String, value: Schema.mutable(RowColumnMeta) })),
|
|
51
|
-
|
|
52
|
-
// Cell formatting referenced by indexed range.
|
|
53
|
-
ranges: Schema.mutable(Schema.Array(Range)),
|
|
54
|
-
}).pipe(
|
|
55
|
-
Type.Obj({
|
|
56
|
-
typename: 'dxos.org/type/Sheet',
|
|
57
|
-
version: '0.1.0',
|
|
58
|
-
}),
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
export interface SheetType extends Schema.Schema.Type<typeof SheetType> {}
|
|
File without changes
|
|
File without changes
|