@sheetxl/react 0.8.0-beta.17 → 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.
Files changed (116) hide show
  1. package/browser/esm/{9YeNE9FbgAbj-kFJ.mjs → 0i5npOCRbbj7n8AX.mjs} +1 -1
  2. package/browser/esm/{BxmM4_1EU7z1fS8J.mjs → 6KVLDn6fk3Lwk3W0.mjs} +6 -6
  3. package/browser/esm/{B7yfrZvX62qlpS-V.mjs → BFBIk0dXMPBtSHGB.mjs} +1 -1
  4. package/browser/esm/{-mdWrNwKPMBQbhpW.mjs → BMZ6O7J3XnUMlQJ5.mjs} +2 -2
  5. package/browser/esm/{B9r44M1lVTxnLqBb.mjs → BMl3t5nAS8wea8ia.mjs} +1 -1
  6. package/browser/esm/{B0tm14veV7VbqCXF.mjs → BR8he3r4FlfNbM5Y.mjs} +1 -1
  7. package/browser/esm/{NUXuZQHZmiYexulZ.mjs → BWCG8Jc6oF3jzfFk.mjs} +5 -5
  8. package/browser/esm/{BzLeA0HlYOPeNbAo.mjs → B_PNL36bd0h74iJo.mjs} +4 -4
  9. package/browser/esm/{CmDfYf-7BEMQKyqH.mjs → BcTcL2e5NjgL1j-k.mjs} +1 -1
  10. package/browser/esm/{Dm5_yXkbckf2odQK.mjs → BiyB416KncWj7-2t.mjs} +3 -3
  11. package/browser/esm/BpEap6qV7SAhbiMg.mjs +78 -0
  12. package/browser/esm/{Ip8RHzHhXWuXTW8Z.mjs → By-Xfu2c6LLIWg-G.mjs} +6 -6
  13. package/browser/esm/{DQ7lWEbxzkSksQvK.mjs → C8CBCqCUydGXhIco.mjs} +2 -2
  14. package/browser/esm/{qmxmy7tirF1as3Xs.mjs → CEIulpO2M6bY6Hgq.mjs} +1 -1
  15. package/browser/esm/{Z57bAJBcfLMsZG74.mjs → CJxA4mQkgsRg8ejK.mjs} +3 -3
  16. package/browser/esm/{DmIj68EaqzbpmhGu.mjs → CSsytd3vgnhi7AMm.mjs} +1 -1
  17. package/browser/esm/CTFVB5vQl5dFo1zd.mjs +14092 -0
  18. package/browser/esm/{CWZ7Dx5SBWu4aU9Z.mjs → C_OaCmryR0Nc4vfH.mjs} +1 -1
  19. package/browser/esm/{CYEzd5w4p9LRScYN.mjs → D7Kvnl4-FdEGuadk.mjs} +1 -1
  20. package/browser/esm/{BeVkpREgRD5DVvqq.mjs → DOuAxKNRVl3p4oUg.mjs} +1 -1
  21. package/browser/esm/{B1rrVGz1PwKbTLA2.mjs → DZT2k-wAR3bBFQhh.mjs} +1 -1
  22. package/browser/esm/{CNv5ABj97zChkI-j.mjs → Dce_lDRjVEpn-4Gj.mjs} +1 -1
  23. package/browser/esm/DrYGRymc8k3JZBZu.mjs +9560 -0
  24. package/browser/esm/{E7Yhe921O7ju1JLF.mjs → cKu0KgwuR2qIeUnu.mjs} +1 -1
  25. package/browser/esm/chart.mjs +3 -3
  26. package/browser/esm/control.mjs +2 -2
  27. package/browser/esm/group.mjs +3 -3
  28. package/browser/esm/index.mjs +5741 -3965
  29. package/browser/esm/note.mjs +4 -4
  30. package/browser/esm/picture.mjs +2 -2
  31. package/browser/esm/shape.mjs +2 -2
  32. package/browser/esm/slicer.mjs +4 -4
  33. package/browser/esm/{DcFFrmHW4tX2q1az.mjs → wr_Q6qSI16PKN4hz.mjs} +3 -3
  34. package/licenses/dependencies.txt +347 -347
  35. package/node/esm/{C8lBxk7g8FU777JZ.mjs → 365x7ulQ-64LrEAY.mjs} +2 -2
  36. package/node/esm/{DrGBVKfXN46SccPc.mjs → 5NC4KAa0mRhqju4E.mjs} +1 -1
  37. package/node/esm/{D4wcZkeFJ9g3E1Wx.mjs → 7F9gtINd9IcYvclT.mjs} +1 -1
  38. package/node/esm/{D6T6RsUdqj-dsOrE.mjs → 9PkyqxxZGq4LpuXf.mjs} +1 -1
  39. package/node/esm/{BPEE8SA9ZAebcfZs.mjs → B7NgL3l0XJbyq9CG.mjs} +1 -1
  40. package/node/esm/{roCYJ0G69HBpAkf3.mjs → BdEX-Y0ROOf8zRce.mjs} +4 -4
  41. package/node/esm/{B-M8LEF1gQC4VTti.mjs → C9l2nKVgsffhreTD.mjs} +1 -1
  42. package/node/esm/CAbud00Api3zYMB0.mjs +80 -0
  43. package/node/esm/{CXe6zO8r3qcKa8eD.mjs → CRM_BM8JnHgH5kni.mjs} +1 -1
  44. package/node/esm/{DSA6_IsV7Vneo5Za.mjs → C_E-6lqeDHYSKGcS.mjs} +5 -5
  45. package/node/esm/{Cp8J0CabzCF6tfAx.mjs → CyNcgbrqDcBpNJ-N.mjs} +2 -2
  46. package/node/esm/{SRhq2ObYt2tWPLDG.mjs → D2fA8lJO1ZAm7rTz.mjs} +1 -1
  47. package/node/esm/{DQ7xw--8XAi5NYEh.mjs → D5tl-HceFOKuhUPG.mjs} +2 -2
  48. package/node/esm/{DdXBknb60h6u7ljS.mjs → D7jDl04btyfWjg7U.mjs} +1 -1
  49. package/node/esm/{BXwXN7P_JyLZbQ1F.mjs → D8MLM0vKRTMxDGC6.mjs} +1 -1
  50. package/node/esm/{BzAvJXwmJZ2aBZff.mjs → DQkjdt-an36XKGvV.mjs} +1 -1
  51. package/node/esm/{BN9TsBId0PUOF3YQ.mjs → Dg4ph4wH0DWRbx7E.mjs} +1 -1
  52. package/node/esm/{D1o8P8Vu5yBBWDkw.mjs → Dx0Dz6NG76-IKZ1i.mjs} +2 -2
  53. package/node/esm/{BLyZ6mSICbKNrNXK.mjs → UbxFnWpUxT3TQSUA.mjs} +1 -1
  54. package/node/esm/chart.mjs +2 -2
  55. package/node/esm/control.mjs +2 -2
  56. package/node/esm/{arYXYwcOVpS7tQUp.mjs → gqpfUtQ8Q1y4j0w3.mjs} +1 -1
  57. package/node/esm/group.mjs +3 -3
  58. package/node/esm/index.mjs +8700 -6907
  59. package/node/esm/note.mjs +4 -4
  60. package/node/esm/picture.mjs +5 -5
  61. package/node/esm/shape.mjs +6 -6
  62. package/node/esm/{DOmvQX0Ox-3oN9aN.mjs → skitA3Vys5WjKQnm.mjs} +1 -1
  63. package/node/esm/slicer.mjs +4 -4
  64. package/package.json +7 -7
  65. package/resources/contents.json +6 -0
  66. package/resources/locales/contents.json +14 -0
  67. package/resources/locales/de/pivot.cmd.json +1 -1
  68. package/resources/locales/de/sheet.cmd.json +46 -5
  69. package/resources/locales/de/sparkline.cmd.json +301 -0
  70. package/resources/locales/de/ui.msg.json +37 -0
  71. package/resources/locales/de/workbook.cmd.json +0 -5
  72. package/resources/locales/en/pivot.cmd.json +1 -1
  73. package/resources/locales/en/sheet.cmd.json +46 -5
  74. package/resources/locales/en/sparkline.cmd.json +301 -0
  75. package/resources/locales/en/ui.msg.json +37 -0
  76. package/resources/locales/en/workbook.cmd.json +0 -5
  77. package/types/src/annotation/RangeAnnotationLayer.d.ts +110 -0
  78. package/types/src/annotation/RangeAnnotationTag.d.ts +23 -0
  79. package/types/src/annotation/RangeAnnotations.d.ts +67 -6
  80. package/types/src/annotation/index.d.ts +2 -0
  81. package/types/src/editor/VirtualKeyboardLayer.d.ts +2 -1
  82. package/types/src/frame/CommandContext.d.ts +16 -1
  83. package/types/src/index.d.ts +3 -3
  84. package/types/src/layer/CommentCardLayer.d.ts +1 -1
  85. package/types/src/layer/SheetLayers.d.ts +57 -1
  86. package/types/src/layer/SheetSparklineCommandLayer.d.ts +14 -0
  87. package/types/src/layer/SparklineLayer.d.ts +32 -0
  88. package/types/src/layer/index.d.ts +2 -1
  89. package/types/src/movable/MovableCommandGroups.d.ts +0 -18
  90. package/types/src/pivot/PivotTablePane.d.ts +0 -2
  91. package/types/src/presence/PresenceCommands.d.ts +35 -0
  92. package/types/src/presence/PresenceHost.d.ts +58 -0
  93. package/types/src/presence/PresenceMessages.d.ts +42 -0
  94. package/types/src/presence/PresenceStore.d.ts +165 -0
  95. package/types/src/presence/PresenceTypes.d.ts +78 -0
  96. package/types/src/presence/index.d.ts +7 -0
  97. package/types/src/presence/usePresence.d.ts +20 -0
  98. package/types/src/sparkline/PictureCache.d.ts +37 -0
  99. package/types/src/sparkline/SparklineCommands.d.ts +23 -0
  100. package/types/src/sparkline/SparklinePictures.d.ts +7 -0
  101. package/types/src/sparkline/paint/_drawing.d.ts +24 -0
  102. package/types/src/sparkline/paint/echarts.d.ts +8 -0
  103. package/types/src/sparkline/paint/index.d.ts +8 -0
  104. package/types/src/taskPane/CellControlPane.d.ts +0 -2
  105. package/types/src/taskPane/MovablePane.d.ts +0 -2
  106. package/types/src/taskPane/TaskPaneFrame.d.ts +4 -4
  107. package/types/src/taskPane/TaskPaneKeys.d.ts +38 -0
  108. package/types/src/taskPane/TaskPaneRegistry.d.ts +32 -12
  109. package/types/src/taskPane/_paneReasons.d.ts +7 -0
  110. package/types/src/taskPane/index.d.ts +1 -0
  111. package/types/src/theme/ThemeState.d.ts +2 -2
  112. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  113. package/types/src/workbook/IWorkbookElement.d.ts +3 -1
  114. package/types/src/workbook/WorkbookCommands.d.ts +6 -1
  115. package/browser/esm/CWwumtsC8-1gwMAu.mjs +0 -23561
  116. package/types/src/layer/RangeAnnotationLayer.d.ts +0 -71
