@dxos/plugin-sheet 0.8.4-main.dedc0f3 → 0.8.4-main.ead640a
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/{SheetContainer-OUN6AARA.mjs → SheetContainer-VL34UND4.mjs} +12 -11
- package/dist/lib/browser/SheetContainer-VL34UND4.mjs.map +7 -0
- package/dist/lib/browser/{anchor-sort-7WD2VGXW.mjs → anchor-sort-3N44DS5F.mjs} +5 -5
- package/dist/lib/browser/{anchor-sort-7WD2VGXW.mjs.map → anchor-sort-3N44DS5F.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-XSXUU6FO.mjs → chunk-ADK2HW4A.mjs} +7 -7
- package/dist/lib/browser/chunk-ADK2HW4A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6AKBCBL4.mjs → chunk-CSBSADPQ.mjs} +2 -4
- package/dist/lib/browser/chunk-CSBSADPQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-X4EWLDT3.mjs → chunk-ZJWJMX4E.mjs} +14 -13
- package/dist/lib/browser/chunk-ZJWJMX4E.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KJWZUQVA.mjs → chunk-ZMPNHFIP.mjs} +4 -4
- package/dist/lib/browser/chunk-ZMPNHFIP.mjs.map +7 -0
- package/dist/lib/browser/compute-graph-registry-MF65HGGM.mjs +21 -0
- package/dist/lib/browser/compute-graph-registry-MF65HGGM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +13 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-ROEY4LHM.mjs → intent-resolver-BQLV6IAA.mjs} +7 -7
- package/dist/lib/browser/intent-resolver-BQLV6IAA.mjs.map +7 -0
- package/dist/lib/browser/{markdown-VOY636TS.mjs → markdown-RMTMI237.mjs} +5 -5
- package/dist/lib/browser/{markdown-VOY636TS.mjs.map → markdown-RMTMI237.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-XCNAVF2M.mjs → react-surface-7ZDMQDCT.mjs} +10 -10
- package/dist/lib/browser/react-surface-7ZDMQDCT.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{SheetContainer-NFLLTGNV.mjs → SheetContainer-NWJ7L6FC.mjs} +12 -11
- package/dist/lib/node-esm/SheetContainer-NWJ7L6FC.mjs.map +7 -0
- package/dist/lib/node-esm/{anchor-sort-ACQDUIPU.mjs → anchor-sort-YL2OZHYM.mjs} +5 -5
- package/dist/lib/node-esm/{anchor-sort-ACQDUIPU.mjs.map → anchor-sort-YL2OZHYM.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-ODP4L4OV.mjs → chunk-BZAPYBSH.mjs} +7 -7
- package/dist/lib/node-esm/chunk-BZAPYBSH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3K5VNYOF.mjs → chunk-H3GSD33H.mjs} +2 -4
- package/dist/lib/node-esm/chunk-H3GSD33H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-6SK5LJ5S.mjs → chunk-LN6ZSAII.mjs} +4 -4
- package/dist/lib/node-esm/chunk-LN6ZSAII.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PYF4ZJXN.mjs → chunk-YL7BVJPC.mjs} +14 -13
- package/dist/lib/node-esm/chunk-YL7BVJPC.mjs.map +7 -0
- package/dist/lib/node-esm/compute-graph-registry-P2O5LDFZ.mjs +22 -0
- package/dist/lib/node-esm/compute-graph-registry-P2O5LDFZ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +13 -13
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HESRI2ML.mjs → intent-resolver-MV5ZFXAQ.mjs} +7 -7
- package/dist/lib/node-esm/intent-resolver-MV5ZFXAQ.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-P4CLZ24C.mjs → markdown-EDIWHA3P.mjs} +5 -5
- package/dist/lib/node-esm/{markdown-P4CLZ24C.mjs.map → markdown-EDIWHA3P.mjs.map} +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-KE3EEVF4.mjs → react-surface-TUME5MM2.mjs} +10 -10
- package/dist/lib/node-esm/react-surface-TUME5MM2.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/SheetPlugin.d.ts +1 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-graph-registry.d.ts.map +1 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts +0 -1
- package/dist/types/src/components/ComputeGraph/compute-graph.stories.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts +1 -2
- package/dist/types/src/components/GridSheet/SheetCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +3 -3
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts +1 -2
- package/dist/types/src/components/SheetToolbar/SheetToolbar.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/compute.stories.d.ts +2 -3
- package/dist/types/src/extensions/compute.stories.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/model/sheet-model.d.ts +1 -1
- package/dist/types/src/model/sheet-model.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +1 -1
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +7 -7
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -61
- package/src/SheetPlugin.tsx +69 -60
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/compute-graph-registry.ts +8 -13
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/components/ComputeGraph/compute-graph.stories.tsx +2 -4
- package/src/components/GridSheet/GridSheet.stories.tsx +11 -8
- package/src/components/GridSheet/GridSheet.tsx +4 -4
- package/src/components/GridSheet/SheetCellEditor.stories.tsx +3 -4
- package/src/components/RangeList/RangeList.tsx +3 -3
- package/src/components/SheetContainer/SheetContainer.stories.tsx +38 -40
- package/src/components/SheetContainer/SheetContainer.tsx +5 -1
- package/src/components/SheetToolbar/SheetToolbar.stories.tsx +9 -6
- package/src/components/SheetToolbar/align.ts +3 -3
- package/src/components/SheetToolbar/style.ts +2 -2
- package/src/extensions/compute.stories.tsx +13 -10
- package/src/integrations/thread-ranges.ts +5 -4
- package/src/meta.ts +1 -3
- package/src/model/sheet-model.ts +1 -1
- package/src/testing/testing.tsx +8 -2
- package/src/types/schema.ts +1 -1
- package/src/types/types.ts +3 -3
- package/dist/lib/browser/SheetContainer-OUN6AARA.mjs.map +0 -7
- package/dist/lib/browser/chunk-6AKBCBL4.mjs.map +0 -7
- package/dist/lib/browser/chunk-KJWZUQVA.mjs.map +0 -7
- package/dist/lib/browser/chunk-X4EWLDT3.mjs.map +0 -7
- package/dist/lib/browser/chunk-XSXUU6FO.mjs.map +0 -7
- package/dist/lib/browser/compute-graph-registry-6YJHXORG.mjs +0 -30
- package/dist/lib/browser/compute-graph-registry-6YJHXORG.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ROEY4LHM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XCNAVF2M.mjs.map +0 -7
- package/dist/lib/node-esm/SheetContainer-NFLLTGNV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3K5VNYOF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6SK5LJ5S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ODP4L4OV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PYF4ZJXN.mjs.map +0 -7
- package/dist/lib/node-esm/compute-graph-registry-ET5KJNLV.mjs +0 -31
- package/dist/lib/node-esm/compute-graph-registry-ET5KJNLV.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HESRI2ML.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-KE3EEVF4.mjs.map +0 -7
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { Capabilities, IntentPlugin, contributes, createResolver } from '@dxos/app-framework';
|
|
@@ -12,9 +10,9 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
12
10
|
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
13
11
|
import { fullyQualifiedId, useSpace } from '@dxos/react-client/echo';
|
|
14
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
15
14
|
import { AttendableContainer } from '@dxos/react-ui-attention';
|
|
16
15
|
import { withAttention } from '@dxos/react-ui-attention/testing';
|
|
17
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
16
|
|
|
19
17
|
import { createTestCells, useTestSheet, withComputeGraphDecorator } from '../../testing';
|
|
20
18
|
import { translations } from '../../translations';
|
|
@@ -24,7 +22,39 @@ import { RangeList } from '../RangeList';
|
|
|
24
22
|
|
|
25
23
|
import { SheetContainer } from './SheetContainer';
|
|
26
24
|
|
|
27
|
-
|
|
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 = () => {
|
|
28
58
|
const space = useSpace();
|
|
29
59
|
const graph = useComputeGraph(space);
|
|
30
60
|
const sheet = useTestSheet(space, graph, { cells: createTestCells() });
|
|
@@ -34,7 +64,7 @@ export const Basic = () => {
|
|
|
34
64
|
|
|
35
65
|
return (
|
|
36
66
|
<AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
|
|
37
|
-
<SheetContainer space={space} sheet={sheet} role='
|
|
67
|
+
<SheetContainer space={space} sheet={sheet} role='story' ignoreAttention />
|
|
38
68
|
</AttendableContainer>
|
|
39
69
|
);
|
|
40
70
|
};
|
|
@@ -49,8 +79,8 @@ export const Spec = () => {
|
|
|
49
79
|
|
|
50
80
|
return (
|
|
51
81
|
<AttendableContainer id={fullyQualifiedId(sheet)} classNames='contents'>
|
|
52
|
-
<div role='none' className='grid grid-rows-[66%_33%] grid-cols-1'>
|
|
53
|
-
<SheetContainer space={space} sheet={sheet} role='
|
|
82
|
+
<div role='none' className='grid grid-rows-[66%_33%] bs-full grid-cols-1'>
|
|
83
|
+
<SheetContainer space={space} sheet={sheet} role='story' ignoreAttention />
|
|
54
84
|
<div role='none' data-testid='grid.range-list'>
|
|
55
85
|
<RangeList sheet={sheet} />
|
|
56
86
|
</div>
|
|
@@ -58,35 +88,3 @@ export const Spec = () => {
|
|
|
58
88
|
</AttendableContainer>
|
|
59
89
|
);
|
|
60
90
|
};
|
|
61
|
-
|
|
62
|
-
const meta = {
|
|
63
|
-
title: 'plugins/plugin-sheet/SheetContainer',
|
|
64
|
-
component: SheetContainer,
|
|
65
|
-
decorators: [
|
|
66
|
-
withClientProvider({ types: [SheetType], createSpace: true }),
|
|
67
|
-
withComputeGraphDecorator(),
|
|
68
|
-
withTheme,
|
|
69
|
-
withLayout({ fullscreen: true, classNames: 'grid' }),
|
|
70
|
-
withAttention,
|
|
71
|
-
// TODO(wittjosiah): Consider whether we should refactor component so story doesn't need to depend on intents.
|
|
72
|
-
withPluginManager({
|
|
73
|
-
plugins: [IntentPlugin(), GraphPlugin()],
|
|
74
|
-
capabilities: [
|
|
75
|
-
contributes(
|
|
76
|
-
Capabilities.IntentResolver,
|
|
77
|
-
createResolver({
|
|
78
|
-
intent: SheetAction.DropAxis,
|
|
79
|
-
resolve: ({ model, axis, axisIndex }) => {
|
|
80
|
-
model[axis === 'col' ? 'dropColumn' : 'dropRow'](axisIndex);
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
),
|
|
84
|
-
],
|
|
85
|
-
}),
|
|
86
|
-
],
|
|
87
|
-
parameters: { translations },
|
|
88
|
-
} satisfies Meta<typeof SheetContainer>;
|
|
89
|
-
|
|
90
|
-
export default meta;
|
|
91
|
-
|
|
92
|
-
type Story = StoryObj<typeof meta>;
|
|
@@ -26,7 +26,11 @@ export const SheetContainer = ({ space, sheet, role, ignoreAttention }: SheetCon
|
|
|
26
26
|
|
|
27
27
|
return graph ? (
|
|
28
28
|
<SheetProvider sheet={sheet} graph={graph} ignoreAttention={ignoreAttention}>
|
|
29
|
-
<StackItem.Content
|
|
29
|
+
<StackItem.Content
|
|
30
|
+
toolbar
|
|
31
|
+
statusbar
|
|
32
|
+
classNames={[role === 'section' && 'aspect-video', role === 'story' && 'bs-full']}
|
|
33
|
+
>
|
|
30
34
|
<SheetToolbar id={fullyQualifiedId(sheet)} />
|
|
31
35
|
<GridSheet />
|
|
32
36
|
<FunctionEditor />
|
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
11
9
|
|
|
12
10
|
import { translations } from '../../translations';
|
|
13
11
|
|
|
14
12
|
import { SheetToolbar } from './SheetToolbar';
|
|
15
13
|
|
|
16
14
|
const DefaultStory = () => {
|
|
17
|
-
|
|
15
|
+
// TODO(wittjosiah): Depends on SheetProvider.
|
|
16
|
+
// return <SheetToolbar id='test' />;
|
|
17
|
+
return <>TODO</>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const meta = {
|
|
21
21
|
title: 'plugins/plugin-sheet/Toolbar',
|
|
22
22
|
component: SheetToolbar as any,
|
|
23
23
|
render: DefaultStory,
|
|
24
|
-
decorators: [withTheme
|
|
25
|
-
parameters: {
|
|
24
|
+
decorators: [withTheme],
|
|
25
|
+
parameters: {
|
|
26
|
+
layout: 'fullscreen',
|
|
27
|
+
translations,
|
|
28
|
+
},
|
|
26
29
|
} satisfies Meta<typeof DefaultStory>;
|
|
27
30
|
|
|
28
31
|
export default meta;
|
|
@@ -7,7 +7,7 @@ import { useEffect } from 'react';
|
|
|
7
7
|
import { type CompleteCellRange, inRange } from '@dxos/compute';
|
|
8
8
|
import { type ToolbarMenuActionGroupProperties, createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
11
|
import { type SheetModel } from '../../model';
|
|
12
12
|
import { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '../../types';
|
|
13
13
|
import { useSheetContext } from '../SheetContext';
|
|
@@ -40,7 +40,7 @@ export const useAlignState = (state: Partial<AlignState>) => {
|
|
|
40
40
|
|
|
41
41
|
const createAlignGroupAction = (value?: AlignValue) =>
|
|
42
42
|
createMenuItemGroup('align', {
|
|
43
|
-
label: ['align label', { ns:
|
|
43
|
+
label: ['align label', { ns: meta.id }],
|
|
44
44
|
variant: 'toggleGroup',
|
|
45
45
|
selectCardinality: 'single',
|
|
46
46
|
value: `${alignKey}--${value}`,
|
|
@@ -79,7 +79,7 @@ const createAlignActions = (model: SheetModel, state: ToolbarState, cursorFallba
|
|
|
79
79
|
key: alignKey,
|
|
80
80
|
value: alignValue as AlignValue,
|
|
81
81
|
checked: state[alignKey] === alignValue,
|
|
82
|
-
label: [`range value ${alignValue} label`, { ns:
|
|
82
|
+
label: [`range value ${alignValue} label`, { ns: meta.id }],
|
|
83
83
|
icon,
|
|
84
84
|
testId: `grid.toolbar.${alignKey}.${alignValue}`,
|
|
85
85
|
},
|
|
@@ -7,7 +7,7 @@ import { useEffect } from 'react';
|
|
|
7
7
|
import { type CompleteCellRange, inRange } from '@dxos/compute';
|
|
8
8
|
import { type ToolbarMenuActionGroupProperties, createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../../meta';
|
|
11
11
|
import { type SheetModel } from '../../model';
|
|
12
12
|
import { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '../../types';
|
|
13
13
|
import { useSheetContext } from '../SheetContext';
|
|
@@ -89,7 +89,7 @@ const createStyleActions = (model: SheetModel, state: StyleState, cursorFallback
|
|
|
89
89
|
key: 'style',
|
|
90
90
|
value: styleValue as StyleValue,
|
|
91
91
|
icon,
|
|
92
|
-
label: [`range value ${styleValue} label`, { ns:
|
|
92
|
+
label: [`range value ${styleValue} label`, { ns: meta.id }],
|
|
93
93
|
checked: !!state[styleValue as StyleValue],
|
|
94
94
|
},
|
|
95
95
|
);
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useMemo } from 'react';
|
|
9
7
|
|
|
8
|
+
import { IntentPlugin } from '@dxos/app-framework';
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
10
|
import { PublicKey } from '@dxos/keys';
|
|
11
11
|
import { useSpace } from '@dxos/react-client/echo';
|
|
12
12
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
13
|
import { useThemeContext } from '@dxos/react-ui';
|
|
14
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
14
15
|
import {
|
|
15
16
|
createBasicExtensions,
|
|
16
17
|
createMarkdownExtensions,
|
|
@@ -19,7 +20,6 @@ import {
|
|
|
19
20
|
documentId,
|
|
20
21
|
useTextEditor,
|
|
21
22
|
} from '@dxos/react-ui-editor';
|
|
22
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
23
23
|
import { isNonNullable } from '@dxos/util';
|
|
24
24
|
|
|
25
25
|
import { GridSheet, SheetProvider, useComputeGraph } from '../components';
|
|
@@ -42,7 +42,7 @@ type EditorProps = {
|
|
|
42
42
|
|
|
43
43
|
const SHEET_NAME = 'Test Sheet';
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const DefaultStory = ({ text }: EditorProps) => {
|
|
46
46
|
const id = useMemo(() => PublicKey.random(), []);
|
|
47
47
|
const { themeMode } = useThemeContext();
|
|
48
48
|
const space = useSpace();
|
|
@@ -93,7 +93,7 @@ const Grid = () => {
|
|
|
93
93
|
const GraphStory = (props: EditorProps) => {
|
|
94
94
|
return (
|
|
95
95
|
<div className='grid grid-rows-2'>
|
|
96
|
-
<
|
|
96
|
+
<DefaultStory {...props} />
|
|
97
97
|
<Grid />
|
|
98
98
|
</div>
|
|
99
99
|
);
|
|
@@ -102,19 +102,22 @@ const GraphStory = (props: EditorProps) => {
|
|
|
102
102
|
const meta = {
|
|
103
103
|
title: 'plugins/plugin-sheet/extensions',
|
|
104
104
|
decorators: [
|
|
105
|
+
withTheme,
|
|
105
106
|
withClientProvider({ types: [SheetType], createIdentity: true, createSpace: true }),
|
|
107
|
+
// TODO(wittjosiah): Try to write story which does not depend on plugin manager.
|
|
108
|
+
withPluginManager({ plugins: [IntentPlugin()] }),
|
|
106
109
|
withComputeGraphDecorator(),
|
|
107
|
-
withTheme,
|
|
108
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
109
110
|
],
|
|
110
|
-
parameters: {
|
|
111
|
+
parameters: {
|
|
112
|
+
layout: 'fullscreen',
|
|
113
|
+
},
|
|
111
114
|
} satisfies Meta;
|
|
112
115
|
|
|
113
116
|
export default meta;
|
|
114
117
|
|
|
115
118
|
// TODO(burdon): Inline formulae.
|
|
116
|
-
export const Default: StoryObj<typeof
|
|
117
|
-
render:
|
|
119
|
+
export const Default: StoryObj<typeof DefaultStory> = {
|
|
120
|
+
render: DefaultStory,
|
|
118
121
|
args: {
|
|
119
122
|
text: str(
|
|
120
123
|
//
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Function from 'effect/Function';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
6
7
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
7
8
|
|
|
8
9
|
import {
|
|
@@ -23,7 +24,7 @@ import { type DxGridElement, type GridContentProps } from '@dxos/react-ui-grid';
|
|
|
23
24
|
import { AnchoredTo } from '@dxos/schema';
|
|
24
25
|
|
|
25
26
|
import { useSheetContext } from '../components';
|
|
26
|
-
import {
|
|
27
|
+
import { meta } from '../meta';
|
|
27
28
|
|
|
28
29
|
export const completeCellRangeToThreadCursor = (range: CompleteCellRange): string => {
|
|
29
30
|
return `${range.from.col},${range.from.row},${range.to.col},${range.to.row}`;
|
|
@@ -72,7 +73,7 @@ export const useUpdateFocusedCellOnThreadSelection = (grid: DxGridElement | null
|
|
|
72
73
|
[model.sheet, setActiveRefs],
|
|
73
74
|
);
|
|
74
75
|
|
|
75
|
-
useIntentResolver(
|
|
76
|
+
useIntentResolver(meta.id, scrollIntoViewResolver);
|
|
76
77
|
};
|
|
77
78
|
|
|
78
79
|
export const useSelectThreadOnCellFocus = () => {
|
|
@@ -100,7 +101,7 @@ export const useSelectThreadOnCellFocus = () => {
|
|
|
100
101
|
|
|
101
102
|
if (closestThread) {
|
|
102
103
|
const primary = fullyQualifiedId(model.sheet);
|
|
103
|
-
const intent = pipe(
|
|
104
|
+
const intent = Function.pipe(
|
|
104
105
|
createIntent(ThreadAction.Select, { current: fullyQualifiedId(closestThread) }),
|
|
105
106
|
chain(DeckAction.ChangeCompanion, { primary, companion: `${primary}${ATTENDABLE_PATH_SEPARATOR}comments` }),
|
|
106
107
|
);
|
package/src/meta.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const SHEET_PLUGIN = 'dxos.org/plugin/sheet';
|
|
8
|
-
|
|
9
7
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
8
|
+
id: 'dxos.org/plugin/sheet',
|
|
11
9
|
name: 'Sheet',
|
|
12
10
|
description:
|
|
13
11
|
'Sheets in Composer are simple spreadsheets which allow you to leverage custom functions inside of cell grids. Leverage more than 400 pre-built formulas like Sum, Average, Count, Max, Min along with many others. You can also deploy your own custom functions using the Scripts plugin. ',
|
package/src/model/sheet-model.ts
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from '@dxos/compute';
|
|
24
24
|
import { Resource } from '@dxos/context';
|
|
25
25
|
import { Obj } from '@dxos/echo';
|
|
26
|
-
import { FormatEnum, TypeEnum } from '@dxos/echo
|
|
26
|
+
import { FormatEnum, TypeEnum } from '@dxos/echo/internal';
|
|
27
27
|
import { invariant } from '@dxos/invariant';
|
|
28
28
|
import { PublicKey } from '@dxos/keys';
|
|
29
29
|
import { log } from '@dxos/log';
|
package/src/testing/testing.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { type Decorator } from '@storybook/react';
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type ComputeGraph, type ComputeGraphOptions, ComputeGraphRegistry } from '@dxos/compute';
|
|
9
|
+
import { createMockedComputeRuntimeProvider } from '@dxos/compute/testing';
|
|
9
10
|
import { type Space } from '@dxos/react-client/echo';
|
|
10
11
|
import { useAsyncState } from '@dxos/react-hooks';
|
|
11
12
|
|
|
@@ -26,9 +27,14 @@ export const useTestSheet = (space?: Space, graph?: ComputeGraph, options?: Crea
|
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export const withComputeGraphDecorator =
|
|
29
|
-
(options?: ComputeGraphOptions): Decorator =>
|
|
30
|
+
(options?: Partial<ComputeGraphOptions>): Decorator =>
|
|
30
31
|
(Story) => {
|
|
31
|
-
const [registry] = useState(
|
|
32
|
+
const [registry] = useState(
|
|
33
|
+
new ComputeGraphRegistry({
|
|
34
|
+
...options,
|
|
35
|
+
computeRuntime: options?.computeRuntime ?? createMockedComputeRuntimeProvider(),
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
32
38
|
return (
|
|
33
39
|
<ComputeGraphContextProvider registry={registry}>
|
|
34
40
|
<Story />
|
package/src/types/schema.ts
CHANGED
package/src/types/types.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from '../meta';
|
|
8
8
|
import { SheetModel } from '../model';
|
|
9
9
|
|
|
10
10
|
import { type CellValue, RowColumnMeta, SheetType } from './schema';
|
|
@@ -20,7 +20,7 @@ export type CreateSheetOptions = {
|
|
|
20
20
|
} & Partial<SheetSize>;
|
|
21
21
|
|
|
22
22
|
export namespace SheetAction {
|
|
23
|
-
const SHEET_ACTION = `${
|
|
23
|
+
const SHEET_ACTION = `${meta.id}/action`;
|
|
24
24
|
|
|
25
25
|
export class Create extends Schema.TaggedClass<Create>()(`${SHEET_ACTION}/create`, {
|
|
26
26
|
input: Schema.Struct({
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/SheetContainer/SheetContainer.tsx", "../../../src/components/FunctionEditor/FunctionEditor.tsx", "../../../src/components/SheetToolbar/SheetToolbar.tsx", "../../../src/components/SheetToolbar/align.ts", "../../../src/components/SheetToolbar/style.ts", "../../../src/components/SheetToolbar/useToolbarState.ts", "../../../src/components/SheetContainer/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space, fullyQualifiedId } from '@dxos/react-client/echo';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { type SheetType } from '../../types';\nimport { useComputeGraph } from '../ComputeGraph';\nimport { FunctionEditor } from '../FunctionEditor';\nimport { GridSheet } from '../GridSheet';\nimport { SheetProvider } from '../SheetContext';\nimport { SheetToolbar } from '../SheetToolbar';\n\nexport type SheetContainerProps = {\n space: Space;\n sheet: SheetType;\n role?: string;\n ignoreAttention?: boolean;\n};\n\nexport const SheetContainer = ({ space, sheet, role, ignoreAttention }: SheetContainerProps) => {\n const graph = useComputeGraph(space);\n\n return graph ? (\n <SheetProvider sheet={sheet} graph={graph} ignoreAttention={ignoreAttention}>\n <StackItem.Content toolbar statusbar {...(role === 'section' && { classNames: 'aspect-video' })}>\n <SheetToolbar id={fullyQualifiedId(sheet)} />\n <GridSheet />\n <FunctionEditor />\n </StackItem.Content>\n </SheetProvider>\n ) : null;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { addressToA1Notation, isFormula, rangeToA1Notation } from '@dxos/compute';\nimport { Icon } from '@dxos/react-ui';\n\nimport { mapFormulaIndicesToRefs } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport const FunctionEditor = () => {\n const { model, cursor, range } = useSheetContext();\n\n let value;\n let formula = false;\n if (cursor) {\n value = model.getCellValue(cursor);\n if (isFormula(value)) {\n value = model.graph.mapFunctionBindingFromId(mapFormulaIndicesToRefs(model.sheet, value));\n formula = true;\n } else if (value != null) {\n value = String(value);\n }\n }\n\n return (\n <div className='flex shrink-0 justify-between items-center px-4 py-1 text-sm bg-toolbarSurface border-bs !border-subduedSeparator'>\n <div className='flex gap-4 items-center'>\n <div className='flex w-16 items-center font-mono'>\n {(range && rangeToA1Notation(range)) || (cursor && addressToA1Notation(cursor))}\n </div>\n <div className='flex gap-2 items-center'>\n <Icon icon='ph--function--regular' classNames={['text-greenText', formula ? 'visible' : 'invisible']} />\n <span className='font-mono'>{value}</span>\n </div>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport React, { type PropsWithChildren, useMemo } from 'react';\n\nimport { useAppGraph } from '@dxos/app-framework';\nimport { type CompleteCellRange } from '@dxos/compute';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type ActionGraphProps,\n MenuProvider,\n ToolbarMenu,\n createGapSeparator,\n rxFromSignal,\n useMenuActions,\n} from '@dxos/react-ui-menu';\n\nimport { type SheetModel } from '../../model';\nimport { useSheetContext } from '../SheetContext';\n\nimport { createAlign, useAlignState } from './align';\nimport { createStyle, useStyleState } from './style';\nimport { type ToolbarState, useToolbarState } from './useToolbarState';\n\n//\n// Root\n//\n\nexport type SheetToolbarProps = ThemedClassName<PropsWithChildren<{ id: string }>>;\n\nconst createToolbarActions = (\n model: SheetModel,\n state: ToolbarState,\n cursorFallbackRange?: CompleteCellRange,\n customActions?: Rx.Rx<ActionGraphProps>,\n): Rx.Rx<ActionGraphProps> => {\n return Rx.make((get) => {\n const align = get(rxFromSignal(() => createAlign(model, state, cursorFallbackRange)));\n const style = get(rxFromSignal(() => createStyle(model, state, cursorFallbackRange)));\n const gap = createGapSeparator();\n\n const graph: ActionGraphProps = {\n nodes: [...align.nodes, ...style.nodes, ...gap.nodes],\n edges: [...align.edges, ...style.edges, ...gap.edges],\n };\n\n if (customActions) {\n const custom = get(customActions);\n graph.nodes.push(...custom.nodes);\n graph.edges.push(...custom.edges);\n }\n\n return graph;\n });\n};\n\nexport const SheetToolbar = ({ id, classNames }: SheetToolbarProps) => {\n const { model, cursorFallbackRange } = useSheetContext();\n const state = useToolbarState({});\n useAlignState(state);\n useStyleState(state);\n\n const { graph } = useAppGraph();\n const customActions = useMemo(() => {\n return Rx.make((get) => {\n const actions = get(graph.actions(id));\n const nodes = actions.filter((action) => action.properties.disposition === 'toolbar');\n return { nodes, edges: nodes.map((node) => ({ source: 'root', target: node.id })) };\n });\n }, [graph]);\n\n const actionsCreator = useMemo(\n () => createToolbarActions(model, state, cursorFallbackRange, customActions),\n [model, state, cursorFallbackRange, customActions],\n );\n const menu = useMenuActions(actionsCreator);\n\n return (\n <MenuProvider {...menu} attendableId={id}>\n <ToolbarMenu classNames={classNames} />\n </MenuProvider>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { type CompleteCellRange, inRange } from '@dxos/compute';\nimport { type ToolbarMenuActionGroupProperties, createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';\n\nimport { SHEET_PLUGIN } from '../../meta';\nimport { type SheetModel } from '../../model';\nimport { type AlignKey, type AlignValue, alignKey, rangeFromIndex, rangeToIndex } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nimport { type ToolbarState } from './useToolbarState';\n\nexport type AlignAction = { key: AlignKey; value: AlignValue };\n\nexport type AlignState = { [alignKey]: AlignValue | undefined };\n\nconst aligns: Record<AlignValue, string> = {\n start: 'ph--text-align-left--regular',\n center: 'ph--text-align-center--regular',\n end: 'ph--text-align-right--regular',\n};\n\nexport const useAlignState = (state: Partial<AlignState>) => {\n const { cursor, model } = useSheetContext();\n useEffect(() => {\n // TODO(thure): Can this O(n) call be memoized?\n state[alignKey] = (\n cursor\n ? model.sheet.ranges?.findLast(\n ({ range, key }) => key === alignKey && inRange(rangeFromIndex(model.sheet, range), cursor),\n )?.value\n : undefined\n ) as AlignValue | undefined;\n }, [cursor, model.sheet]);\n};\n\nconst createAlignGroupAction = (value?: AlignValue) =>\n createMenuItemGroup('align', {\n label: ['align label', { ns: SHEET_PLUGIN }],\n variant: 'toggleGroup',\n selectCardinality: 'single',\n value: `${alignKey}--${value}`,\n } as ToolbarMenuActionGroupProperties);\n\nconst createAlignActions = (model: SheetModel, state: ToolbarState, cursorFallbackRange?: CompleteCellRange) =>\n Object.entries(aligns).map(([alignValue, icon]) => {\n return createMenuAction<AlignAction>(\n `${alignKey}--${alignValue}`,\n () => {\n if (!cursorFallbackRange) {\n return;\n }\n const index =\n model.sheet.ranges?.findIndex(\n (range) =>\n range.key === alignKey && inRange(rangeFromIndex(model.sheet, range.range), cursorFallbackRange.from),\n ) ?? -1;\n const nextRangeEntity = {\n range: rangeToIndex(model.sheet, cursorFallbackRange),\n key: alignKey,\n value: alignValue as AlignValue,\n };\n if (index < 0) {\n model.sheet.ranges?.push(nextRangeEntity);\n state[alignKey] = nextRangeEntity.value;\n } else if (model.sheet.ranges![index].value === nextRangeEntity.value) {\n model.sheet.ranges?.splice(index, 1);\n state[alignKey] = undefined;\n } else {\n model.sheet.ranges?.splice(index, 1, nextRangeEntity);\n state[alignKey] = nextRangeEntity.value;\n }\n },\n {\n key: alignKey,\n value: alignValue as AlignValue,\n checked: state[alignKey] === alignValue,\n label: [`range value ${alignValue} label`, { ns: SHEET_PLUGIN }],\n icon,\n testId: `grid.toolbar.${alignKey}.${alignValue}`,\n },\n );\n });\n\nexport const createAlign = (model: SheetModel, state: ToolbarState, cursorFallbackRange?: CompleteCellRange) => {\n const alignGroup = createAlignGroupAction(state[alignKey]);\n const alignActions = createAlignActions(model, state, cursorFallbackRange);\n return {\n nodes: [alignGroup, ...alignActions],\n edges: [\n { source: 'root', target: 'align' },\n ...alignActions.map(({ id }) => ({ source: alignGroup.id, target: id })),\n ],\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { type CompleteCellRange, inRange } from '@dxos/compute';\nimport { type ToolbarMenuActionGroupProperties, createMenuAction, createMenuItemGroup } from '@dxos/react-ui-menu';\n\nimport { SHEET_PLUGIN } from '../../meta';\nimport { type SheetModel } from '../../model';\nimport { type StyleKey, type StyleValue, rangeFromIndex, rangeToIndex } from '../../types';\nimport { useSheetContext } from '../SheetContext';\n\nexport type StyleState = Partial<Record<StyleValue, boolean>>;\n\nexport type StyleAction = { key: StyleKey; value: StyleValue };\n\nconst styles: Record<StyleValue, string> = {\n highlight: 'ph--highlighter--regular',\n softwrap: 'ph--paragraph--regular',\n};\n\nexport const useStyleState = (state: StyleState) => {\n const { cursorFallbackRange, model } = useSheetContext();\n\n useEffect(() => {\n state.highlight = false;\n state.softwrap = false;\n if (cursorFallbackRange && model.sheet.ranges) {\n model.sheet.ranges\n .filter(\n ({ range, key }) => key === 'style' && inRange(rangeFromIndex(model.sheet, range), cursorFallbackRange.from),\n )\n .forEach(({ value }) => {\n state[value as StyleValue] = true;\n });\n }\n }, [cursorFallbackRange, model.sheet]);\n};\n\nconst createStyleGroup = (state: StyleState) => {\n return createMenuItemGroup('style', {\n variant: 'toggleGroup',\n selectCardinality: 'multiple',\n value: Object.keys(styles)\n .filter((key) => !!state[key as StyleValue])\n .map((styleValue) => `style--${styleValue}`),\n } as ToolbarMenuActionGroupProperties);\n};\n\nconst createStyleActions = (model: SheetModel, state: StyleState, cursorFallbackRange?: CompleteCellRange) =>\n Object.entries(styles).map(([styleValue, icon]) => {\n return createMenuAction<StyleAction>(\n `style--${styleValue}`,\n () => {\n if (!cursorFallbackRange) {\n return;\n }\n const index =\n model.sheet.ranges?.findIndex(\n (range) =>\n range.key === 'style' && inRange(rangeFromIndex(model.sheet, range.range), cursorFallbackRange.from),\n ) ?? -1;\n const nextRangeEntity = {\n range: rangeToIndex(model.sheet, cursorFallbackRange),\n key: 'style',\n value: styleValue as StyleValue,\n };\n if (\n model.sheet.ranges\n .filter(\n ({ range, key: rangeKey }) =>\n rangeKey === 'style' && inRange(rangeFromIndex(model.sheet, range), cursorFallbackRange.from),\n )\n .some(({ value: rangeValue }) => rangeValue === styleValue)\n ) {\n // this value should be unset\n if (index >= 0) {\n model.sheet.ranges?.splice(index, 1);\n }\n state[nextRangeEntity.value] = false;\n } else {\n model.sheet.ranges?.push(nextRangeEntity);\n state[nextRangeEntity.value] = true;\n }\n },\n {\n key: 'style',\n value: styleValue as StyleValue,\n icon,\n label: [`range value ${styleValue} label`, { ns: SHEET_PLUGIN }],\n checked: !!state[styleValue as StyleValue],\n },\n );\n });\n\nexport const createStyle = (model: SheetModel, state: StyleState, cursorFallbackRange?: CompleteCellRange) => {\n const styleGroupAction = createStyleGroup(state);\n const styleActions = createStyleActions(model, state, cursorFallbackRange);\n return {\n nodes: [styleGroupAction, ...styleActions],\n edges: [\n { source: 'root', target: 'style' },\n ...styleActions.map(({ id }) => ({ source: styleGroupAction.id, target: id })),\n ],\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { live } from '@dxos/live-object';\n\nimport { type AlignState } from './align';\nimport { type StyleState } from './style';\n\nexport type ToolbarState = Partial<StyleState & AlignState>;\n\nexport const useToolbarState = (initialState: ToolbarState = {}) => {\n return useMemo(() => live<ToolbarState>(initialState), []);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { SheetContainer } from './SheetContainer';\n\nexport default SheetContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAAqBC,wBAAwB;AAC7C,SAASC,iBAAiB;;;;ACH1B,OAAOC,WAAW;AAElB,SAASC,qBAAqBC,WAAWC,yBAAyB;AAClE,SAASC,YAAY;AAKd,IAAMC,iBAAiB,MAAA;;;AAC5B,UAAM,EAAEC,OAAOC,QAAQC,MAAK,IAAKC,gBAAAA;AAEjC,QAAIC;AACJ,QAAIC,UAAU;AACd,QAAIJ,QAAQ;AACVG,cAAQJ,MAAMM,aAAaL,MAAAA;AAC3B,UAAIM,UAAUH,KAAAA,GAAQ;AACpBA,gBAAQJ,MAAMQ,MAAMC,yBAAyBC,wBAAwBV,MAAMW,OAAOP,KAAAA,CAAAA;AAClFC,kBAAU;MACZ,WAAWD,SAAS,MAAM;AACxBA,gBAAQQ,OAAOR,KAAAA;MACjB;IACF;AAEA,WACE,sBAAA,cAACS,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACD,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACD,OAAAA;MAAIC,WAAU;OACXZ,SAASa,kBAAkBb,KAAAA,KAAYD,UAAUe,oBAAoBf,MAAAA,CAAAA,GAEzE,sBAAA,cAACY,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACG,MAAAA;MAAKC,MAAK;MAAwBC,YAAY;QAAC;QAAkBd,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,OAAOC,qBAAqBC,aAAAA,GAC9D;MAACH;MAAOC;MAAOC;MAAqBC;KAAc;AAEpD,UAAMmC,OAAOC,eAAeF,cAAAA;AAE5B,WACE,gBAAAG,OAAA,cAACC,cAAAA;MAAc,GAAGH;MAAMI,cAActB;OACpC,gBAAAoB,OAAA,cAACG,aAAAA;MAAYtB;;;;;AAGnB;;;AF7DO,IAAMuB,iBAAiB,CAAC,EAAEC,OAAOC,OAAOC,MAAMC,gBAAe,MAAuB;;;AACzF,UAAMC,QAAQC,gBAAgBL,KAAAA;AAE9B,WAAOI,QACL,gBAAAE,OAAA,cAACC,eAAAA;MAAcN;MAAcG;MAAcD;OACzC,gBAAAG,OAAA,cAACE,UAAUC,SAAO;MAACC,SAAAA;MAAQC,WAAAA;MAAW,GAAIT,SAAS,aAAa;QAAEU,YAAY;MAAe;OAC3F,gBAAAN,OAAA,cAACO,cAAAA;MAAaC,IAAIC,iBAAiBd,KAAAA;QACnC,gBAAAK,OAAA,cAACU,WAAAA,IAAAA,GACD,gBAAAV,OAAA,cAACW,gBAAAA,IAAAA,CAAAA,CAAAA,IAGH;;;;AACN;;;AM7BA,IAAA,yBAAeC;",
|
|
6
|
-
"names": ["React", "fullyQualifiedId", "StackItem", "React", "addressToA1Notation", "isFormula", "rangeToA1Notation", "Icon", "FunctionEditor", "model", "cursor", "range", "useSheetContext", "value", "formula", "getCellValue", "isFormula", "graph", "mapFunctionBindingFromId", "mapFormulaIndicesToRefs", "sheet", "String", "div", "className", "rangeToA1Notation", "addressToA1Notation", "Icon", "icon", "classNames", "span", "Rx", "React", "useMemo", "useAppGraph", "MenuProvider", "ToolbarMenu", "createGapSeparator", "rxFromSignal", "useMenuActions", "useEffect", "inRange", "createMenuAction", "createMenuItemGroup", "aligns", "start", "center", "end", "useAlignState", "state", "cursor", "model", "useSheetContext", "useEffect", "alignKey", "sheet", "ranges", "findLast", "range", "key", "inRange", "rangeFromIndex", "value", "undefined", "createAlignGroupAction", "createMenuItemGroup", "label", "ns", "SHEET_PLUGIN", "variant", "selectCardinality", "createAlignActions", "cursorFallbackRange", "Object", "entries", "map", "alignValue", "icon", "createMenuAction", "index", "findIndex", "from", "nextRangeEntity", "rangeToIndex", "push", "splice", "checked", "testId", "createAlign", "alignGroup", "alignActions", "nodes", "edges", "source", "target", "id", "useEffect", "inRange", "createMenuAction", "createMenuItemGroup", "styles", "highlight", "softwrap", "useStyleState", "state", "cursorFallbackRange", "model", "useSheetContext", "useEffect", "sheet", "ranges", "filter", "range", "key", "inRange", "rangeFromIndex", "from", "forEach", "value", "createStyleGroup", "createMenuItemGroup", "variant", "selectCardinality", "Object", "keys", "map", "styleValue", "createStyleActions", "entries", "icon", "createMenuAction", "index", "findIndex", "nextRangeEntity", "rangeToIndex", "rangeKey", "some", "rangeValue", "splice", "push", "label", "ns", "SHEET_PLUGIN", "checked", "createStyle", "styleGroupAction", "styleActions", "nodes", "edges", "source", "target", "id", "useMemo", "live", "useToolbarState", "initialState", "useMemo", "live", "createToolbarActions", "model", "state", "cursorFallbackRange", "customActions", "Rx", "make", "get", "align", "rxFromSignal", "createAlign", "style", "createStyle", "gap", "createGapSeparator", "graph", "nodes", "edges", "custom", "push", "SheetToolbar", "id", "classNames", "useSheetContext", "useToolbarState", "useAlignState", "useStyleState", "useAppGraph", "useMemo", "actions", "filter", "action", "properties", "disposition", "map", "node", "source", "target", "actionsCreator", "menu", "useMenuActions", "React", "MenuProvider", "attendableId", "ToolbarMenu", "SheetContainer", "space", "sheet", "role", "ignoreAttention", "graph", "useComputeGraph", "React", "SheetProvider", "StackItem", "Content", "toolbar", "statusbar", "classNames", "SheetToolbar", "id", "fullyQualifiedId", "GridSheet", "FunctionEditor", "SheetContainer"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const SHEET_PLUGIN = 'dxos.org/plugin/sheet';\n\nexport const meta: PluginMeta = {\n id: SHEET_PLUGIN,\n name: 'Sheet',\n description:\n 'Sheets in Composer are simple spreadsheets which allow you to leverage custom functions inside of cell grids. Leverage more than 400 pre-built formulas like Sum, Average, Count, Max, Min along with many others. You can also deploy your own custom functions using the Scripts plugin. ',\n icon: 'ph--grid-nine--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-sheet',\n screenshots: ['https://dxos.network/plugin-details-sheet-dark.png'],\n};\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,aAAa;IAAC;;AAChB;",
|
|
6
|
-
"names": ["SHEET_PLUGIN", "meta", "id", "name", "description", "icon", "source", "screenshots"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type ComputeGraphRegistry } from '@dxos/compute';\n\nimport { SHEET_PLUGIN } from '../meta';\n\nexport namespace SheetCapabilities {\n export const ComputeGraphRegistry = defineCapability<ComputeGraphRegistry>(\n `${SHEET_PLUGIN}/capability/compute-graph-registry`,\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,wBAAwB;UAKhBC,oBAAAA;qBACFC,uBAAuBC,iBAClC,GAAGC,YAAAA,oCAAgD;AAEvD,GAJiBH,sBAAAA,oBAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["defineCapability", "SheetCapabilities", "ComputeGraphRegistry", "defineCapability", "SHEET_PLUGIN"]
|
|
7
|
-
}
|