@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.
Files changed (76) hide show
  1. package/browser/esm/{Bjzo7g25tw9kTCYC.mjs → 6KeWPjMKNZY8i19M.mjs} +2 -2
  2. package/browser/esm/{CJVcfqrty5b-eowN.mjs → 9t5N76NQ0awbiItG.mjs} +2 -2
  3. package/browser/esm/{QKnTzTdIYAMcBU8r.mjs → B-rvtChAVnzrPJsd.mjs} +1 -1
  4. package/browser/esm/{DxsGY5rYjITV3SLK.mjs → B0asaf6iVJnOyxYq.mjs} +1 -1
  5. package/browser/esm/{np1ChcItFltS6AC5.mjs → BoljuF1xywgBQ3vp.mjs} +1 -1
  6. package/browser/esm/{CgOhJ3utK7aSQm26.mjs → BuDfdWztNZKCN_Ld.mjs} +1 -1
  7. package/browser/esm/{D7P7zWW2gdWclI2p.mjs → BwuvgXRS-KMp6XCe.mjs} +3 -3
  8. package/browser/esm/{Biz8qA4-1wRN8de2.mjs → By0ADE8R8h3hKM64.mjs} +1 -1
  9. package/browser/esm/{DyFeCww9e_4G9c-1.mjs → CGazs9mfVVzc04Y7.mjs} +178 -158
  10. package/browser/esm/{DgmkBz2cYtVZ8tXv.mjs → CXX4sovIFgAQsSxN.mjs} +1 -1
  11. package/browser/esm/{D8NUgUzdI7YFxyyA.mjs → CaV--rSRIoGsErhZ.mjs} +7 -7
  12. package/browser/esm/{D01C312OntVURMN9.mjs → CfIPv0YuwhlpYzf2.mjs} +122 -122
  13. package/browser/esm/{mJyEnJIX0iGfGtvE.mjs → Cgbmuy79jiY1HjS3.mjs} +1 -1
  14. package/browser/esm/{HQkKZC6SPUdQwgxi.mjs → CmoM33qZfV9EioFC.mjs} +1 -1
  15. package/browser/esm/{hTeTTb8oYTssk6EY.mjs → DHncl8rL4Tri3OBI.mjs} +1 -1
  16. package/browser/esm/{D0g7sllamMog1m-Z.mjs → DK8YNIcwWG9l7BpT.mjs} +3 -3
  17. package/browser/esm/{BPS1PDZKyF6ivJwa.mjs → DQfqezyi9TgWoADc.mjs} +1 -1
  18. package/browser/esm/{DH8xeknZXWn7AV5q.mjs → Dw1dknWgStq1jnIp.mjs} +6 -6
  19. package/browser/esm/{B9rbGikcuRq1OnhM.mjs → IF4tK8a7bQsrq8gd.mjs} +2 -2
  20. package/browser/esm/{BqIbT28MM3SBdvh_.mjs → ISe4yn20JJcyYnhz.mjs} +2 -2
  21. package/browser/esm/{mUKvsPCmRWzQke-M.mjs → UKEdlUOzahaOstGm.mjs} +1 -1
  22. package/browser/esm/{DhGJU1camaOf7KOq.mjs → W00O27emy3mpzSYw.mjs} +4 -4
  23. package/browser/esm/chart.mjs +11 -11
  24. package/browser/esm/control.mjs +16 -16
  25. package/browser/esm/{C7rc3CMd_XOITW1V.mjs → dwz-qrgJG3GabtJ0.mjs} +7 -7
  26. package/browser/esm/group.mjs +29 -29
  27. package/browser/esm/index.mjs +6469 -6440
  28. package/browser/esm/{B9wkino8VMasq6E3.mjs → jmoe5Dbqx1WjBgUO.mjs} +2 -2
  29. package/browser/esm/note.mjs +10 -10
  30. package/browser/esm/picture.mjs +2 -2
  31. package/browser/esm/{CrTfqdSwWScJN566.mjs → plaFoOG2sGGR9984.mjs} +1 -1
  32. package/browser/esm/shape.mjs +2 -2
  33. package/browser/esm/slicer.mjs +55 -50
  34. package/node/esm/{GG78Gq3CY8SDS-48.mjs → 7HceIR_VkgIhKM8f.mjs} +12 -12
  35. package/node/esm/{CZc2QH8i-TgW9nGI.mjs → 9vtv3spOcuota3Vb.mjs} +1 -1
  36. package/node/esm/{BPMjPMRyVTEZq_6j.mjs → B0EM467vxmzaUp9t.mjs} +1 -1
  37. package/node/esm/{BpcTu_chuDjr_XFv.mjs → BUiM5r_ksWRJMWPn.mjs} +1 -1
  38. package/node/esm/{CE5fMGMmykts2yJP.mjs → BYhlpUYwaNUr67Yi.mjs} +1 -1
  39. package/node/esm/{COlzVELrEvgm2STX.mjs → Bd_YMUKA8RxBL4G2.mjs} +4 -4
  40. package/node/esm/{DHTbAHbCiEWhilV_.mjs → BgCEqNCStGMDZ1QF.mjs} +1 -1
  41. package/node/esm/{FUQMKIiQQ5m3xzeO.mjs → BguHdiclysorJICc.mjs} +1 -1
  42. package/node/esm/{C3XXdc_UXH2g2W5E.mjs → BlahUrDcsABBUCM0.mjs} +1 -1
  43. package/node/esm/{C91YeRrspETjFcRc.mjs → Bub_Mjqm7gIOrcpM.mjs} +2 -2
  44. package/node/esm/{aLt3NYdUcYQu4Ur4.mjs → CH0kTLjibrtP2Cbj.mjs} +1 -1
  45. package/node/esm/{i4aPmKocZebCBeSd.mjs → CHPFQjpRp8efzowW.mjs} +6 -6
  46. package/node/esm/{l0GtU6LYlBywzc9T.mjs → CtBn6NAJs8ogJXEf.mjs} +2 -2
  47. package/node/esm/{CzQMRmArhJ6blZJp.mjs → D1Kny6jQY-Z5cM3U.mjs} +1 -1
  48. package/node/esm/{CcLUKcJROXrbSXjb.mjs → D2CFdcWIygfybLGD.mjs} +1 -1
  49. package/node/esm/{CfpNgRvWmu36cTfV.mjs → DFc3ldcMwcvqOz8-.mjs} +5 -5
  50. package/node/esm/{cju5Gx-t_74o116W.mjs → DHtgb2GVYcKg4gyl.mjs} +2 -2
  51. package/node/esm/{DX7ysYSfnigj0ak8.mjs → DUzvBfMhVRALWCyY.mjs} +1 -1
  52. package/node/esm/{DxKxx-yEkSydHyWQ.mjs → DXMUS-l19Pg6Apgt.mjs} +1 -1
  53. package/node/esm/chart.mjs +19 -19
  54. package/node/esm/control.mjs +16 -16
  55. package/node/esm/{BcASbEBHzMKiXn5i.mjs → fFLn4uIFYXSk57YZ.mjs} +1 -1
  56. package/node/esm/group.mjs +27 -27
  57. package/node/esm/index.mjs +3640 -3610
  58. package/node/esm/note.mjs +10 -10
  59. package/node/esm/picture.mjs +182 -161
  60. package/node/esm/shape.mjs +169 -169
  61. package/node/esm/slicer.mjs +100 -95
  62. package/node/esm/{-6T2zqPkDm0WgUKI.mjs → xDrQGeYKZL5Q1dWB.mjs} +2 -2
  63. package/package.json +7 -7
  64. package/types/src/cell/CornerTriangle.d.ts +2 -1
  65. package/types/src/editor/SheetCellEditorLayer.d.ts +0 -5
  66. package/types/src/editor/formulaPresentation.d.ts +4 -3
  67. package/types/src/movable/IMovableArea.d.ts +11 -0
  68. package/types/src/sheet/IWorksheetElement.d.ts +13 -4
  69. package/types/src/theme/ExplicitTokens.d.ts +18 -0
  70. package/types/src/theme/ThemeRootStyles.d.ts +31 -0
  71. package/types/src/theme/buildTokensCSS.d.ts +15 -0
  72. package/types/src/theme/index.d.ts +2 -4
  73. package/types/src/theme/useAppColorScheme.d.ts +4 -1
  74. package/types/src/theme/useGridColorScheme.d.ts +2 -1
  75. package/types/src/theme/useSystemColors.d.ts +0 -14
  76. 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. When omitted, the workbook self-sources
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).
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 (stays light in a dark app when *Enable Dark Grid* is
108
- * off). When omitted, derived from {@link colorScheme} + the `ThemeStateKey.DarkGrid` preference.
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
- * Callback for when the workbook is loaded (first render). Useful for hiding/showing
113
- * loading panels.
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,