@@ -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,7 @@
1
+ export * from './PresenceTypes';
2
+ export * from './PresenceHost';
3
+ export * from './PresenceStore';
4
+ export * from './PresenceMessages';
5
+ export * from './PresenceCommands';
6
+ export * from './usePresence';
7
+ //# sourceMappingURL=index.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
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Pictures by key, painted on a queue: one picture for every view that asks for the same key, and
3
+ * the painting spread over slices of time so a screen of new pictures never blocks a frame.
4
+ *
5
+ * @remarks
6
+ * A key states everything the picture depends on (DESIGN-SPARKLINES §3: the layout, so its size,
7
+ * values and concrete colors), so a hit is always right and nothing is invalidated: a view whose
8
+ * input changed asks for another key. The least recently asked are let go past `maxEntries`.
9
+ *
10
+ * The queue is the pool: only views on screen ask, so what is painted first is what is visible.
11
+ */
12
+ export declare class PictureCache<T> {
13
+ private readonly _paint;
14
+ private readonly _maxEntries;
15
+ private readonly _budgetMs;
16
+ private readonly _pictures;
17
+ private readonly _queue;
18
+ private _scheduled;
19
+ /**
20
+ * @param paint Turns an input into a picture (a URL an `<img>` can show).
21
+ * @param options `maxEntries` (default 2000) pictures kept; `budgetMs` (default 8) of painting
22
+ * per slice before yielding.
23
+ */
24
+ constructor(paint: (input: T) => string | Promise<string>, options?: {
25
+ maxEntries?: number;
26
+ budgetMs?: number;
27
+ });
28
+ /** The picture for `key`, painted from `input` when it is not already painted or queued. */
29
+ get(key: string, input: T): Promise<string>;
30
+ /** The picture for `key` when it is already asked for, without painting. */
31
+ peek(key: string): Promise<string> | undefined;
32
+ /** Lets every picture go. */
33
+ clear(): void;
34
+ private _schedule;
35
+ private _drain;
36
+ }
37
+ //# sourceMappingURL=PictureCache.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { RemoveListener, UndoManager } from '@sheetxl/utils';
2
+ import { IWorksheet } from '@sheetxl/sdk';
3
+ import { Command, IReactNotifier } from '@sheetxl/utils-react';
4
+ /** Options for {@link contributeSparklineCommands}. */
5
+ export interface SparklineCommandData {
6
+ sheet: IWorksheet | null;
7
+ /** Busy + error UI for the transactional middleware. */
8
+ notifier?: IReactNotifier;
9
+ /** Undo manager the sheet records into: F4 / redo-as-repeat. */
10
+ manager?: UndoManager;
11
+ }
12
+ /**
13
+ * **Sparkline command behavior**: Excel's Sparkline tab, for the sparklines the selection holds.
14
+ *
15
+ * @remarks
16
+ * The `sparkline` scope, contributed only while the active cell has a sparkline (Excel shows the
17
+ * tab then) and removed otherwise, as the `table` scope is. A command changes every group the
18
+ * selection touches, as Excel's tab does: a type, a marker or an axis is the group's, never one
19
+ * sparkline's. Each click is one undo entry (the transactional middleware). The toggles' `state`
20
+ * is the active cell's group's.
21
+ */
22
+ export declare function contributeSparklineCommands(contribution: Command.CommandContribution, data: SparklineCommandData): RemoveListener;
23
+ //# sourceMappingURL=SparklineCommands.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { SparklineDrawing } from './paint/_drawing';
2
+ export { toDrawing, isBlankDrawing, type SparklineDrawing } from './paint/_drawing';
3
+ /** The key a drawing's picture is cached under: the drawing, which states everything it shows. */
4
+ export declare const sparklinePictureKey: (drawing: SparklineDrawing) => string;
5
+ /** The picture of `drawing`, as a URL an `<img>` shows. */
6
+ export declare const getSparklinePicture: (drawing: SparklineDrawing, key?: string) => Promise<string>;
7
+ //# sourceMappingURL=SparklinePictures.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { IColor, SparklineLayout } from '@sheetxl/sdk';
2
+ type Drawn<T extends {
3
+ color: IColor;
4
+ }> = Omit<T, 'color'> & {
5
+ color: string;
6
+ };
7
+ /**
8
+ * A layout with every color drawn for a mode: what the painter paints and what a picture is cached
9
+ * under, so a light and a dark picture are two pictures.
10
+ */
11
+ export interface SparklineDrawing {
12
+ width: number;
13
+ height: number;
14
+ axis: Drawn<SparklineLayout.Line> | null;
15
+ line: Drawn<SparklineLayout.Polyline> | null;
16
+ columns: Drawn<SparklineLayout.Column>[];
17
+ markers: Drawn<SparklineLayout.Marker>[];
18
+ }
19
+ /** `layout` as a light or a dark grid draws it: each color as the cells there draw theirs. */
20
+ export declare function toDrawing(layout: SparklineLayout, darkMode: boolean): SparklineDrawing;
21
+ /** Whether a drawing shows anything: a sparkline with no number draws nothing and needs no picture. */
22
+ export declare const isBlankDrawing: (drawing: SparklineDrawing) => boolean;
23
+ export {};
24
+ //# sourceMappingURL=_drawing.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { SparklineDrawing } from './_drawing';
2
+ /** The drawing as ECharts graphic elements, in drawing order. */
3
+ export declare function toGraphicElements(drawing: SparklineDrawing): object[];
4
+ /**
5
+ * Paints the drawing headless, as an SVG document string of its size.
6
+ */
7
+ export declare function renderSparklineToSVG(drawing: SparklineDrawing): string;
8
+ //# sourceMappingURL=echarts.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** What the painter module exports. */
2
+ export type SparklinePaintModule = typeof import('./echarts');
3
+ /**
4
+ * The sparkline painter. It carries ECharts, so nothing imports it statically: it loads the first
5
+ * time a sparkline is drawn, or earlier when `LazyModules.prefetch` warms the lazy modules.
6
+ */
7
+ export declare const SparklinePaint: import('@sheetxl/utils').LazyModule<typeof import("./echarts")>;
8
+ //# sourceMappingURL=index.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 { TaskPaneEntry } from './TaskPaneRegistry';
4
+ import { ResolvedTaskPaneEntry } from './TaskPaneRegistry';
5
5
  import { TaskPaneTitleProps } from './TaskPaneTitle';
