@sheetxl/react 0.8.0-beta.18 → 0.8.0-beta.19
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/browser/esm/{D31c0jLWUiR_PbJx.mjs → 0i5npOCRbbj7n8AX.mjs} +1 -1
- package/browser/esm/{DwBel0Adpgih98Bx.mjs → 6KVLDn6fk3Lwk3W0.mjs} +6 -6
- package/browser/esm/{UHmh1sM5QVfLE8k9.mjs → BFBIk0dXMPBtSHGB.mjs} +1 -1
- package/browser/esm/{BcXp1o2gLGZELmri.mjs → BMZ6O7J3XnUMlQJ5.mjs} +2 -2
- package/browser/esm/{ug2NMfIbkfZBiXkg.mjs → BMl3t5nAS8wea8ia.mjs} +1 -1
- package/browser/esm/{DfcSTBeSndcnaDmd.mjs → BR8he3r4FlfNbM5Y.mjs} +1 -1
- package/browser/esm/{C0hKnoaENmUoL-z2.mjs → BWCG8Jc6oF3jzfFk.mjs} +5 -5
- package/browser/esm/{DJcMX3VDXMFffxMB.mjs → B_PNL36bd0h74iJo.mjs} +4 -4
- package/browser/esm/{CpVFyFe90rLBAlOg.mjs → BcTcL2e5NjgL1j-k.mjs} +1 -1
- package/browser/esm/{r9VdX3klACo84akj.mjs → BiyB416KncWj7-2t.mjs} +3 -3
- package/browser/esm/{Cuj2BAFNMP_v-leq.mjs → BpEap6qV7SAhbiMg.mjs} +2 -2
- package/browser/esm/{DCTRODeK8qZe23Qi.mjs → By-Xfu2c6LLIWg-G.mjs} +6 -6
- package/browser/esm/{68UAeYtcR5vNUi7B.mjs → C8CBCqCUydGXhIco.mjs} +2 -2
- package/browser/esm/{GW6aAFystRCaCV82.mjs → CEIulpO2M6bY6Hgq.mjs} +1 -1
- package/browser/esm/{3cI2Pl36MTdJwiRb.mjs → CJxA4mQkgsRg8ejK.mjs} +3 -3
- package/browser/esm/{DJoM2pxo9ngKG7wz.mjs → CSsytd3vgnhi7AMm.mjs} +1 -1
- package/browser/esm/{B4xuC6B9qgSP0RLB.mjs → CTFVB5vQl5dFo1zd.mjs} +2 -2
- package/browser/esm/{CH-ZkDyLeYYfuWs-.mjs → C_OaCmryR0Nc4vfH.mjs} +1 -1
- package/browser/esm/{DQ_Jv9q6nhkN6guI.mjs → D7Kvnl4-FdEGuadk.mjs} +1 -1
- package/browser/esm/{BZ7wS4DMuK-Ja1PK.mjs → DOuAxKNRVl3p4oUg.mjs} +1 -1
- package/browser/esm/{CKkDsvwbMHj8qNkT.mjs → DZT2k-wAR3bBFQhh.mjs} +1 -1
- package/browser/esm/{e1CVc488qLwKV4pf.mjs → Dce_lDRjVEpn-4Gj.mjs} +1 -1
- package/browser/esm/{BFTnNTWyDV8Tp0b3.mjs → DrYGRymc8k3JZBZu.mjs} +3 -3
- package/browser/esm/{DA2jE0248M94__xq.mjs → cKu0KgwuR2qIeUnu.mjs} +1 -1
- package/browser/esm/chart.mjs +3 -3
- package/browser/esm/control.mjs +2 -2
- package/browser/esm/group.mjs +3 -3
- package/browser/esm/index.mjs +3242 -2259
- package/browser/esm/note.mjs +4 -4
- package/browser/esm/picture.mjs +2 -2
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +4 -4
- package/browser/esm/{gUl_AJjdjUikWSiV.mjs → wr_Q6qSI16PKN4hz.mjs} +3 -3
- package/node/esm/{Dq6uRVLQnUa-nPqs.mjs → 365x7ulQ-64LrEAY.mjs} +2 -2
- package/node/esm/{DqQ8kJ6VG-8kThfG.mjs → 5NC4KAa0mRhqju4E.mjs} +1 -1
- package/node/esm/{DPjECbRSqcAbRjOb.mjs → 7F9gtINd9IcYvclT.mjs} +1 -1
- package/node/esm/{CYRvHuhsdtu0Thlx.mjs → 9PkyqxxZGq4LpuXf.mjs} +1 -1
- package/node/esm/{BXHdgvfoAY-kTa3t.mjs → B7NgL3l0XJbyq9CG.mjs} +1 -1
- package/node/esm/{D0SQwn9pOERRK_k-.mjs → BdEX-Y0ROOf8zRce.mjs} +4 -4
- package/node/esm/{B5ptbGVfEUGVwTc3.mjs → C9l2nKVgsffhreTD.mjs} +1 -1
- package/node/esm/{CW627g627m7kngw1.mjs → CAbud00Api3zYMB0.mjs} +1 -1
- package/node/esm/{C7pT3AVfm5NnonRZ.mjs → CRM_BM8JnHgH5kni.mjs} +1 -1
- package/node/esm/{oAwOguzSpeebACWB.mjs → C_E-6lqeDHYSKGcS.mjs} +5 -5
- package/node/esm/{Bqd6WwH3hhxhjMZI.mjs → CyNcgbrqDcBpNJ-N.mjs} +2 -2
- package/node/esm/{DHnWKZ7s67r7e_g8.mjs → D2fA8lJO1ZAm7rTz.mjs} +1 -1
- package/node/esm/{OPx-m4H3bEnQEa5_.mjs → D5tl-HceFOKuhUPG.mjs} +2 -2
- package/node/esm/{BYAZYjNlopMmpCr-.mjs → D7jDl04btyfWjg7U.mjs} +1 -1
- package/node/esm/{IeiL1efbWNC4BbBi.mjs → D8MLM0vKRTMxDGC6.mjs} +1 -1
- package/node/esm/{CUDgrjO1Bl_f_GgH.mjs → DQkjdt-an36XKGvV.mjs} +1 -1
- package/node/esm/{B2gKyoNGnDrUyDZa.mjs → Dg4ph4wH0DWRbx7E.mjs} +1 -1
- package/node/esm/{Dcj2cVM7hHbgjgJH.mjs → Dx0Dz6NG76-IKZ1i.mjs} +2 -2
- package/node/esm/{B13bwVa149r4BtWR.mjs → UbxFnWpUxT3TQSUA.mjs} +1 -1
- package/node/esm/chart.mjs +2 -2
- package/node/esm/control.mjs +2 -2
- package/node/esm/{BGRzGNFgu0S7f4A_.mjs → gqpfUtQ8Q1y4j0w3.mjs} +1 -1
- package/node/esm/group.mjs +3 -3
- package/node/esm/index.mjs +5626 -4636
- package/node/esm/note.mjs +4 -4
- package/node/esm/picture.mjs +5 -5
- package/node/esm/shape.mjs +6 -6
- package/node/esm/{X0rgdl5M_Oz_b0LN.mjs → skitA3Vys5WjKQnm.mjs} +1 -1
- package/node/esm/slicer.mjs +4 -4
- package/package.json +7 -7
- package/resources/locales/de/pivot.cmd.json +1 -1
- package/resources/locales/de/sheet.cmd.json +5 -5
- package/resources/locales/de/ui.msg.json +36 -0
- package/resources/locales/de/workbook.cmd.json +0 -5
- package/resources/locales/en/pivot.cmd.json +1 -1
- package/resources/locales/en/sheet.cmd.json +5 -5
- package/resources/locales/en/ui.msg.json +36 -0
- package/resources/locales/en/workbook.cmd.json +0 -5
- package/types/src/annotation/RangeAnnotationLayer.d.ts +110 -0
- package/types/src/annotation/RangeAnnotationTag.d.ts +23 -0
- package/types/src/annotation/RangeAnnotations.d.ts +67 -6
- package/types/src/annotation/index.d.ts +2 -0
- package/types/src/index.d.ts +3 -3
- package/types/src/layer/CommentCardLayer.d.ts +1 -1
- package/types/src/layer/SheetLayers.d.ts +57 -1
- package/types/src/layer/index.d.ts +0 -1
- package/types/src/movable/MovableCommandGroups.d.ts +0 -18
- package/types/src/pivot/PivotTablePane.d.ts +0 -2
- package/types/src/presence/PresenceCommands.d.ts +35 -0
- package/types/src/presence/PresenceHost.d.ts +58 -0
- package/types/src/presence/PresenceMessages.d.ts +42 -0
- package/types/src/presence/PresenceStore.d.ts +165 -0
- package/types/src/presence/PresenceTypes.d.ts +78 -0
- package/types/src/presence/index.d.ts +7 -0
- package/types/src/presence/usePresence.d.ts +20 -0
- package/types/src/taskPane/CellControlPane.d.ts +0 -2
- package/types/src/taskPane/MovablePane.d.ts +0 -2
- package/types/src/taskPane/TaskPaneFrame.d.ts +4 -4
- package/types/src/taskPane/TaskPaneKeys.d.ts +38 -0
- package/types/src/taskPane/TaskPaneRegistry.d.ts +32 -12
- package/types/src/taskPane/_paneReasons.d.ts +7 -0
- package/types/src/taskPane/index.d.ts +1 -0
- package/types/src/theme/ThemeState.d.ts +2 -2
- package/types/src/theme/useGridColorScheme.d.ts +1 -1
- package/types/src/workbook/IWorkbookElement.d.ts +3 -1
- package/types/src/workbook/WorkbookCommands.d.ts +6 -1
- package/types/src/layer/RangeAnnotationLayer.d.ts +0 -71
|
@@ -63,11 +63,66 @@ export declare class SheetLayersRegistry {
|
|
|
63
63
|
private _version;
|
|
64
64
|
set(id: string, entry: Entry): void;
|
|
65
65
|
delete(id: string): void;
|
|
66
|
+
get(id: string): Entry | undefined;
|
|
66
67
|
subscribe: (listener: () => void) => (() => void);
|
|
67
68
|
getVersion: () => number;
|
|
68
69
|
entries(): IterableIterator<[string, Entry]>;
|
|
69
70
|
private _changed;
|
|
70
71
|
}
|
|
72
|
+
/** Layers a plugin adds to sheets, through {@link DefaultSheetLayersRegistry}. */
|
|
73
|
+
export interface SheetLayersEntry {
|
|
74
|
+
/** Identifies the entry, for {@link ISheetLayersRegistry.unregister}. Case-insensitive. */
|
|
75
|
+
key: string;
|
|
76
|
+
/**
|
|
77
|
+
* The layers: one grid child or an array of them, each rooted in a `Layer` and each with its own
|
|
78
|
+
* `key`, as in a sheet's `layers`.
|
|
79
|
+
*/
|
|
80
|
+
layers: React.ReactNode;
|
|
81
|
+
/** The sheets whose surfaces get the layers. Omitted, every sheet's do. */
|
|
82
|
+
sheets?: SheetLayersFilter;
|
|
83
|
+
/**
|
|
84
|
+
* The surfaces the layers are rendered on. A layer on more than one reads which it is on with
|
|
85
|
+
* {@link useGridSurface}.
|
|
86
|
+
*
|
|
87
|
+
* @defaultValue 'cells'
|
|
88
|
+
*/
|
|
89
|
+
surface?: SheetSurface | readonly SheetSurface[] | 'all';
|
|
90
|
+
}
|
|
91
|
+
/** Adds layers to every sheet of every workbook element. */
|
|
92
|
+
export interface ISheetLayersRegistry {
|
|
93
|
+
/**
|
|
94
|
+
* Add layers to every sheet surface the entry names, for as long as it is registered.
|
|
95
|
+
*
|
|
96
|
+
* @param entry The layers, and where they go.
|
|
97
|
+
* @param replace Whether to replace an entry with the same key. Without it, a second entry with the
|
|
98
|
+
* same key throws. @defaultValue false
|
|
99
|
+
* @returns A function that removes this registration. It does nothing once the key is unregistered
|
|
100
|
+
* or registered again by someone else.
|
|
101
|
+
*/
|
|
102
|
+
register(entry: SheetLayersEntry, replace?: boolean): () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Remove an entry's layers from every sheet.
|
|
105
|
+
*
|
|
106
|
+
* @param key The entry's key.
|
|
107
|
+
* @returns Whether the entry was registered.
|
|
108
|
+
*/
|
|
109
|
+
unregister(key: string): boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The layers plugins add to sheets. Every sheet surface, in every workbook or sheet element, renders
|
|
113
|
+
* the registered layers that match it:
|
|
114
|
+
*
|
|
115
|
+
* ```tsx
|
|
116
|
+
* DefaultSheetLayersRegistry.register({ key: 'focus-cell', layers: <FocusCellLayer key="focus-cell" /> });
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* A surface stacks its built-in layers, then the element's `layers`, then the registered layers in
|
|
121
|
+
* registration order, then those declared with {@link SheetLayers}. A layer's `zIndex` overrides that
|
|
122
|
+
* order. A registered layer is mounted on every sheet it matches, on each pane, so it renders an empty
|
|
123
|
+
* `Layer` while it has nothing to show.
|
|
124
|
+
*/
|
|
125
|
+
export declare const DefaultSheetLayersRegistry: ISheetLayersRegistry;
|
|
71
126
|
/**
|
|
72
127
|
* The registry the {@link SheetLayers} under an element register with: the one of a scope above it, or
|
|
73
128
|
* its own. A workbook element resolves one around both its children and its sheet, and the sheet
|
|
@@ -104,7 +159,8 @@ export declare const SheetLayersScope: React.Provider<SheetLayersRegistry | null
|
|
|
104
159
|
*/
|
|
105
160
|
export declare const SheetLayers: React.FC<SheetLayersProps>;
|
|
106
161
|
/**
|
|
107
|
-
* The layers
|
|
162
|
+
* The layers added to one surface of a sheet, flattened into one list of grid children: those
|
|
163
|
+
* registered with {@link DefaultSheetLayersRegistry}, then those declared with {@link SheetLayers}.
|
|
108
164
|
*
|
|
109
165
|
* @internal
|
|
110
166
|
*/
|
|
@@ -33,7 +33,6 @@ export * from './CircularIndicatorLayer';
|
|
|
33
33
|
export * from './CellIndicatorLayer';
|
|
34
34
|
export * from './CommentsLayer';
|
|
35
35
|
export * from './CommentCardLayer';
|
|
36
|
-
export * from './RangeAnnotationLayer';
|
|
37
36
|
export * from './SheetLayers';
|
|
38
37
|
export * from './CellInsertLayer';
|
|
39
38
|
export * from './ProtectionLayer';
|
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
import { Command } from '@sheetxl/utils-react';
|
|
2
2
|
/** The key of a kind's ribbon tab: what a kind's own `toolbar` and the default tab are registered as. */
|
|
3
3
|
export declare const movableToolbarKey: (type: string) => string;
|
|
4
|
-
/**
|
|
5
|
-
* Adds a button to a kind's ribbon tab, whether the kind brings its own tab or has the default one:
|
|
6
|
-
* the contribution point for whatever adds to a kind it does not own, as a host adds its own widgets
|
|
7
|
-
* to a built-in kind.
|
|
8
|
-
*
|
|
9
|
-
* @param type The content type.
|
|
10
|
-
* @param entry The button: a command key to run (`defaultKey`), or a `render` of its own.
|
|
11
|
-
* @param placement Where in the tab. `{ order: -1, divider: 'after' }` puts it first, set apart.
|
|
12
|
-
* @returns A function that removes it.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* registerMovableToolbarEntry('shape', { key: 'shapeGlow', defaultKey: 'formatShapeGlow' }, { order: -1 });
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare function registerMovableToolbarEntry(type: string, entry: Command.CommandButtonEntry & {
|
|
20
|
-
key: string;
|
|
21
|
-
}, placement?: Command.Placement): () => void;
|
|
22
4
|
/**
|
|
23
5
|
* The tab a kind of movable content gets when its module brings none: the drawing groups and the
|
|
24
6
|
* format pane, labeled with the kind's name (`IContent.getTypeDescription()`) unless the catalog
|
|
@@ -2,8 +2,6 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IPivotTable } from '@sheetxl/sdk';
|
|
3
3
|
import { TaskPaneProps } from '../taskPane/ITaskPane';
|
|
4
4
|
import { PivotFieldsProps } from './PivotFields';
|
|
5
|
-
/** The key the PivotTable Fields pane is registered under. */
|
|
6
|
-
export declare const PIVOT_TABLE_PANE_KEY = "pivotTableFields";
|
|
7
5
|
/** What the PivotTable Fields pane can be asked to show (`activateTaskPane(key, { args })`). */
|
|
8
6
|
export interface PivotTablePaneArgs {
|
|
9
7
|
/** The table to show; absent, the one the selection is in. */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { CommandContributionComponentProps } from '@sheetxl/utils-react';
|
|
3
|
+
import { WorkbookCommandContributorData } from '../workbook/WorkbookCommandContributor';
|
|
4
|
+
import { PresenceStore } from './PresenceStore';
|
|
5
|
+
/** The registered key of the presence task pane. */
|
|
6
|
+
export declare const PRESENCE_PANE_KEY = "agent";
|
|
7
|
+
/** The agent's icon key: the base pack's, the glyph Studio marks the agent's changes with too. */
|
|
8
|
+
export declare const PRESENCE_ICON = "Agent";
|
|
9
|
+
/** Keep-open for the strip's navigator. A placeholder glyph in presence's own icon pack. */
|
|
10
|
+
export declare const PRESENCE_PIN_ICON = "plugin-agent:Pin";
|
|
11
|
+
/** The keys of the presence commands, in the `workbook` scope. */
|
|
12
|
+
export declare const PresenceCommandKeys: {
|
|
13
|
+
readonly showPane: "showAgentPane";
|
|
14
|
+
readonly clearFindings: "clearAgentFindings";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Register presence's icon pack and the chrome (label, description, icon) of its commands.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The commands live in the `workbook` scope under their own source, the way scripting injects
|
|
21
|
+
* `showScriptEditor`: the chrome is seeded here and the behavior is contributed per workbook by
|
|
22
|
+
* {@link createPresenceCommands}. Icon packs stay registered (see `DefaultIconService.register`), and
|
|
23
|
+
* the catalog is replaced, not stacked, when registered again.
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerPresenceCommandChrome(): void;
|
|
26
|
+
/**
|
|
27
|
+
* The per-workbook behavior of the presence commands, bound to `store`. Register with
|
|
28
|
+
* `Command.DefaultCommandRegistry.registerDynamic('workbook', …)`.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* `showAgentPane` is stateful (its state is whether the pane is open), so a quick button on it reads
|
|
32
|
+
* as a toggle.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createPresenceCommands(store: PresenceStore): ComponentType<CommandContributionComponentProps<WorkbookCommandContributorData>>;
|
|
35
|
+
//# sourceMappingURL=PresenceCommands.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RangeAnnotationInput } from '../annotation';
|
|
2
|
+
import { PresenceIntent, PresencePrompt, PresencePromptAnswer } from './PresenceTypes';
|
|
3
|
+
/**
|
|
4
|
+
* What the agent side pushes at the view.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* `highlight` ranges arrive already resolved and sheet-qualified: the host is where an unresolvable
|
|
8
|
+
* address is reported back to the agent, so nothing unresolvable reaches the store.
|
|
9
|
+
*/
|
|
10
|
+
export type PresenceHostEvent = {
|
|
11
|
+
type: 'highlight';
|
|
12
|
+
sessionId: string;
|
|
13
|
+
ranges: RangeAnnotationInput[];
|
|
14
|
+
intent: PresenceIntent;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'prompt';
|
|
17
|
+
sessionId: string;
|
|
18
|
+
prompt: PresencePrompt;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'prompt.cancel';
|
|
21
|
+
promptId: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'status';
|
|
24
|
+
connected: boolean;
|
|
25
|
+
activity?: {
|
|
26
|
+
label: string;
|
|
27
|
+
};
|
|
28
|
+
meter?: number;
|
|
29
|
+
}
|
|
30
|
+
/** The history epoch moved under this session (a reload): drop everything held for it. */
|
|
31
|
+
| {
|
|
32
|
+
type: 'reset';
|
|
33
|
+
sessionId: string;
|
|
34
|
+
};
|
|
35
|
+
/** What the user did that the agent may want to hear about on its next tool result. */
|
|
36
|
+
export type PresenceUserEvent = {
|
|
37
|
+
type: 'finding.dismissed';
|
|
38
|
+
id: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'finding.dismissedAll';
|
|
41
|
+
intent: PresenceIntent;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The one seam between presence and whatever carries the agent's traffic.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Presence knows nothing about the transport. A host that relays MCP tool calls into the page
|
|
48
|
+
* implements this; so would one that runs the agent in-process.
|
|
49
|
+
*/
|
|
50
|
+
export interface PresenceHost {
|
|
51
|
+
/** Everything the agent side pushes at the view. Returns the unsubscribe. */
|
|
52
|
+
subscribe(listener: (event: PresenceHostEvent) => void): () => void;
|
|
53
|
+
/** Deliver the user's answer to a prompt. */
|
|
54
|
+
answerPrompt(promptId: string, answer: PresencePromptAnswer): void;
|
|
55
|
+
/** User-side events the agent may want on its next tool result. Optional. */
|
|
56
|
+
notify?(event: PresenceUserEvent): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=PresenceHost.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys of presence's strings, for `t()`. The English text is in the package's catalog
|
|
3
|
+
* (`presence.msg.json`); a host re-words or translates any of them with a language pack.
|
|
4
|
+
*/
|
|
5
|
+
export declare const PresenceMessages: {
|
|
6
|
+
readonly paneTitle: string;
|
|
7
|
+
readonly findingsOpen: string;
|
|
8
|
+
readonly needsAttention: string;
|
|
9
|
+
readonly working: string;
|
|
10
|
+
readonly position: string;
|
|
11
|
+
readonly previous: string;
|
|
12
|
+
readonly next: string;
|
|
13
|
+
readonly goToCurrent: string;
|
|
14
|
+
readonly dismiss: string;
|
|
15
|
+
readonly dismissAll: string;
|
|
16
|
+
readonly tabReview: string;
|
|
17
|
+
readonly waitingOnYou: string;
|
|
18
|
+
readonly tabHistory: string;
|
|
19
|
+
readonly historyNone: string;
|
|
20
|
+
readonly historySearch: string;
|
|
21
|
+
readonly historyClearSearch: string;
|
|
22
|
+
readonly historyNoMatches: string;
|
|
23
|
+
readonly historyKindFinding: string;
|
|
24
|
+
readonly historyKindQuestion: string;
|
|
25
|
+
readonly historyKindChange: string;
|
|
26
|
+
readonly sectionFindings: string;
|
|
27
|
+
readonly findingsNone: string;
|
|
28
|
+
readonly findingsStale: string;
|
|
29
|
+
readonly changesUntitled: string;
|
|
30
|
+
readonly promptTitle: string;
|
|
31
|
+
readonly promptOther: string;
|
|
32
|
+
readonly promptSubmit: string;
|
|
33
|
+
readonly promptAcknowledge: string;
|
|
34
|
+
readonly promptSubmitAll: string;
|
|
35
|
+
readonly promptStepTab: string;
|
|
36
|
+
readonly promptOtherPlaceholder: string;
|
|
37
|
+
readonly pin: string;
|
|
38
|
+
readonly unpin: string;
|
|
39
|
+
readonly promptGoto: string;
|
|
40
|
+
readonly meter: string;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=PresenceMessages.d.ts.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { RangeAnnotation } from '../annotation';
|
|
3
|
+
import { PresenceHost } from './PresenceHost';
|
|
4
|
+
import { PresenceLogEntry, PresencePrompt, PresencePromptQuestion, PresencePromptQuestionAnswer, PresenceStatus } from './PresenceTypes';
|
|
5
|
+
/** Everything the views read, for the bound session. Immutable; a new object on every change. */
|
|
6
|
+
export interface PresenceSnapshot {
|
|
7
|
+
/** The session the views are showing. `null` before a workbook is bound. */
|
|
8
|
+
sessionId: string | null;
|
|
9
|
+
workbook: IWorkbook | null;
|
|
10
|
+
/** The name of the sheet in view — decides whether a prompt pins to its cells or centers. */
|
|
11
|
+
sheetInView: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Every finding for the session (all intents, open and stale), in review order. Only the session's
|
|
14
|
+
* own annotations: other writers' are not presence.
|
|
15
|
+
*/
|
|
16
|
+
findings: readonly RangeAnnotation[];
|
|
17
|
+
/** The session's findings the navigator walks: open `finding` and `question`, in review order. */
|
|
18
|
+
navigable: readonly RangeAnnotation[];
|
|
19
|
+
/** The navigator's current finding, when it is one of the session's. */
|
|
20
|
+
current: RangeAnnotation | null;
|
|
21
|
+
/** Every finding the agent raised this session, open or dismissed, newest first. */
|
|
22
|
+
log: readonly PresenceLogEntry[];
|
|
23
|
+
/** The agent's `working` cursor (where it is about to write) while it is up. */
|
|
24
|
+
working: RangeAnnotation | null;
|
|
25
|
+
/** 1-based position of {@link current} in {@link navigable}; `0` when there is none. */
|
|
26
|
+
position: number;
|
|
27
|
+
/** The pending prompt, if the agent is waiting on the user. */
|
|
28
|
+
prompt: PresencePrompt | null;
|
|
29
|
+
/** The step of {@link prompt} on screen (0-based). */
|
|
30
|
+
promptStep: number;
|
|
31
|
+
/** The question on screen: `prompt.questions[promptStep]`. */
|
|
32
|
+
promptQuestion: PresencePromptQuestion | null;
|
|
33
|
+
/** What the user has chosen so far, by step; `undefined` for a step not yet answered. */
|
|
34
|
+
promptAnswers: readonly (PresencePromptQuestionAnswer | undefined)[];
|
|
35
|
+
/**
|
|
36
|
+
* Where the prompt's dialog opens: just below the first question's cells, in viewport pixels.
|
|
37
|
+
* `undefined` until a grid pane has measured them (or forever, when it cannot — then centered).
|
|
38
|
+
*/
|
|
39
|
+
promptAnchor: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
} | undefined;
|
|
43
|
+
status: PresenceStatus;
|
|
44
|
+
/**
|
|
45
|
+
* The agent is waiting on the user — a prompt is pending. Distinct from findings: a prompt needs
|
|
46
|
+
* the user now, findings wait for them. Never counted together, and tool calls never count.
|
|
47
|
+
*/
|
|
48
|
+
needsAttention: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Someone else working in the view: their findings, their working cursor, their prompt and status,
|
|
52
|
+
* for one session. The findings are the workbook's range annotations, written with the session as
|
|
53
|
+
* their `source`, fed by the host's `highlight` events and read back here so the views see one
|
|
54
|
+
* snapshot.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Shows one session: the workbook passed to {@link bind}. A `highlight` for a session that is not
|
|
58
|
+
* bound yet is kept until it is (the workbook may still be loading); one for another session is
|
|
59
|
+
* dropped, since there is nothing to draw it on.
|
|
60
|
+
*
|
|
61
|
+
* The host hears about dismissals from the annotation store's events, so a dismissal from the
|
|
62
|
+
* grid's tag, from a list, or from a command reaches it the same way.
|
|
63
|
+
*/
|
|
64
|
+
export declare class PresenceStore {
|
|
65
|
+
private readonly host;
|
|
66
|
+
private readonly _listeners;
|
|
67
|
+
private readonly _prompts;
|
|
68
|
+
private readonly _pendingHighlights;
|
|
69
|
+
private readonly _log;
|
|
70
|
+
private readonly _removeHost;
|
|
71
|
+
private _removeWorkbook;
|
|
72
|
+
private _removeAnnotations;
|
|
73
|
+
private _removeTransactions;
|
|
74
|
+
private _workbook;
|
|
75
|
+
private _sessionId;
|
|
76
|
+
private _sheetInView;
|
|
77
|
+
private _status;
|
|
78
|
+
private _snapshot;
|
|
79
|
+
/** While the store clears a session on its own account (a reset): nothing the user dismissed. */
|
|
80
|
+
private _resetting;
|
|
81
|
+
constructor(host: PresenceHost);
|
|
82
|
+
/**
|
|
83
|
+
* Show this workbook's session.
|
|
84
|
+
*
|
|
85
|
+
* @param sessionId - The id the host addresses this workbook by. Defaults to the workbook's own id.
|
|
86
|
+
*/
|
|
87
|
+
bind(workbook: IWorkbook | null, sessionId?: string): void;
|
|
88
|
+
getSnapshot: () => PresenceSnapshot;
|
|
89
|
+
subscribe: (listener: () => void) => (() => void);
|
|
90
|
+
/**
|
|
91
|
+
* Move to the next finding (wrapping) and reveal it.
|
|
92
|
+
*
|
|
93
|
+
* @param fromId - Step from this finding instead of the current one — a chip's own arrows walk
|
|
94
|
+
* from that chip, wherever the user scrolled to.
|
|
95
|
+
*/
|
|
96
|
+
next(fromId?: string): void;
|
|
97
|
+
/** Move to the previous finding (wrapping) and reveal it. See {@link next} for `fromId`. */
|
|
98
|
+
prev(fromId?: string): void;
|
|
99
|
+
/** Make a finding current and reveal it. A stale or unknown id does nothing; a `working` one is only revealed. */
|
|
100
|
+
goTo(id: string): void;
|
|
101
|
+
/** Bring an address into view without touching the selection. */
|
|
102
|
+
reveal(address: string): void;
|
|
103
|
+
/** Select an address — for a link to the cells the user clicks (the prompt's range). */
|
|
104
|
+
select(address: string): void;
|
|
105
|
+
/** Dismiss one finding. The cursor moves to the one that takes its place. */
|
|
106
|
+
dismiss(id: string): void;
|
|
107
|
+
dismissCurrent(): void;
|
|
108
|
+
/** Dismiss every `finding` and `question` finding in the bound session. */
|
|
109
|
+
dismissAll(): void;
|
|
110
|
+
/** Clear the agent's `working` cursor, as Esc does. Returns whether there was one. */
|
|
111
|
+
clearWorking(): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Answer the step on screen of the bound session's prompt. Answering here or in the grid is the
|
|
114
|
+
* same thing.
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* A single-question prompt is sent at once. With several, the answer is recorded and the next
|
|
118
|
+
* step comes up; the answers go together on {@link submitPrompt}.
|
|
119
|
+
*
|
|
120
|
+
* @param optionId - The option chosen; omitted to acknowledge a step that has none.
|
|
121
|
+
*/
|
|
122
|
+
choosePromptOption: (optionId?: string) => void;
|
|
123
|
+
/**
|
|
124
|
+
* Record the step on screen's answer in the user's own words ("Other"), as they type. It does not
|
|
125
|
+
* move on or send — the user may write several lines; {@link submitPrompt} sends. Blank text
|
|
126
|
+
* leaves the step unanswered.
|
|
127
|
+
*/
|
|
128
|
+
setPromptOtherText: (text: string) => void;
|
|
129
|
+
private _answerStep;
|
|
130
|
+
/**
|
|
131
|
+
* Record where the prompt's first question is on screen, so its dialog can open there. Set once:
|
|
132
|
+
* the dialog opens where its question was, then stays wherever the user puts it.
|
|
133
|
+
*/
|
|
134
|
+
setPromptAnchor: (promptId: string, anchor: {
|
|
135
|
+
x: number;
|
|
136
|
+
y: number;
|
|
137
|
+
}) => void;
|
|
138
|
+
/** Show another step of the bound session's prompt. Answers given stay until changed. */
|
|
139
|
+
promptGoToStep: (step: number) => void;
|
|
140
|
+
/** Send the prompt's answers. Only once every question has one. */
|
|
141
|
+
submitPrompt: () => void;
|
|
142
|
+
/** Dismiss the bound session's prompt. What was answered so far goes back with the `cancel`. */
|
|
143
|
+
cancelPrompt: () => void;
|
|
144
|
+
dispose(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Tell the host what the user dismissed of the session's findings, however it was done. A `working`
|
|
147
|
+
* cursor is never reported: it goes on its own.
|
|
148
|
+
*/
|
|
149
|
+
private _onAnnotationEvent;
|
|
150
|
+
private _onHostEvent;
|
|
151
|
+
private _reset;
|
|
152
|
+
/**
|
|
153
|
+
* Record findings as the agent raises them — whatever the user later does with them. Newest first
|
|
154
|
+
* (a walk keeps the agent's order within it); the log only grows. A `working` cursor is never logged.
|
|
155
|
+
*/
|
|
156
|
+
private _addToLog;
|
|
157
|
+
private _pending;
|
|
158
|
+
private _setPending;
|
|
159
|
+
/** A question is asked AT its cells — bring them into view as the step appears. */
|
|
160
|
+
private _revealStep;
|
|
161
|
+
private _resolvePrompt;
|
|
162
|
+
private _setSheetInView;
|
|
163
|
+
private _changed;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=PresenceStore.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { RangeAnnotation } from '../annotation';
|
|
2
|
+
/**
|
|
3
|
+
* What a highlight is for: the vocabulary of the MCP `highlight` tool.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* `working` is the agent's cursor: one range, where it is about to write. It is shown in the strip
|
|
7
|
+
* and as a box on the grid, never listed or logged, and gone on its own: replaced by the next
|
|
8
|
+
* `working` call, cleared by any commit or any other highlight, and by Esc. `finding` and `question`
|
|
9
|
+
* are things the agent wants the user to look at; they accumulate as walks and stay until the user
|
|
10
|
+
* dismisses them.
|
|
11
|
+
*/
|
|
12
|
+
export type PresenceIntent = 'working' | 'finding' | 'question';
|
|
13
|
+
/**
|
|
14
|
+
* A finding as the history records it: a copy taken when the agent raised it. Whether it is still
|
|
15
|
+
* open is the live annotations' to say, not the log's; dismissing a finding is not an answer to it.
|
|
16
|
+
*/
|
|
17
|
+
export interface PresenceLogEntry extends RangeAnnotation {
|
|
18
|
+
raisedAt: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* What the agent is waiting on: one prompt's dialog. It holds one question or several, which the
|
|
22
|
+
* user answers one step at a time and which go back together.
|
|
23
|
+
*/
|
|
24
|
+
export interface PresencePrompt {
|
|
25
|
+
/** The prompt's id; the answer is correlated by it. */
|
|
26
|
+
id: string;
|
|
27
|
+
/** In the order asked. Never empty. */
|
|
28
|
+
questions: PresencePromptQuestion[];
|
|
29
|
+
}
|
|
30
|
+
/** One step of a {@link PresencePrompt}. */
|
|
31
|
+
export interface PresencePromptQuestion {
|
|
32
|
+
/** What the answer goes back under. */
|
|
33
|
+
id: string;
|
|
34
|
+
/** A short name for the step's tab. */
|
|
35
|
+
header?: string;
|
|
36
|
+
message: string;
|
|
37
|
+
/** Empty for an acknowledge step. `description` is a second, quieter line under the label. */
|
|
38
|
+
options: {
|
|
39
|
+
id: string;
|
|
40
|
+
label: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
}[];
|
|
43
|
+
/**
|
|
44
|
+
* The range the question is about, already resolved. `undefined` means a centered dialog:
|
|
45
|
+
* deliberately not the user's selection, which is theirs and almost never the subject.
|
|
46
|
+
*/
|
|
47
|
+
range?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* One question's answer: the option chosen, or `text` when the user answered in their own words
|
|
51
|
+
* ("Other"). Neither is set for an acknowledged step.
|
|
52
|
+
*/
|
|
53
|
+
export interface PresencePromptQuestionAnswer {
|
|
54
|
+
questionId: string;
|
|
55
|
+
optionId?: string;
|
|
56
|
+
text?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The user's answer to a prompt, elicitation-shaped. Dismissal is a normal `cancel`, carrying the
|
|
60
|
+
* questions answered before it (possibly none).
|
|
61
|
+
*/
|
|
62
|
+
export interface PresencePromptAnswer {
|
|
63
|
+
action: 'accept' | 'cancel';
|
|
64
|
+
/** In question order. */
|
|
65
|
+
answers: PresencePromptQuestionAnswer[];
|
|
66
|
+
}
|
|
67
|
+
/** Agent presence and activity, as the host reports it. */
|
|
68
|
+
export interface PresenceStatus {
|
|
69
|
+
/** An agent is attached (host-global, not per workbook). */
|
|
70
|
+
connected: boolean;
|
|
71
|
+
/** Bumps on each tool call against this workbook; a change is a pulse, never a count. */
|
|
72
|
+
activity: number;
|
|
73
|
+
/** A short label for the last tool call. */
|
|
74
|
+
lastActivity?: string;
|
|
75
|
+
/** Tool calls against this workbook this session, as the host counts them. */
|
|
76
|
+
meter?: number;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=PresenceTypes.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { PresenceSnapshot, PresenceStore } from './PresenceStore';
|
|
3
|
+
/** The store's current snapshot; re-renders on every change. */
|
|
4
|
+
export declare function usePresenceSnapshot(store: PresenceStore): PresenceSnapshot;
|
|
5
|
+
/** One entry of the commit log, as the pane lists it. */
|
|
6
|
+
export interface PresenceCommit {
|
|
7
|
+
id: string;
|
|
8
|
+
/** The label the user sees in the undo menu, already resolved. */
|
|
9
|
+
description: string | null;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The commits the agent made to this workbook, newest first, kept current as the log moves.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Read from the live transaction log, filtered to `author: 'agent'`. A commit undone (or reverted)
|
|
17
|
+
* leaves the list because the log is walked from the current head.
|
|
18
|
+
*/
|
|
19
|
+
export declare function usePresenceCommits(workbook: IWorkbook | null, limit?: number): PresenceCommit[];
|
|
20
|
+
//# sourceMappingURL=usePresence.d.ts.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TaskPaneProps } from './ITaskPane';
|
|
3
|
-
/** The key the cell control pane is registered under, and of the command that opens it. */
|
|
4
|
-
export declare const CELL_CONTROL_PANE_KEY = "formatCellControl";
|
|
5
3
|
/**
|
|
6
4
|
* The cell control pane: follows the selection's anchor and shows the body the anchor's content
|
|
7
5
|
* entry supplies ({@link CellContentEntry.pane}). With no control under the anchor, or for a type
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TaskPaneProps } from './ITaskPane';
|
|
3
|
-
/** The key the format pane is registered under, and of the command that opens it. */
|
|
4
|
-
export declare const FORMAT_MOVABLE_PANE_KEY = "formatMovable";
|
|
5
3
|
/**
|
|
6
4
|
* The format pane: follows the movable selection and shows the active movable's kind name above the
|
|
7
5
|
* body its kind supplies (`MovableRendererModule.pane`, or one given with `registerMovablePane`). With
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { RemoveListener } from '@sheetxl/utils';
|
|
3
3
|
import { IFrameContainerListener } from '../frame';
|
|
4
|
-
import {
|
|
4
|
+
import { ResolvedTaskPaneEntry } from './TaskPaneRegistry';
|
|
5
5
|
import { TaskPaneTitleProps } from './TaskPaneTitle';
|
|
6
6
|
export interface TaskPaneFrameProps extends React.HTMLAttributes<HTMLElement> {
|
|
7
|
-
entry:
|
|
7
|
+
entry: ResolvedTaskPaneEntry;
|
|
8
8
|
model?: any;
|
|
9
9
|
/** The activating call's value bag — see {@link ActivateFrameOptions.args}. */
|
|
10
10
|
args?: any;
|
|
@@ -41,8 +41,8 @@ export interface TaskPaneFrameProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
41
41
|
* If the registry also provides a custom title component that will be used instead.
|
|
42
42
|
*/
|
|
43
43
|
componentTitle?: React.ComponentType<TaskPaneTitleProps>;
|
|
44
|
-
onMounted?: (entry:
|
|
45
|
-
onUnmounted?: (entry:
|
|
44
|
+
onMounted?: (entry: ResolvedTaskPaneEntry) => void;
|
|
45
|
+
onUnmounted?: (entry: ResolvedTaskPaneEntry) => void;
|
|
46
46
|
}
|
|
47
47
|
export declare const TaskPaneFrame: React.NamedExoticComponent<TaskPaneFrameProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
48
|
//# sourceMappingURL=TaskPaneFrame.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys of the task panes this package's commands open. Activate one with
|
|
3
|
+
* `taskPaneArea.activate(TaskPaneKey.Comments)`; register a pane under one to supply it or replace it.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Some of these panes this package supplies itself, registered the first time their command runs.
|
|
7
|
+
* The rest a host supplies (Studio does): until one is registered under the key, the commands that
|
|
8
|
+
* open it are disabled.
|
|
9
|
+
*
|
|
10
|
+
* Not every pane is here. A plugin registers its own panes under keys of its own, so a pane key is
|
|
11
|
+
* any string; these are the ones this package knows by name.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TaskPaneKey: {
|
|
14
|
+
/** **Format Cells**: the selection's number format, font, alignment, fill and border. A host supplies it. */
|
|
15
|
+
readonly FormatCells: "formatCells";
|
|
16
|
+
/** The sheet's threaded comments. Opened on a thread with a `CommentsPaneArgs`. A host supplies it. */
|
|
17
|
+
readonly Comments: "comments";
|
|
18
|
+
/** The details of the table the active cell is in. A host supplies it. */
|
|
19
|
+
readonly TableDetails: "tableDetails";
|
|
20
|
+
/** The sheet's conditional formatting rules. Opened on a rule with `ItemsPaneArgs`. A host supplies it. */
|
|
21
|
+
readonly ConditionalFormat: "conditionalFormatDetails";
|
|
22
|
+
/** The sheet's data validation rules. Opened on a rule with `ItemsPaneArgs`. A host supplies it. */
|
|
23
|
+
readonly DataValidation: "dataValidationDetails";
|
|
24
|
+
/** Sheet and workbook protection, and the sheet's protected ranges. Opened with `ProtectionPaneArgs`. A host supplies it. */
|
|
25
|
+
readonly Protection: "manageProtection";
|
|
26
|
+
/** The workbook's defined names, every scope. Opened on a name with `ItemsPaneArgs`. A host supplies it. */
|
|
27
|
+
readonly Names: "managedNames";
|
|
28
|
+
/** The workbooks this one links to. Opened with `ExternalLinksPaneArgs`. A host supplies it. */
|
|
29
|
+
readonly ExternalLinks: "externalLinks";
|
|
30
|
+
/** The fields of the pivot table the active cell is in. Opened with `PivotTablePaneArgs`. Supplied here. */
|
|
31
|
+
readonly PivotTable: "pivotTableFields";
|
|
32
|
+
/** The cell control at the active cell. Supplied here. */
|
|
33
|
+
readonly CellControl: "formatCellControl";
|
|
34
|
+
/** The format of the selected drawing (shape, picture, chart). Supplied here. */
|
|
35
|
+
readonly FormatMovable: "formatMovable";
|
|
36
|
+
};
|
|
37
|
+
export type TaskPaneKey = typeof TaskPaneKey[keyof typeof TaskPaneKey];
|
|
38
|
+
//# sourceMappingURL=TaskPaneKeys.d.ts.map
|