@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.
Files changed (100) hide show
  1. package/browser/esm/{D31c0jLWUiR_PbJx.mjs → 0i5npOCRbbj7n8AX.mjs} +1 -1
  2. package/browser/esm/{DwBel0Adpgih98Bx.mjs → 6KVLDn6fk3Lwk3W0.mjs} +6 -6
  3. package/browser/esm/{UHmh1sM5QVfLE8k9.mjs → BFBIk0dXMPBtSHGB.mjs} +1 -1
  4. package/browser/esm/{BcXp1o2gLGZELmri.mjs → BMZ6O7J3XnUMlQJ5.mjs} +2 -2
  5. package/browser/esm/{ug2NMfIbkfZBiXkg.mjs → BMl3t5nAS8wea8ia.mjs} +1 -1
  6. package/browser/esm/{DfcSTBeSndcnaDmd.mjs → BR8he3r4FlfNbM5Y.mjs} +1 -1
  7. package/browser/esm/{C0hKnoaENmUoL-z2.mjs → BWCG8Jc6oF3jzfFk.mjs} +5 -5
  8. package/browser/esm/{DJcMX3VDXMFffxMB.mjs → B_PNL36bd0h74iJo.mjs} +4 -4
  9. package/browser/esm/{CpVFyFe90rLBAlOg.mjs → BcTcL2e5NjgL1j-k.mjs} +1 -1
  10. package/browser/esm/{r9VdX3klACo84akj.mjs → BiyB416KncWj7-2t.mjs} +3 -3
  11. package/browser/esm/{Cuj2BAFNMP_v-leq.mjs → BpEap6qV7SAhbiMg.mjs} +2 -2
  12. package/browser/esm/{DCTRODeK8qZe23Qi.mjs → By-Xfu2c6LLIWg-G.mjs} +6 -6
  13. package/browser/esm/{68UAeYtcR5vNUi7B.mjs → C8CBCqCUydGXhIco.mjs} +2 -2
  14. package/browser/esm/{GW6aAFystRCaCV82.mjs → CEIulpO2M6bY6Hgq.mjs} +1 -1
  15. package/browser/esm/{3cI2Pl36MTdJwiRb.mjs → CJxA4mQkgsRg8ejK.mjs} +3 -3
  16. package/browser/esm/{DJoM2pxo9ngKG7wz.mjs → CSsytd3vgnhi7AMm.mjs} +1 -1
  17. package/browser/esm/{B4xuC6B9qgSP0RLB.mjs → CTFVB5vQl5dFo1zd.mjs} +2 -2
  18. package/browser/esm/{CH-ZkDyLeYYfuWs-.mjs → C_OaCmryR0Nc4vfH.mjs} +1 -1
  19. package/browser/esm/{DQ_Jv9q6nhkN6guI.mjs → D7Kvnl4-FdEGuadk.mjs} +1 -1
  20. package/browser/esm/{BZ7wS4DMuK-Ja1PK.mjs → DOuAxKNRVl3p4oUg.mjs} +1 -1
  21. package/browser/esm/{CKkDsvwbMHj8qNkT.mjs → DZT2k-wAR3bBFQhh.mjs} +1 -1
  22. package/browser/esm/{e1CVc488qLwKV4pf.mjs → Dce_lDRjVEpn-4Gj.mjs} +1 -1
  23. package/browser/esm/{BFTnNTWyDV8Tp0b3.mjs → DrYGRymc8k3JZBZu.mjs} +3 -3
  24. package/browser/esm/{DA2jE0248M94__xq.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 +3242 -2259
  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/{gUl_AJjdjUikWSiV.mjs → wr_Q6qSI16PKN4hz.mjs} +3 -3
  34. package/node/esm/{Dq6uRVLQnUa-nPqs.mjs → 365x7ulQ-64LrEAY.mjs} +2 -2
  35. package/node/esm/{DqQ8kJ6VG-8kThfG.mjs → 5NC4KAa0mRhqju4E.mjs} +1 -1
  36. package/node/esm/{DPjECbRSqcAbRjOb.mjs → 7F9gtINd9IcYvclT.mjs} +1 -1
  37. package/node/esm/{CYRvHuhsdtu0Thlx.mjs → 9PkyqxxZGq4LpuXf.mjs} +1 -1
  38. package/node/esm/{BXHdgvfoAY-kTa3t.mjs → B7NgL3l0XJbyq9CG.mjs} +1 -1
  39. package/node/esm/{D0SQwn9pOERRK_k-.mjs → BdEX-Y0ROOf8zRce.mjs} +4 -4
  40. package/node/esm/{B5ptbGVfEUGVwTc3.mjs → C9l2nKVgsffhreTD.mjs} +1 -1
  41. package/node/esm/{CW627g627m7kngw1.mjs → CAbud00Api3zYMB0.mjs} +1 -1
  42. package/node/esm/{C7pT3AVfm5NnonRZ.mjs → CRM_BM8JnHgH5kni.mjs} +1 -1
  43. package/node/esm/{oAwOguzSpeebACWB.mjs → C_E-6lqeDHYSKGcS.mjs} +5 -5
  44. package/node/esm/{Bqd6WwH3hhxhjMZI.mjs → CyNcgbrqDcBpNJ-N.mjs} +2 -2
  45. package/node/esm/{DHnWKZ7s67r7e_g8.mjs → D2fA8lJO1ZAm7rTz.mjs} +1 -1
  46. package/node/esm/{OPx-m4H3bEnQEa5_.mjs → D5tl-HceFOKuhUPG.mjs} +2 -2
  47. package/node/esm/{BYAZYjNlopMmpCr-.mjs → D7jDl04btyfWjg7U.mjs} +1 -1
  48. package/node/esm/{IeiL1efbWNC4BbBi.mjs → D8MLM0vKRTMxDGC6.mjs} +1 -1
  49. package/node/esm/{CUDgrjO1Bl_f_GgH.mjs → DQkjdt-an36XKGvV.mjs} +1 -1
  50. package/node/esm/{B2gKyoNGnDrUyDZa.mjs → Dg4ph4wH0DWRbx7E.mjs} +1 -1
  51. package/node/esm/{Dcj2cVM7hHbgjgJH.mjs → Dx0Dz6NG76-IKZ1i.mjs} +2 -2
  52. package/node/esm/{B13bwVa149r4BtWR.mjs → UbxFnWpUxT3TQSUA.mjs} +1 -1
  53. package/node/esm/chart.mjs +2 -2
  54. package/node/esm/control.mjs +2 -2
  55. package/node/esm/{BGRzGNFgu0S7f4A_.mjs → gqpfUtQ8Q1y4j0w3.mjs} +1 -1
  56. package/node/esm/group.mjs +3 -3
  57. package/node/esm/index.mjs +5626 -4636
  58. package/node/esm/note.mjs +4 -4
  59. package/node/esm/picture.mjs +5 -5
  60. package/node/esm/shape.mjs +6 -6
  61. package/node/esm/{X0rgdl5M_Oz_b0LN.mjs → skitA3Vys5WjKQnm.mjs} +1 -1
  62. package/node/esm/slicer.mjs +4 -4
  63. package/package.json +7 -7
  64. package/resources/locales/de/pivot.cmd.json +1 -1
  65. package/resources/locales/de/sheet.cmd.json +5 -5
  66. package/resources/locales/de/ui.msg.json +36 -0
  67. package/resources/locales/de/workbook.cmd.json +0 -5
  68. package/resources/locales/en/pivot.cmd.json +1 -1
  69. package/resources/locales/en/sheet.cmd.json +5 -5
  70. package/resources/locales/en/ui.msg.json +36 -0
  71. package/resources/locales/en/workbook.cmd.json +0 -5
  72. package/types/src/annotation/RangeAnnotationLayer.d.ts +110 -0
  73. package/types/src/annotation/RangeAnnotationTag.d.ts +23 -0
  74. package/types/src/annotation/RangeAnnotations.d.ts +67 -6
  75. package/types/src/annotation/index.d.ts +2 -0
  76. package/types/src/index.d.ts +3 -3
  77. package/types/src/layer/CommentCardLayer.d.ts +1 -1
  78. package/types/src/layer/SheetLayers.d.ts +57 -1
  79. package/types/src/layer/index.d.ts +0 -1
  80. package/types/src/movable/MovableCommandGroups.d.ts +0 -18
  81. package/types/src/pivot/PivotTablePane.d.ts +0 -2
  82. package/types/src/presence/PresenceCommands.d.ts +35 -0
  83. package/types/src/presence/PresenceHost.d.ts +58 -0
  84. package/types/src/presence/PresenceMessages.d.ts +42 -0
  85. package/types/src/presence/PresenceStore.d.ts +165 -0
  86. package/types/src/presence/PresenceTypes.d.ts +78 -0
  87. package/types/src/presence/index.d.ts +7 -0
  88. package/types/src/presence/usePresence.d.ts +20 -0
  89. package/types/src/taskPane/CellControlPane.d.ts +0 -2
  90. package/types/src/taskPane/MovablePane.d.ts +0 -2
  91. package/types/src/taskPane/TaskPaneFrame.d.ts +4 -4
  92. package/types/src/taskPane/TaskPaneKeys.d.ts +38 -0
  93. package/types/src/taskPane/TaskPaneRegistry.d.ts +32 -12
  94. package/types/src/taskPane/_paneReasons.d.ts +7 -0
  95. package/types/src/taskPane/index.d.ts +1 -0
  96. package/types/src/theme/ThemeState.d.ts +2 -2
  97. package/types/src/theme/useGridColorScheme.d.ts +1 -1
  98. package/types/src/workbook/IWorkbookElement.d.ts +3 -1
  99. package/types/src/workbook/WorkbookCommands.d.ts +6 -1
  100. package/types/src/layer/RangeAnnotationLayer.d.ts +0 -71
@@ -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
  /**
@@ -1,71 +0,0 @@
1
- import { default as React } from 'react';
2
- import { IWorksheet, IWorkbook } from '@sheetxl/sdk';
3
- import { LayerProps, StickyState } from '@sheetxl/grid-react';
4
- import { RangeAnnotation } from '../annotation';
5
- /** How an intent is drawn: its box, and the chip's frame. */
6
- export interface RangeAnnotationStyle {
7
- /** The box border (and the chip's frame). */
8
- border: string;
9
- /** The box fill — translucent, the cells show through. */
10
- fill: string;
11
- /** The chip's frame — opaque; a chip reads by z-order, never by letting what is under it show through. */
12
- chip: string;
13
- }
14
- /**
15
- * The default look per intent. Deliberately flatter than the selection (no thick, handled border,
16
- * which reads as "draggable"): a soft fill and a thin border.
17
- */
18
- export declare const DEFAULT_ANNOTATION_STYLES: Readonly<Record<string, RangeAnnotationStyle>>;
19
- /** What a chip (or its out-of-view marker) is rendered from. */
20
- export interface RangeAnnotationChipProps {
21
- workbook: IWorkbook;
22
- /** The annotation the chip stands for — the current one of its group when it is among them. */
23
- annotation: RangeAnnotation;
24
- /** Others sharing this chip's anchor cell. */
25
- more: number;
26
- /** 1-based position in the walked list; `0` for a `working` annotation. */
27
- position: number;
28
- /** How many are walked. */
29
- total: number;
30
- isCurrent: boolean;
31
- style: RangeAnnotationStyle;
32
- /** The float's resolved state (`slid`, `outOfView`, `scrollIntoView`, …). */
33
- state: StickyState;
34
- }
35
- export interface RangeAnnotationLayerProps extends Omit<LayerProps, 'children'> {
36
- /** The sheet whose annotations are drawn. @defaultValue the sheet in context (an injected layer needs none) */
37
- sheet?: IWorksheet;
38
- /** Per-intent look. Merged over {@link DEFAULT_ANNOTATION_STYLES}. */
39
- styles?: Readonly<Record<string, RangeAnnotationStyle>>;
40
- /** Render the chip beside an annotation that is in view. Omit for the default. */
41
- renderChip?: (props: RangeAnnotationChipProps) => React.ReactNode;
42
- /** Render the marker that stands in for a chip whose range is scrolled out of view. Omit for the default. */
43
- renderMarker?: (props: RangeAnnotationChipProps) => React.ReactNode;
44
- /** How much a box that is not the navigator's current one fades. Boxes only — never chips. @defaultValue 0.45 */
45
- dimOpacity?: number;
46
- /**
47
- * Whether an annotation gets a chip (and, scrolled off, a marker) or is drawn as its box alone —
48
- * for a host that shows some annotations elsewhere (an agent's cursor, in its own status control).
49
- * @defaultValue every walked annotation, and a `working` one only when it has a label
50
- */
51
- showChip?: (annotation: RangeAnnotation) => boolean;
52
- }
53
- /**
54
- * The workbook's range annotations on this sheet: a soft box per annotation, and a chip per anchor
55
- * cell. The chip rides a {@link StickyPortal} with `whenOff: 'clamp'`, so when its range scrolls out
56
- * of view it stays at the edge as a small marker (the position, an arrow toward the range; click
57
- * reveals it) instead of vanishing.
58
- *
59
- * @remarks
60
- * The navigator's current annotation draws last (on top) at full strength; the others dim. That is
61
- * what keeps overlapping annotations legible. Hovering a chip lifts it — and its boxes — above the
62
- * current one while the pointer stays, so a chip hidden under another can be read and reached. Annotations that share a top-left cell share one chip —
63
- * the current one's if it is among them — with a `+N` for the rest, so chips never stack.
64
- *
65
- * A prebuilt layer, not part of the sheet's default stack: a host that shows annotations injects it
66
- * through the sheet's `layers` (`propsSheet={{ layers: [<RangeAnnotationLayer key="annotations" />] }}`
67
- * on a workbook element). It reads the sheet from context and draws nothing while the workbook has no
68
- * annotations. Fed through {@link addRangeAnnotations}.
69
- */
70
- export declare const RangeAnnotationLayer: React.MemoExoticComponent<(props: RangeAnnotationLayerProps) => React.JSX.Element>;
71
- //# sourceMappingURL=RangeAnnotationLayer.d.ts.map