6
6
  export interface TaskPaneFrameProps extends React.HTMLAttributes<HTMLElement> {
7
- entry: TaskPaneEntry;
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: TaskPaneEntry) => void;
45
- onUnmounted?: (entry: TaskPaneEntry) => void;
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
@@ -19,16 +19,24 @@ export interface TaskPaneEntry {
19
19
  */
20
20
  readonly contributionPoints?: string[];
21
21
  /**
22
- * The title to display to identify the task pane.
22
+ * The title to display to identify the task pane. Call `t()` here to translate it.
23
+ *
24
+ * @remarks
25
+ * Omit it to use the label of the command catalog record that shares the pane's key, which is
26
+ * translated with the rest of the chrome. With neither, the title is the key.
27
+ *
28
+ * @param catalogTitle That record's label, if there is one, for a title that adjusts it.
23
29
  */
24
- getTitle(): string;
30
+ getTitle?(catalogTitle: string | undefined): string;
25
31
  /**
26
- * The icon to display to identify the task pane.
32
+ * The icon to display to identify the task pane: an icon key or a React element.
27
33
  *
28
34
  * @remarks
29
- * This can be either a string (iconKey) or a React element.
35
+ * Omit it to use the icon of the command catalog record that shares the pane's key.
36
+ *
37
+ * @param catalogIcon That record's icon key, if there is one.
30
38
  */
31
- getIcon?(): React.ReactElement | string | undefined;
39
+ getIcon?(catalogIcon: string | undefined): React.ReactElement | string | undefined;
32
40
  /**
33
41
  * The task pane component.
34
42
  *
@@ -67,13 +75,25 @@ export interface TaskPaneEntry {
67
75
  */
68
76
  componentCommandButton?: React.ComponentType<CommandButtonProps>;
69
77
  }
