@sheetxl/react 0.8.0-beta.22 → 0.8.0-beta.24
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/{Bjzo7g25tw9kTCYC.mjs → 6KeWPjMKNZY8i19M.mjs} +2 -2
- package/browser/esm/{CJVcfqrty5b-eowN.mjs → 9t5N76NQ0awbiItG.mjs} +2 -2
- package/browser/esm/{QKnTzTdIYAMcBU8r.mjs → B-rvtChAVnzrPJsd.mjs} +1 -1
- package/browser/esm/{DxsGY5rYjITV3SLK.mjs → B0asaf6iVJnOyxYq.mjs} +1 -1
- package/browser/esm/{np1ChcItFltS6AC5.mjs → BoljuF1xywgBQ3vp.mjs} +1 -1
- package/browser/esm/{CgOhJ3utK7aSQm26.mjs → BuDfdWztNZKCN_Ld.mjs} +1 -1
- package/browser/esm/{D7P7zWW2gdWclI2p.mjs → BwuvgXRS-KMp6XCe.mjs} +3 -3
- package/browser/esm/{Biz8qA4-1wRN8de2.mjs → By0ADE8R8h3hKM64.mjs} +1 -1
- package/browser/esm/{DyFeCww9e_4G9c-1.mjs → CGazs9mfVVzc04Y7.mjs} +178 -158
- package/browser/esm/{DgmkBz2cYtVZ8tXv.mjs → CXX4sovIFgAQsSxN.mjs} +1 -1
- package/browser/esm/{D8NUgUzdI7YFxyyA.mjs → CaV--rSRIoGsErhZ.mjs} +7 -7
- package/browser/esm/{D01C312OntVURMN9.mjs → CfIPv0YuwhlpYzf2.mjs} +122 -122
- package/browser/esm/{mJyEnJIX0iGfGtvE.mjs → Cgbmuy79jiY1HjS3.mjs} +1 -1
- package/browser/esm/{HQkKZC6SPUdQwgxi.mjs → CmoM33qZfV9EioFC.mjs} +1 -1
- package/browser/esm/{hTeTTb8oYTssk6EY.mjs → DHncl8rL4Tri3OBI.mjs} +1 -1
- package/browser/esm/{D0g7sllamMog1m-Z.mjs → DK8YNIcwWG9l7BpT.mjs} +3 -3
- package/browser/esm/{BPS1PDZKyF6ivJwa.mjs → DQfqezyi9TgWoADc.mjs} +1 -1
- package/browser/esm/{DH8xeknZXWn7AV5q.mjs → Dw1dknWgStq1jnIp.mjs} +6 -6
- package/browser/esm/{B9rbGikcuRq1OnhM.mjs → IF4tK8a7bQsrq8gd.mjs} +2 -2
- package/browser/esm/{BqIbT28MM3SBdvh_.mjs → ISe4yn20JJcyYnhz.mjs} +2 -2
- package/browser/esm/{mUKvsPCmRWzQke-M.mjs → UKEdlUOzahaOstGm.mjs} +1 -1
- package/browser/esm/{DhGJU1camaOf7KOq.mjs → W00O27emy3mpzSYw.mjs} +4 -4
- package/browser/esm/chart.mjs +11 -11
- package/browser/esm/control.mjs +16 -16
- package/browser/esm/{C7rc3CMd_XOITW1V.mjs → dwz-qrgJG3GabtJ0.mjs} +7 -7
- package/browser/esm/group.mjs +29 -29
- package/browser/esm/index.mjs +6469 -6440
- package/browser/esm/{B9wkino8VMasq6E3.mjs → jmoe5Dbqx1WjBgUO.mjs} +2 -2
- package/browser/esm/note.mjs +10 -10
- package/browser/esm/picture.mjs +2 -2
- package/browser/esm/{CrTfqdSwWScJN566.mjs → plaFoOG2sGGR9984.mjs} +1 -1
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +55 -50
- package/node/esm/{GG78Gq3CY8SDS-48.mjs → 7HceIR_VkgIhKM8f.mjs} +12 -12
- package/node/esm/{CZc2QH8i-TgW9nGI.mjs → 9vtv3spOcuota3Vb.mjs} +1 -1
- package/node/esm/{BPMjPMRyVTEZq_6j.mjs → B0EM467vxmzaUp9t.mjs} +1 -1
- package/node/esm/{BpcTu_chuDjr_XFv.mjs → BUiM5r_ksWRJMWPn.mjs} +1 -1
- package/node/esm/{CE5fMGMmykts2yJP.mjs → BYhlpUYwaNUr67Yi.mjs} +1 -1
- package/node/esm/{COlzVELrEvgm2STX.mjs → Bd_YMUKA8RxBL4G2.mjs} +4 -4
- package/node/esm/{DHTbAHbCiEWhilV_.mjs → BgCEqNCStGMDZ1QF.mjs} +1 -1
- package/node/esm/{FUQMKIiQQ5m3xzeO.mjs → BguHdiclysorJICc.mjs} +1 -1
- package/node/esm/{C3XXdc_UXH2g2W5E.mjs → BlahUrDcsABBUCM0.mjs} +1 -1
- package/node/esm/{C91YeRrspETjFcRc.mjs → Bub_Mjqm7gIOrcpM.mjs} +2 -2
- package/node/esm/{aLt3NYdUcYQu4Ur4.mjs → CH0kTLjibrtP2Cbj.mjs} +1 -1
- package/node/esm/{i4aPmKocZebCBeSd.mjs → CHPFQjpRp8efzowW.mjs} +6 -6
- package/node/esm/{l0GtU6LYlBywzc9T.mjs → CtBn6NAJs8ogJXEf.mjs} +2 -2
- package/node/esm/{CzQMRmArhJ6blZJp.mjs → D1Kny6jQY-Z5cM3U.mjs} +1 -1
- package/node/esm/{CcLUKcJROXrbSXjb.mjs → D2CFdcWIygfybLGD.mjs} +1 -1
- package/node/esm/{CfpNgRvWmu36cTfV.mjs → DFc3ldcMwcvqOz8-.mjs} +5 -5
- package/node/esm/{cju5Gx-t_74o116W.mjs → DHtgb2GVYcKg4gyl.mjs} +2 -2
- package/node/esm/{DX7ysYSfnigj0ak8.mjs → DUzvBfMhVRALWCyY.mjs} +1 -1
- package/node/esm/{DxKxx-yEkSydHyWQ.mjs → DXMUS-l19Pg6Apgt.mjs} +1 -1
- package/node/esm/chart.mjs +19 -19
- package/node/esm/control.mjs +16 -16
- package/node/esm/{BcASbEBHzMKiXn5i.mjs → fFLn4uIFYXSk57YZ.mjs} +1 -1
- package/node/esm/group.mjs +27 -27
- package/node/esm/index.mjs +3640 -3610
- package/node/esm/note.mjs +10 -10
- package/node/esm/picture.mjs +182 -161
- package/node/esm/shape.mjs +169 -169
- package/node/esm/slicer.mjs +100 -95
- package/node/esm/{-6T2zqPkDm0WgUKI.mjs → xDrQGeYKZL5Q1dWB.mjs} +2 -2
- package/package.json +7 -7
- package/types/src/cell/CornerTriangle.d.ts +2 -1
- package/types/src/editor/SheetCellEditorLayer.d.ts +0 -5
- package/types/src/editor/formulaPresentation.d.ts +4 -3
- package/types/src/movable/IMovableArea.d.ts +11 -0
- package/types/src/sheet/IWorksheetElement.d.ts +13 -4
- package/types/src/theme/ExplicitTokens.d.ts +18 -0
- package/types/src/theme/ThemeRootStyles.d.ts +31 -0
- package/types/src/theme/buildTokensCSS.d.ts +15 -0
- package/types/src/theme/index.d.ts +2 -4
- package/types/src/theme/useAppColorScheme.d.ts +4 -1
- package/types/src/theme/useGridColorScheme.d.ts +2 -1
- package/types/src/theme/useSystemColors.d.ts +0 -14
- package/types/src/workbook/IWorkbookElement.d.ts +71 -10
|
@@ -4,6 +4,7 @@ import { IWorkbook, IWorkbookIO, IMovable, ITable, IPivotTable } from '@sheetxl/
|
|
|
4
4
|
import { LoadingPanelProps, ErrorPanelProps, RenderFloatPanel, FloatPanelProps, FloatReference, RenderSlotFn, ThemeMode, Command } from '@sheetxl/utils-react';
|
|
5
5
|
import { WorksheetElementProps, IWorksheetElement, OpaqueSheetElementProps } from '../sheet';
|
|
6
6
|
import { SheetEditable } from '../editor';
|
|
7
|
+
import { ExplicitTokens } from '../theme';
|
|
7
8
|
import { CommandContext } from '../frame';
|
|
8
9
|
import { WorkbookStripProps } from './WorkbookStrip';
|
|
9
10
|
/**
|
|
@@ -34,6 +35,13 @@ export interface IWorkbookAttributes {
|
|
|
34
35
|
* `null` until the scope is created (or for a bare chromeless grid with no ambient command root).
|
|
35
36
|
*/
|
|
36
37
|
getCommandScope: () => Command.CommandScope | null;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves once everything on screen has finished drawing: pictures decoded, charts laid out.
|
|
40
|
+
* Unlike {@link WorkbookElementProps.onRenderSettled} it is never cut short by
|
|
41
|
+
* {@link WorkbookElementProps.renderSettleTimeout}, so it suits a capture (a thumbnail, a
|
|
42
|
+
* screenshot). Wait for the next paint after it before reading the screen.
|
|
43
|
+
*/
|
|
44
|
+
whenRenderSettled: () => Promise<void>;
|
|
37
45
|
/**
|
|
38
46
|
* For runtime type checking
|
|
39
47
|
*/
|
|
@@ -47,6 +55,14 @@ export interface IWorkbookElement extends HTMLDivElement, IWorkbookAttributes {
|
|
|
47
55
|
export type WorkbookLoadEvent = {
|
|
48
56
|
source: IWorkbookElement;
|
|
49
57
|
};
|
|
58
|
+
/** What {@link WorkbookElementProps.onRenderSettled} is handed. */
|
|
59
|
+
export type WorkbookRenderSettledEvent = WorkbookLoadEvent & {
|
|
60
|
+
/**
|
|
61
|
+
* `true` when {@link WorkbookElementProps.renderSettleTimeout} ran out first, so some drawing may
|
|
62
|
+
* still be on its way. Await {@link IWorkbookAttributes.whenRenderSettled} for all of it.
|
|
63
|
+
*/
|
|
64
|
+
timedOut: boolean;
|
|
65
|
+
};
|
|
50
66
|
/**
|
|
51
67
|
* What every workbook menu renderer is handed. Spread the rest on the menu's root.
|
|
52
68
|
*/
|
|
@@ -97,22 +113,67 @@ export interface WorkbookElementProps extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
97
113
|
*/
|
|
98
114
|
workbook?: IWorkbook | Promise<IWorkbook> | IWorkbookIO.ReadOptions;
|
|
99
115
|
/**
|
|
100
|
-
* Controlled override for the app (chrome) light/dark scheme.
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
116
|
+
* Controlled override for the app (chrome) light/dark scheme. `'auto'` follows the page: a
|
|
117
|
+
* `dark`/`light` class on `<html>`/`<body>`, else the OS.
|
|
118
|
+
*
|
|
119
|
+
* When omitted, the workbook self-sources it from the shared appearance preference
|
|
120
|
+
* (`ThemeStateKey.Mode`). With no preference set it is light, unless the page puts a `dark`/`light` class
|
|
121
|
+
* on `<html>`/`<body>` or a `ThemeModeFallbackContext` above says otherwise.
|
|
104
122
|
*/
|
|
105
|
-
colorScheme?: ThemeMode;
|
|
123
|
+
colorScheme?: ThemeMode | 'auto';
|
|
106
124
|
/**
|
|
107
|
-
* Controlled override for the grid-body scheme
|
|
108
|
-
*
|
|
125
|
+
* Controlled override for the grid-body scheme. `'auto'` follows the page as {@link colorScheme} does.
|
|
126
|
+
*
|
|
127
|
+
* When omitted, the grid follows {@link colorScheme} only if *Enable Dark Grid*
|
|
128
|
+
* (`ThemeStateKey.DarkGrid`) is on, so by default it stays light in a dark app. Pass it to make the grid
|
|
129
|
+
* dark with the page.
|
|
109
130
|
*/
|
|
110
|
-
gridColorScheme?: ThemeMode;
|
|
131
|
+
gridColorScheme?: ThemeMode | 'auto';
|
|
111
132
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
133
|
+
* Token values for this workbook, per mode and surface: the React form of a stylesheet in
|
|
134
|
+
* `@layer sxl-overrides`, scoped to this instance.
|
|
135
|
+
*
|
|
136
|
+
* ```tsx
|
|
137
|
+
* <WorkbookElement
|
|
138
|
+
* colorScheme="auto"
|
|
139
|
+
* gridColorScheme="auto"
|
|
140
|
+
* tokens={{
|
|
141
|
+
* dark: {
|
|
142
|
+
* app: { 'color-base-100': '#14102c', 'color-base-200': '#14102c', 'color-primary': '#6e9bff' },
|
|
143
|
+
* header: { 'color-base-100': '#1a1538', 'color-base-300': '#312b55' }
|
|
144
|
+
* }
|
|
145
|
+
* }}
|
|
146
|
+
* />
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @remarks
|
|
150
|
+
* An `app` value reaches the grid and headers too in that mode; state a `grid` or `header` cell to make
|
|
151
|
+
* that surface differ. Pass a stable object: a new reference rebuilds the stylesheet.
|
|
152
|
+
*/
|
|
153
|
+
tokens?: ExplicitTokens;
|
|
154
|
+
/**
|
|
155
|
+
* Called when the workbook first renders, before its pictures and charts have finished drawing.
|
|
156
|
+
* To reveal it, use {@link WorkbookElementProps.onRenderSettled}.
|
|
114
157
|
*/
|
|
115
158
|
onWorkbookLoad?: (event: WorkbookLoadEvent) => void | Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Called once the first screen has finished drawing (pictures, charts, the sheet background) and
|
|
161
|
+
* painted, or once {@link WorkbookElementProps.renderSettleTimeout} runs out. The workbook shows at
|
|
162
|
+
* this moment, so it opens whole rather than filling in piece by piece.
|
|
163
|
+
*
|
|
164
|
+
* @remarks
|
|
165
|
+
* Fires once, after {@link WorkbookElementProps.onWorkbookLoad} (and after a returned promise
|
|
166
|
+
* resolves).
|
|
167
|
+
*/
|
|
168
|
+
onRenderSettled?: (event: WorkbookRenderSettledEvent) => void;
|
|
169
|
+
/**
|
|
170
|
+
* How long, in milliseconds after the first paint, the workbook stays hidden waiting for the first
|
|
171
|
+
* screen to finish drawing. Whatever is still loading then appears when it is ready. `0` shows the
|
|
172
|
+
* workbook at its first paint; `Infinity` waits for everything.
|
|
173
|
+
*
|
|
174
|
+
* @defaultValue 300
|
|
175
|
+
*/
|
|
176
|
+
renderSettleTimeout?: number;
|
|
116
177
|
/**
|
|
117
178
|
* Called with the workbook once {@link WorkbookElementProps.workbook} resolves, and again whenever
|
|
118
179
|
* a new input resolves to a different one. Until the first input resolves, or if an input fails,
|