78
+ /**
79
+ * A registered task pane, as {@link ITaskPaneRegistry} returns it: its title and icon resolved from
80
+ * the entry, else from the command catalog.
81
+ */
82
+ export interface ResolvedTaskPaneEntry extends Omit<TaskPaneEntry, 'getTitle' | 'getIcon'> {
83
+ /** The title to show: the entry's, else its catalog record's label, else the key. */
84
+ getTitle(): string;
85
+ /** The icon to show: the entry's, else its catalog record's icon. */
86
+ getIcon(): React.ReactElement | string | undefined;
87
+ }
70
88
  export interface ITaskPaneRegistry {
71
89
  /**
72
90
  * Registers a task pane container.
73
91
  * @param entry The task pane entry.
74
92
  * @param replace Whether to replace an existing task pane. Default is false.
93
+ * @returns A function that removes this registration. It does nothing once the key is unregistered
94
+ * or registered again by someone else.
75
95
  */
76
- registerTaskPane(entry: TaskPaneEntry, replace?: boolean): void;
96
+ registerTaskPane(entry: TaskPaneEntry, replace?: boolean): () => void;
77
97
  /**
78
98
  * Unregister a task pane container.
79
99
  *
@@ -86,22 +106,22 @@ export interface ITaskPaneRegistry {
86
106
  * @param key The unique key for the task pane.
87
107
  * @returns The registered task pane or null if not found.
88
108
  */
89
- getRegisteredTaskPane(key: string): TaskPaneEntry | null;
109
+ getRegisteredTaskPane(key: string): ResolvedTaskPaneEntry | null;
90
110
  /**
91
111
  * Finds contributions for a specific entry.
92
112
  * @param contributionKey
93
113
  */
94
- findContributions(contributionKey: string): TaskPaneEntry[];
114
+ findContributions(contributionKey: string): ResolvedTaskPaneEntry[];
95
115
  }
96
116
  declare class TaskPaneRegistry implements ITaskPaneRegistry {
97
- protected _taskPanes: Map<string, TaskPaneEntry>;
117
+ protected _taskPanes: Map<string, ResolvedTaskPaneEntry>;
98
118
  /** @inheritdoc ITaskPaneRegistry.registerTaskPane */
99
- registerTaskPane(entry: TaskPaneEntry, replace?: boolean): void;
119
+ registerTaskPane(entry: TaskPaneEntry, replace?: boolean): () => void;
100
120
  /** @inheritdoc ITaskPaneRegistry.unregisterTaskPane */
101
121
  unregisterTaskPane(key: string): void;
102
122
  /** @inheritdoc ITaskPaneRegistry.getRegisteredTaskPane */
103
- getRegisteredTaskPane(key: string): TaskPaneEntry | null;
104
- findContributions(contributionKey: string): TaskPaneEntry[];
123
+ getRegisteredTaskPane(key: string): ResolvedTaskPaneEntry | null;
124
+ findContributions(contributionKey: string): ResolvedTaskPaneEntry[];
105
125
  }
106
126
  export declare const DefaultTaskPaneRegistry: TaskPaneRegistry;
107
127
  export {};
@@ -0,0 +1,7 @@
1
+ import { ITaskPaneArea } from './TaskPaneArea';
2
+ /**
3
+ * The reason a command that opens the pane `key` is disabled: there is no task pane area, or no pane
4
+ * registered under `key`. Empty when the pane can be shown.
5
+ */
6
+ export declare const noTaskPaneReasons: (taskPaneArea: ITaskPaneArea | undefined, key: string) => string[];
7
+ //# sourceMappingURL=_paneReasons.d.ts.map
@@ -4,6 +4,7 @@ export * from './TaskPaneArea';
4
4
  export * from './TaskPaneTitle';
5
5
  export * from './TaskPaneStrip';
6
6
  export * from './TaskPaneRegistry';
7
+ export * from './TaskPaneKeys';
7
8
  export * from './MovablePane';
8
9
  export * from './CellControlPane';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -13,7 +13,7 @@ import { ThemeMode } from '@sheetxl/utils-react';
13
13
  * the user's own choice still wins.
14
14
  */
15
15
  export declare const ThemeStateKey: {
16
- /** The user's light/dark override (`null` = follow system). */
16
+ /** The user's light/dark override (`null` = no override: the tree's `ThemeModeFallbackContext` decides — light, or the system mode under Studio). */
17
17
  readonly Mode: "themeMode";
18
18
  /** Whether the grid renders dark when the app is dark (Excel-style: dark app, optional dark grid). */
19
19
  readonly DarkGrid: "enableDarkGrid";
@@ -22,7 +22,7 @@ export declare const ThemeStateKey: {
22
22
  };
23
23
  /**
24
24
  * The shipped defaults for {@link ThemeStateKey}, used when neither the store nor the provider's
25
- * `defaultValues` has a value. They match Excel: follow the system mode, light grid, images unchanged.
25
+ * `defaultValues` has a value. They match Excel: no mode override, light grid, images unchanged.
26
26
  */
27
27
  export declare const ThemeStateDefaults: {
28
28
  readonly themeMode: ThemeMode | null;
@@ -3,7 +3,7 @@ import { ThemeMode } from '@sheetxl/utils-react';
3
3
  * The grid body's resolved light/dark scheme — the single source of the grid's mode.
4
4
  *
5
5
  * Derived from the shared appearance preference: the user's light/dark override
6
- * (`ThemeStateKey.Mode`, resolved via `prefers-color-scheme` when unset), gated by *Enable Dark Grid*
6
+ * (`ThemeStateKey.Mode`, resolved via `useResolvedThemeMode` when unset), gated by *Enable Dark Grid*
7
7
  * (`ThemeStateKey.DarkGrid`, off unless a host or the user turns it on) so the grid stays light in a dark app unless opted in.
8
8
  *
9
9
  * Because it reads the shared (module-singleton) preference store, every caller — the grid surface
@@ -98,7 +98,9 @@ export interface WorkbookElementProps extends Omit<React.HTMLAttributes<HTMLDivE
98
98
  workbook?: IWorkbook | Promise<IWorkbook> | IWorkbookIO.ReadOptions;
99
99
  /**
100
100
  * Controlled override for the app (chrome) light/dark scheme. When omitted, the workbook self-sources
101
- * it from the shared appearance preference (`ThemeStateKey.Mode`, resolved via `prefers-color-scheme`).
101
+ * it from the shared appearance preference (`ThemeStateKey.Mode`). With no preference set it is light,
102
+ * unless the page puts a `dark`/`light` class on `<html>`/`<body>` or a `ThemeModeFallbackContext`
103
+ * above says otherwise (`'system'` follows the OS, as Studio does).
102
104
  */
103
105
  colorScheme?: ThemeMode;
104
106
  /**
@@ -2,7 +2,7 @@ import { RemoveListener } from '@sheetxl/utils';
2
2
  import { IWorkbook, IThemeCollection, ICell, IRange } from '@sheetxl/sdk';
3
3
  import { Command, IReactNotifier } from '@sheetxl/utils-react';
4
4
  import { CommandContext } from '../frame';
5
- import { ActivateFrameOptions } from '../taskPane';
5
+ import { ActivateFrameOptions, ITaskPaneArea } from '../taskPane';
6
6
  import { SheetEditable } from '../editor';
7
7
  /**
8
8
  * Workbook-level command **behavior** (pure callbacks) + the structure-protection / sheet-count disable
@@ -59,6 +59,11 @@ export interface ContributeWorkbookCommandsOptions {
59
59
  notifier?: IReactNotifier;
60
60
  /** Activate a task pane by key (the test `activateTask` command). Threaded from `useTaskPaneArea()`. */
61
61
  activateTaskPane?: (key: string, options?: ActivateFrameOptions) => void;
62
+ /**
63
+ * The task-pane area `activateTaskPane` opens into, read to disable the commands whose pane it cannot
64
+ * show. Threaded from `useTaskPaneArea()`; omitted ⇒ those commands are disabled.
65
+ */
66
+ taskPaneArea?: ITaskPaneArea;
62
67
  /** Theme collection for the `selectTheme` picker context. Omit ⇒ the picker has no list to show. */
63
68
  themes?: IThemeCollection;
64
69
  /**