@sheetxl/studio-mui 0.8.0-beta.4 → 0.8.0-beta.6

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 (81) hide show
  1. package/browser/cjs/{BGvoJjUs21bbuE1i.cjs → 3RXtLkq7wTAV6y_e.cjs} +1 -1
  2. package/browser/cjs/{BXkdjAb4jpTr412c.cjs → BD50lsTki7wvzb5g.cjs} +1 -1
  3. package/browser/cjs/BlNKpwiG-Q7eIi5t.cjs +8 -0
  4. package/browser/cjs/ByIUHPOa02D7XbdC.cjs +1 -0
  5. package/browser/cjs/{eCw4rAEIYE3BftpG.cjs → CkroJ2FmfFvk6Eyv.cjs} +1 -1
  6. package/browser/cjs/{B9GcCj7sj8XdjPZF.cjs → CzJvR12QCQb-0Rtn.cjs} +1 -1
  7. package/browser/cjs/{3uprnzi2l0iT17Dg.cjs → D-Yo5aV9STT5KH4G.cjs} +1 -1
  8. package/browser/cjs/{BHb7TnK1NmimV4OX.cjs → DwkiLFWUtLC8ZcIQ.cjs} +1 -1
  9. package/browser/cjs/index.cjs +1 -1
  10. package/browser/cjs/xCAd86Y_REa3Xs1o.cjs +13 -0
  11. package/browser/esm/{wqS-qBYe9-awT5Rr.mjs → 27jPjqdDLWn5qbQ8.mjs} +3 -3
  12. package/browser/esm/{o8pQBbpRc03xny0J.mjs → 2_WF-hy6x4dXfEzW.mjs} +1 -1
  13. package/browser/esm/{Dj2-pD6jM9SjbPfX.mjs → 61ip_C1X9ls4svw6.mjs} +1 -1
  14. package/browser/esm/{BH7X6WilO_oB3j3h.mjs → 6EK3JgWrKYfqzAfV.mjs} +1 -1
  15. package/browser/esm/{CrTz-SMNtZoj2Z48.mjs → BFxtcKJBbfjtMft-.mjs} +2 -2
  16. package/browser/esm/{DRQzyIQfZQuviFBK.mjs → BGdZT1Ka4ohDCZpW.mjs} +3 -3
  17. package/browser/esm/{CimAg7LJqIb3ULYp.mjs → BPzT8gL3SgD0CG7V.mjs} +1131 -1091
  18. package/browser/esm/{CHqIzUemj2wQqlNO.mjs → BlWsO6M15Ii13NrV.mjs} +2 -2
  19. package/browser/esm/{DoU18LVtqUiePYs1.mjs → BofZe0q9bsHQr0Xd.mjs} +1 -1
  20. package/browser/esm/{DFbbRoJIDXqoF7nu.mjs → BybBaLxSKyGAsxqO.mjs} +3 -3
  21. package/browser/esm/{BJCaJYz86lNGZGh1.mjs → C5swGBbBLdDzg_bm.mjs} +2 -2
  22. package/browser/esm/{BVs5I1lTSja2b0B9.mjs → CKemMJZNIPnJ0dUE.mjs} +2 -2
  23. package/browser/esm/{ec1sT17zcL-gOSRO.mjs → CsNOEAKuHLfckItX.mjs} +1 -1
  24. package/browser/esm/CyQk62MFBCep2ZZs.mjs +223 -0
  25. package/browser/esm/{4zCEiqAUYE1FtC_Y.mjs → D-JQOjmAh6Gk6wVM.mjs} +2 -2
  26. package/browser/esm/{OwfpYCy5lgrQ-16J.mjs → D3b3dWTjvFd1Kj5g.mjs} +1 -1
  27. package/browser/esm/{Bv0eMxh_ZN44Ikgp.mjs → D8FEKUKVxH32duMx.mjs} +3 -3
  28. package/browser/esm/{nZ7NKFIakvUB_oNM.mjs → DRUKu2I27bidfyvH.mjs} +1 -1
  29. package/browser/esm/{CtOFBKJZWEJY5GOf.mjs → DTLKzrZGPkkNlncN.mjs} +2 -2
  30. package/browser/esm/{BWNmYjzGDBhZYgIO.mjs → Dzym1WSjYb_mnVkJ.mjs} +2 -2
  31. package/browser/esm/{CPDwT78ZJV0KhVfv.mjs → FK7vqizwRujDsqL2.mjs} +1825 -1743
  32. package/browser/esm/{DHYkgVTs7_z8sPt8.mjs → JYRkZ4iKzbWnNhEs.mjs} +2 -2
  33. package/browser/esm/{S7-XfIxL3I5D5tDS.mjs → aGoWX29-zbUaPh2U.mjs} +2 -2
  34. package/browser/esm/index.mjs +94 -94
  35. package/browser/esm/{BmVeug3PPG-mEUBe.mjs → p62JxLmjmWD2MQq1.mjs} +2 -2
  36. package/licenses/dependencies.txt +134 -134
  37. package/node/esm/{BVmpGvXDUqEmggq3.mjs → 3J2-TRYWEsvnTDnO.mjs} +1 -1
  38. package/node/esm/{BtruJA9z21K9pnuA.mjs → B2QOYsl1YmcwknsP.mjs} +9 -9
  39. package/node/esm/{DKzeeAeOVF2r68yb.mjs → CE6ZU2MVb3_-FzIk.mjs} +1 -1
  40. package/node/esm/{CUsUUWPxbO1IW9PY.mjs → CKOhL08sVy1N_Uza.mjs} +1 -1
  41. package/node/esm/{FxGz3tv6y2gcffmK.mjs → CksPMsHwUSCpFnpS.mjs} +1205 -1164
  42. package/node/esm/{B9iw8mqg0MDNDp5_.mjs → CtoRlEz1GwA88zTu.mjs} +1 -1
  43. package/node/esm/{BNROwD9ZMLgwtXL_.mjs → CzERDnu2VbNTjJgI.mjs} +8 -8
  44. package/node/esm/{2wtbIYdeGDT6UzN4.mjs → D3xcuMwJvLJhlPNV.mjs} +1 -1
  45. package/node/esm/{CGhj-BDkyrejG1Jj.mjs → DDVJs9oOFXR3RfSi.mjs} +1 -1
  46. package/node/esm/{DMbGl7mOdelCN7-u.mjs → Dc4t_AYLdTAnPOIT.mjs} +1 -1
  47. package/node/esm/{T3WcGiReCHGeKPOy.mjs → JUUre9pYia7feetw.mjs} +1 -1
  48. package/node/esm/{R1_Dii8zCHEAZKvZ.mjs → K6LEXUZkuqoEn5yJ.mjs} +1 -1
  49. package/node/esm/{B1z-keCkm0LI9ezw.mjs → ObY_iULY2ezBYD3q.mjs} +1 -1
  50. package/node/esm/index.mjs +2901 -2820
  51. package/node/esm/{DhZG-hcTUn-vLoZy.mjs → qu70N1tsIwi7LmT6.mjs} +1 -1
  52. package/node/esm/{7ZI8MoM6mY-P4VfQ.mjs → uIRinWE0OCKJvsGN.mjs} +2 -2
  53. package/package.json +9 -9
  54. package/resources/locales/de/ui.msg.json +3 -4
  55. package/resources/locales/en/ui.msg.json +3 -4
  56. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +6 -0
  57. package/types/src/conditions/BetweenOption.d.ts +5 -0
  58. package/types/src/conditions/ScalarOption.d.ts +18 -0
  59. package/types/src/dialog/index.d.ts +0 -1
  60. package/types/src/filter/FilterList.d.ts +3 -3
  61. package/types/src/form/FormulaField.d.ts +6 -0
  62. package/types/src/format/AlignmentPanel.d.ts +1 -2
  63. package/types/src/format/BorderPreview.d.ts +23 -13
  64. package/types/src/format/useFormatSelection.d.ts +3 -2
  65. package/types/src/itemsPanel/EditorCommit.d.ts +32 -0
  66. package/types/src/itemsPanel/EditorPanel.d.ts +1 -2
  67. package/types/src/itemsPanel/ItemsDescriptor.d.ts +13 -0
  68. package/types/src/itemsPanel/index.d.ts +1 -0
  69. package/types/src/studio/CommandsWrapper.d.ts +2 -0
  70. package/types/src/studio/StudioCommandProvider.d.ts +7 -0
  71. package/types/src/studio/StudioCommands.d.ts +2 -2
  72. package/types/src/studio/StudioProps.d.ts +1 -1
  73. package/types/src/studio/StudioSplitPane.d.ts +1 -1
  74. package/browser/cjs/CucKgy044KxMHXrx.cjs +0 -13
  75. package/browser/cjs/Cy_XmYq6BsWmCXkk.cjs +0 -3
  76. package/browser/cjs/Dq9lIOzvxW3EKYkD.cjs +0 -8
  77. package/browser/cjs/QI6GKw7uo1f8gY8C.cjs +0 -1
  78. package/browser/esm/BiZHUr1gWhtKdzrE.mjs +0 -222
  79. package/browser/esm/Dg5qnLoncOqT-F5i.mjs +0 -97
  80. package/node/esm/XpqeM7yyMghtMgLc.mjs +0 -98
  81. package/types/src/dialog/CommentsDialog.d.ts +0 -11
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.4
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.6
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.4
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.6
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { a as e, i as o, n as t, r as i, t as l } from "./BVmpGvXDUqEmggq3.mjs";
7
+ import { a as e, i as o, n as t, r as i, t as l } from "./3J2-TRYWEsvnTDnO.mjs";
8
8
  import { VERSION as n } from "@sheetxl/sdk";
9
9
  import { LogoTextNoPaddingIcon as a } from "@sheetxl/react";
10
10
  import { DynamicIcon as r, useTranslator as d } from "@sheetxl/utils-react";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/studio-mui",
3
3
  "description": "Studio - Spreadsheet UI built with SheetXL SDK using React & MUI.",
4
- "version": "0.8.0-beta.4",
4
+ "version": "0.8.0-beta.6",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -52,14 +52,14 @@
52
52
  "@dnd-kit/modifiers": "^9.0.0",
53
53
  "@dnd-kit/sortable": "^10.0.0",
54
54
  "@dnd-kit/utilities": "^3.2.2",
55
- "@sheetxl/grid-react": "^0.8.0-beta.4",
56
- "@sheetxl/io": "^0.8.0-beta.4",
57
- "@sheetxl/react": "^0.8.0-beta.4",
58
- "@sheetxl/scripting-react": "^0.8.0-beta.4",
59
- "@sheetxl/sdk": "^0.8.0-beta.4",
60
- "@sheetxl/utils": "^0.8.0-beta.4",
61
- "@sheetxl/utils-mui": "^0.8.0-beta.4",
62
- "@sheetxl/utils-react": "^0.8.0-beta.4",
55
+ "@sheetxl/grid-react": "^0.8.0-beta.6",
56
+ "@sheetxl/io": "^0.8.0-beta.6",
57
+ "@sheetxl/react": "^0.8.0-beta.6",
58
+ "@sheetxl/scripting-react": "^0.8.0-beta.6",
59
+ "@sheetxl/sdk": "^0.8.0-beta.6",
60
+ "@sheetxl/utils": "^0.8.0-beta.6",
61
+ "@sheetxl/utils-mui": "^0.8.0-beta.6",
62
+ "@sheetxl/utils-react": "^0.8.0-beta.6",
63
63
  "clsx": "^2.1.1",
64
64
  "csstype": "^3.2.3",
65
65
  "file-saver": "^2.0.5",
@@ -73,10 +73,6 @@
73
73
  "command.saveAsFormat.compact": "als {format}",
74
74
  "command.saveAsFormat.label": "Als {format} speichern",
75
75
  "command.saveAsFormat.workbook": "Als {format} speichern",
76
- "comments.label": "Kommentare",
77
- "comments.placeholder": "Geben Sie einen Kommentar ein.",
78
- "comments.titleEdit": "Kommentare bearbeiten",
79
- "comments.titleInsert": "Kommentare einfügen",
80
76
  "condition.above": "Über",
81
77
  "condition.and": "und",
82
78
  "condition.below": "Unter",
@@ -94,6 +90,7 @@
94
90
  "condition.groupBasic": "Einfach",
95
91
  "condition.groupCombine": "Kombinieren",
96
92
  "condition.ignoreBlanks": "Leere Zellen ignorieren",
93
+ "condition.invalidDateTime": "Datum oder Uhrzeit eingeben",
97
94
  "condition.items": "Elemente",
98
95
  "condition.listItemHasComma": "Ein Listeneintrag darf kein Komma enthalten",
99
96
  "condition.listPreview": "{count, plural, =0 {Keine Einträge} one {# Eintrag} other {# Einträge}}",
@@ -411,12 +408,14 @@
411
408
  "findReplace.within": "Durchsuchen",
412
409
  "format.accountingUnderline": "Buchhaltungsunterstreichung",
413
410
  "format.borderDiagram": "Klicken Sie auf eine Kante, um sie zu zeichnen oder zu entfernen",
411
+ "format.color": "Farbe",
414
412
  "format.degrees": "Grad",
415
413
  "format.effects": "Effekte",
416
414
  "format.fontFamily": "Schriftart",
417
415
  "format.fontSize": "Schriftgrad",
418
416
  "format.horizontalAlignment": "Horizontale Ausrichtung",
419
417
  "format.indent": "Einzug",
418
+ "format.indentUnit": "Zeichen",
420
419
  "format.merge": "Verbinden",
421
420
  "format.orientation": "Textdrehung",
422
421
  "format.overflow": "Textüberlauf",
@@ -73,10 +73,6 @@
73
73
  "command.saveAsFormat.compact": "as {format}",
74
74
  "command.saveAsFormat.label": "Save as {format}",
75
75
  "command.saveAsFormat.workbook": "Save as {format}",
76
- "comments.label": "Comments",
77
- "comments.placeholder": "Enter a comment.",
78
- "comments.titleEdit": "Edit Comments",
79
- "comments.titleInsert": "Insert Comments",
80
76
  "condition.above": "Above",
81
77
  "condition.and": "and",
82
78
  "condition.below": "Below",
@@ -94,6 +90,7 @@
94
90
  "condition.groupBasic": "Basic",
95
91
  "condition.groupCombine": "Combine",
96
92
  "condition.ignoreBlanks": "Ignore Blanks",
93
+ "condition.invalidDateTime": "Enter a date or a time",
97
94
  "condition.items": "Items",
98
95
  "condition.listItemHasComma": "A list item cannot contain a comma",
99
96
  "condition.listPreview": "{count, plural, =0 {No items} one {# item} other {# items}}",
@@ -411,12 +408,14 @@
411
408
  "findReplace.within": "Within",
412
409
  "format.accountingUnderline": "Accounting Underline",
413
410
  "format.borderDiagram": "Click an edge to draw or clear it",
411
+ "format.color": "Color",
414
412
  "format.degrees": "Degrees",
415
413
  "format.effects": "Effects",
416
414
  "format.fontFamily": "Font",
417
415
  "format.fontSize": "Size",
418
416
  "format.horizontalAlignment": "Horizontal Alignment",
419
417
  "format.indent": "Indent",
418
+ "format.indentUnit": "Characters",
420
419
  "format.merge": "Merge",
421
420
  "format.orientation": "Orientation",
422
421
  "format.overflow": "Overflow",
@@ -90,6 +90,12 @@ export interface AnchorItemsDescriptor<T extends AnchorItem> {
90
90
  * need nothing here — protected ranges do, because hashing a password is asynchronous.
91
91
  */
92
92
  beforeSave?(edited: T): Promise<void> | void;
93
+ /**
94
+ * Whether the temporary item can be saved as it is — see `ItemsDescriptor.validate`.
95
+ *
96
+ * @returns A message key naming the problem, or `null`.
97
+ */
98
+ validate?(edited: T): string | null;
93
99
  /**
94
100
  * Applies the edited (temporary) item back onto the existing collection item on save.
95
101
  * The add path (`index === -1`) uses `collection.add` and does not call this.
@@ -9,6 +9,11 @@ export interface BetweenProps extends BoxProps {
9
9
  * The callback function to handle changes in the between option.
10
10
  */
11
11
  onOptionChange: (option: ICondition.BetweenOption) => void;
12
+ /**
13
+ * The selector the bounds are compared under. A date or time selector has its bounds typed and
14
+ * shown as dates or times.
15
+ */
16
+ selector?: ICondition.ISelector | null;
12
17
  /**
13
18
  * If true, makes the editor read-only.
14
19
  */
@@ -1,5 +1,9 @@
1
1
  import { Scalar, ICalculation } from '@sheetxl/sdk';
2
2
  import { FormulaFieldProps } from '../form';
3
+ /**
4
+ * What a typed literal is, for an operand that is a date or a time.
5
+ */
6
+ export type ScalarOptionLiteral = 'date' | 'time' | 'dateTime';
3
7
  export interface ScalarOptionProps extends Omit<FormulaFieldProps, 'value' | 'onChange'> {
4
8
  /**
5
9
  * The option to edit — a literal (number, text, boolean), or a formula.
@@ -9,6 +13,15 @@ export interface ScalarOptionProps extends Omit<FormulaFieldProps, 'value' | 'on
9
13
  * The callback function to handle changes in the option.
10
14
  */
11
15
  onOptionChange: (option: Scalar | ICalculation.IFormula) => void;
16
+ /**
17
+ * How a typed literal is read. Omitted, numeric text is a number and anything else is text.
18
+ *
19
+ * @remarks
20
+ * A date or time literal is typed as it is into a cell (`9/23/95`, `14:30`), held as its serial,
21
+ * and shown back as a date or time. Text that is neither is held as typed and outlined as an
22
+ * error, which also holds back the editor's Save.
23
+ */
24
+ literal?: ScalarOptionLiteral;
12
25
  /**
13
26
  * If true, makes the editor read-only.
14
27
  */
@@ -24,6 +37,11 @@ export interface ScalarOptionProps extends Omit<FormulaFieldProps, 'value' | 'on
24
37
  * An imported operand like `=$A$1` arrives as a formula param; a number input rendered it blank
25
38
  * and destroyed it on the first keystroke. Here it reads back as a formula, with the formula
26
39
  * editor's reference picking and token coloring once the `=` is typed.
40
+ *
41
+ * The operand reaches the condition when the edit is DONE — Enter, Tab, a blur to another field,
42
+ * the ✓, or the editor's Save — not per keystroke. Every prefix of `=NOW()` is a formula that
43
+ * evaluates to an error, and a rule that is re-evaluated on each of them warns on each of them;
44
+ * `09/2` is a date, but not the one being typed.
27
45
  */
28
46
  export declare const ScalarOption: import('react').NamedExoticComponent<ScalarOptionProps>;
29
47
  //# sourceMappingURL=ScalarOption.d.ts.map
@@ -1,7 +1,6 @@
1
1
  export * from './FindReplaceWindow';
2
2
  export * from './SortDialog';
3
3
  export * from './HyperlinkDialog';
4
- export * from './CommentsDialog';
5
4
  export * from './NamedReferenceDialog';
6
5
  export * from './InsertFunctionDialog';
7
6
  export * from './ShortcutKeysPanel';
@@ -23,9 +23,9 @@ export interface FilterListProps extends React.HTMLAttributes<HTMLDivElement> {
23
23
  * the other columns' — one Promise, one undo step.
24
24
  *
25
25
  * @remarks
26
- * Interim (PLAN-DROPDOWN Phase D rewrites the whole menu on the condition editor): the values come
27
- * from a walk of the column ({@link readColumnItems}) and the condition holds raw values, as the
28
- * `InSet` operator compares them today.
26
+ * Interim (PLAN-DROPDOWN Phase D rewrites the whole menu on the condition editor). The values are
27
+ * the filter's own ({@link IFilter.getItems}), listed once they arrive, and the condition holds
28
+ * their texts.
29
29
  */
30
30
  export declare const FilterList: React.ForwardRefExoticComponent<Omit<FilterListProps, "ref"> & React.RefAttributes<IFilterListElement>>;
31
31
  //# sourceMappingURL=FilterList.d.ts.map
@@ -131,6 +131,12 @@ export interface FormulaFieldProps extends FormControlProps {
131
131
  * {@link allowMulti} — see `UseFormulaInputOptions.allowCrossSheet`.
132
132
  */
133
133
  allowCrossSheet?: boolean;
134
+ /**
135
+ * Whether the field must hold a value. Default `false`: empty text is the cleared value (`null`).
136
+ * `true` makes empty text an error, so it is never committed — see
137
+ * `UseFormulaInputOptions.required`.
138
+ */
139
+ required?: boolean;
134
140
  /**
135
141
  * Field label. Default `"Formula"` (`'reference'` grammar: `"Range"`).
136
142
  *
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { FormatPanelProps } from './FormatPanelParts';
3
2
  /**
4
3
  * The **Alignment** tab of the format pane: where text sits in the cell, how it behaves when it
@@ -10,5 +9,5 @@ import { FormatPanelProps } from './FormatPanelParts';
10
9
  * button, because both read the same command state. Only the two numeric fields (indent, custom
11
10
  * angle) write the model directly: a spinner is a poor fit for a command's fire-once shape.
12
11
  */
13
- export declare const AlignmentPanel: React.MemoExoticComponent<(props: FormatPanelProps) => React.JSX.Element>;
12
+ export declare const AlignmentPanel: import('react').MemoExoticComponent<(props: FormatPanelProps) => import("react").JSX.Element>;
14
13
  //# sourceMappingURL=AlignmentPanel.d.ts.map
@@ -10,8 +10,8 @@ import { TranslateFn } from '@sheetxl/utils-react';
10
10
  *
11
11
  * The order is the tie-break for a pointer sitting exactly where two lines cross, so the OUTER
12
12
  * edges come first — a click on the left edge at its midpoint is aimed at the block's outline, not
13
- * at the inner rule that happens to end there — and the dead center of the diagram, where only the
14
- * two inner rules meet, belongs to the inside-horizontal one.
13
+ * at the inner rule that happens to end there. The crossing of the two inner rules is not a tie at
14
+ * all: it is its own target (see {@link edgesAt}).
15
15
  */
16
16
  export declare const PREVIEW_EDGES: readonly IBorders.Edge[];
17
17
  /** The strokes currently drawn on a block, by edge. An absent entry means "no line here". */
@@ -19,7 +19,7 @@ export type BorderEdges = Partial<Record<IBorders.Edge, IBorders.StrokePropertie
19
19
  /** Localized name for a border edge; literal `t()` pairs keep the extractor able to see them. */
20
20
  export declare function edgeLabel(t: TranslateFn, edge: IBorders.Edge): string;
21
21
  /**
22
- * The edge a pointer is aimed at, or `null` for none.
22
+ * The edges a pointer is aimed at: one line, both inner rules at their crossing, or none.
23
23
  *
24
24
  * @param x Pointer position relative to the diagram's top-left corner, in CSS px.
25
25
  * @param y Pointer position relative to the diagram's top-left corner, in CSS px.
@@ -29,15 +29,19 @@ export declare function edgeLabel(t: TranslateFn, edge: IBorders.Edge): string;
29
29
  * with no inside, and an edge that cannot be drawn must not swallow a click aimed past it.
30
30
  *
31
31
  * @remarks
32
- * Nearest line wins, which is the only rule that stays honest where two of them cross. Fixed
33
- * rectangles cannot be: the inside-horizontal and inside-vertical zones necessarily overlap in the
34
- * middle, whichever paints later takes the whole square, and clicking the horizontal rule anywhere
35
- * near the center of the diagram toggles the vertical one instead.
32
+ * Nearest line wins, which is the only rule that stays honest where an inner rule meets the
33
+ * outline. Fixed rectangles cannot be: their zones overlap, and whichever paints later takes the
34
+ * whole square.
35
+ *
36
+ * The middle is the exception. Where the two inner rules cross, the pointer is within reach of
37
+ * both and a pixel either way would flip between them, so that square is neither: it aims at the
38
+ * pair, which is the 'Inside' border. Only when both can be drawn — with one inner rule there is
39
+ * no crossing, and the middle is just that rule.
36
40
  *
37
41
  * Exported because this is the part worth testing directly — jsdom lays nothing out, so a mounted
38
42
  * diagram cannot be asked where its lines are.
39
43
  */
40
- export declare function edgeAt(x: number, y: number, width: number, height: number, isAvailable: (edge: IBorders.Edge) => boolean): IBorders.Edge | null;
44
+ export declare function edgesAt(x: number, y: number, width: number, height: number, isAvailable: (edge: IBorders.Edge) => boolean): readonly IBorders.Edge[];
41
45
  export interface BorderPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
42
46
  /**
43
47
  * What is drawn on each edge of the selected block right now.
@@ -51,8 +55,13 @@ export interface BorderPreviewProps extends React.HTMLAttributes<HTMLDivElement>
51
55
  edges: BorderEdges;
52
56
  /** Mints the per-cell border the renderer draws. */
53
57
  createBorder: (properties: Partial<IBorders.Properties>) => IBorders | null;
54
- /** Toggle one edge with the panel's active pen. */
55
- onToggleEdge: (edge: IBorders.Edge) => void;
58
+ /**
59
+ * Toggle edges with the panel's active pen, as one edit.
60
+ *
61
+ * @remarks
62
+ * One edge for a line; both inner rules for the middle of the diagram, where they cross.
63
+ */
64
+ onToggleEdges: (edges: readonly IBorders.Edge[]) => void;
56
65
  /**
57
66
  * Edges this selection cannot draw — the inner rules, on a selection with no inside.
58
67
  *
@@ -73,9 +82,10 @@ export interface BorderPreviewProps extends React.HTMLAttributes<HTMLDivElement>
73
82
  * half of what a border edit is about. The lines are a real {@link StaticBorderRenderer} fed the
74
83
  * selection's own strokes, so what you click is what the grid will draw.
75
84
  *
76
- * Aiming is by DISTANCE rather than by zone (see {@link edgeAt}), and the feedback is the edge
77
- * itself: hovering lights the line a click would toggle, along its whole length. Shading a
78
- * quadrant says "somewhere around here"; a lit line says which line.
85
+ * Aiming is by DISTANCE rather than by zone (see {@link edgesAt}), and the feedback is the edge
86
+ * itself: hovering lights the line a click would toggle, along its whole length — both inner
87
+ * rules, over their crossing. Shading a quadrant says "somewhere around here"; a lit line says
88
+ * which line.
79
89
  */
80
90
  export declare const BorderPreview: {
81
91
  (props: BorderPreviewProps): React.ReactElement;
@@ -1,4 +1,4 @@
1
- import { IBorders, IWorkbook, ISheet, ICell, IStyle, IStyleCollection, IColor } from '@sheetxl/sdk';
1
+ import { IBorders, IWorkbook, ISheet, ICell, ICellRange, IStyle, IStyleCollection, IColor } from '@sheetxl/sdk';
2
2
  /**
3
3
  * Everything the format panels need from the workbook, resolved from the live selection.
4
4
  *
@@ -40,6 +40,7 @@ export interface FormatSelection {
40
40
  *
41
41
  * @param update The style delta, or a SEQUENCE of them applied in order.
42
42
  * @param description A `messageKey('op.…')` naming the step in the undo history.
43
+ * @param autoFit How the selection is fit afterwards, when the default style fit is not it.
43
44
  *
44
45
  * @remarks
45
46
  * A sequence is how a caller expresses REPLACE rather than merge. A style delta merges into
@@ -47,7 +48,7 @@ export interface FormatSelection {
47
48
  * one standing — there is no value for "no color" to write. Erasing the edge first and drawing
48
49
  * it second says the whole thing, and the batch keeps it one step in the undo history.
49
50
  */
50
- applyStyle: (update: IStyle.Update | readonly IStyle.Update[], description?: string) => void;
51
+ applyStyle: (update: IStyle.Update | readonly IStyle.Update[], description?: string, autoFit?: ICellRange.AutoFitOptions) => void;
51
52
  /** Mints a detached cell for the previews (theme + named styles resolve against the workbook). */
52
53
  createCell: (update: ICell.Update) => ICell | null;
53
54
  /** Mints a detached border for the border diagram, the way the border picker's context does. */
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Commits whatever a field still holds onto the editor's draft.
3
+ *
4
+ * @returns `false` to refuse the save — the field holds text it cannot commit — which leaves the
5
+ * editor open on it.
6
+ */
7
+ export type EditorCommit = () => boolean;
8
+ /**
9
+ * Where a field inside an {@link EditorPanel} registers to be committed when Save is pressed.
10
+ */
11
+ export interface EditorCommits {
12
+ /**
13
+ * @returns An unregister callback.
14
+ */
15
+ register(commit: EditorCommit): () => void;
16
+ }
17
+ /**
18
+ * Provided by {@link EditorPanel}; `null` outside of one.
19
+ */
20
+ export declare const EditorCommitContext: import('react').Context<EditorCommits | null>;
21
+ /**
22
+ * Has the enclosing {@link EditorPanel} commit this field before it saves.
23
+ *
24
+ * @remarks
25
+ * For a field that commits on done rather than per change. Its commit points are its own keys, its
26
+ * ✓ and a blur to another field; Save is a button, which takes focus without any of them, so text
27
+ * typed but not yet committed would never reach the draft the save reads.
28
+ *
29
+ * Does nothing outside an editor — the same field on a card has no Save to answer to.
30
+ */
31
+ export declare const useEditorCommit: (commit: EditorCommit) => void;
32
+ //# sourceMappingURL=EditorCommit.d.ts.map
@@ -3,8 +3,7 @@ import { ItemMessageKeys } from './ItemsDescriptor';
3
3
  export interface EditorProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * The feature's catalog keys for the cancel/save labels.
6
- */
7
- /**
6
+ *
8
7
  * `Required`, because these are the editor's own buttons: a list that reaches this panel at all
9
8
  * is an authorable one, and an authorable list supplies them (see `ItemsDescriptor.createDraft`).
10
9
  */
@@ -178,6 +178,19 @@ export interface ItemsDescriptor<T = any, D = T> {
178
178
  * {@link save} reads it (hashing a password, say).
179
179
  */
180
180
  beforeSave?(draft: D): Promise<void> | void;
181
+ /**
182
+ * Whether the draft can be saved as it is.
183
+ *
184
+ * @returns A message key naming the problem, or `null`. The problem is shown and the editor stays
185
+ * open on the draft.
186
+ *
187
+ * @remarks
188
+ * Asked after the editor's fields have committed what they still held and after
189
+ * {@link beforeSave}, so it reads the draft as {@link save} would. For what a single field
190
+ * cannot take, the field refuses the save itself (`useEditorCommit`); this is for what only the
191
+ * whole draft can answer — bounds the wrong way around, a condition missing an operand.
192
+ */
193
+ validate?(draft: D): string | null;
181
194
  /**
182
195
  * Persists the draft.
183
196
  *
@@ -2,5 +2,6 @@ export * from './ItemsDescriptor';
2
2
  export * from './ItemsPanel';
3
3
  export * from './ItemCard';
4
4
  export * from './EditorPanel';
5
+ export * from './EditorCommit';
5
6
  export * from './SortableCards';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -30,6 +30,8 @@ export interface CommandsWrapperProps extends Omit<StudioProps, 'workbook'> {
30
30
  isDirty: () => boolean;
31
31
  /** Receives the studio's Save, for `IStudioAttributes.save`. */
32
32
  refSave?: StudioIODeps['refSave'];
33
+ /** The studio root element; the target of the fullscreen toggle. */
34
+ host?: HTMLElement | null;
33
35
  }
34
36
  /**
35
37
  * Because snackbar is configured using a context provider we have to create
@@ -15,6 +15,13 @@ export interface StudioCommandProviderProps {
15
15
  isDirty?: () => boolean;
16
16
  /** Receives the studio's Save, for {@link IStudioAttributes.save}. */
17
17
  refSave?: StudioIODeps['refSave'];
18
+ /**
19
+ * The element the fullscreen toggle makes fullscreen — the studio root, so the studio fills the screen
20
+ * rather than the host page.
21
+ *
22
+ * @defaultValue `document.documentElement`
23
+ */
24
+ fullscreenTarget?: HTMLElement | null;
18
25
  }
19
26
  /**
20
27
  * **Studio command bridge** — the studio slice. Registers the studio catalog + contributes help /
@@ -26,7 +26,7 @@ export interface ContributeStudioCommandsHandlers {
26
26
  * the {@link Command.CommandContribution} handle, so `contribution.remove()` tears it down.
27
27
  */
28
28
  export declare function contributeStudioCommands(contribution: Command.CommandContribution, handlers: ContributeStudioCommandsHandlers): void;
29
- /** The resolved appearance state the bridge threads in (from `usePersistenceState` + theme hooks). */
29
+ /** The resolved appearance state the bridge threads in (from `usePersistentState` + theme hooks). */
30
30
  export interface StudioAppearanceState {
31
31
  /** The persisted mode override (`null` = follow system). */
32
32
  mode: ThemeMode | null;
@@ -43,7 +43,7 @@ export interface StudioAppearanceState {
43
43
  /**
44
44
  * Contribute the studio **appearance** toggles — light/dark mode, system-default, dark-grid, dark-images.
45
45
  * Their `state`/`label`/`icon` are dynamic, so this re-runs when the appearance state changes (the bridge
46
- * owns the `usePersistenceState` and re-invokes on change). Ported from `useStudioCommands` L569-600.
46
+ * owns the `usePersistentState` and re-invokes on change). Ported from `useStudioCommands` L569-600.
47
47
  */
48
48
  export declare function contributeStudioAppearance(contribution: Command.CommandContribution, s: StudioAppearanceState): void;
49
49
  /** The UI-language state the bridge threads in (from `DefaultLanguagePackService`). */
@@ -197,7 +197,7 @@ export interface StudioProps extends Omit<PaperProps, 'autoFocus' | 'ref'> {
197
197
  * @remarks
198
198
  * This is *config*, not state. Light/dark **mode** and the dark-grid/dark-image toggles are self-managed by
199
199
  * Studio as persisted preferences (see {@link @sheetxl/react!ThemeStateKey}), driven by the surrounding
200
- * `PersistenceStateProvider` — not by props. A wrapping `TokenThemeProvider` layers token overrides on top.
200
+ * `PersistentStateProvider` — not by props. A wrapping `TokenThemeProvider` layers token overrides on top.
201
201
  */
202
202
  muiTheme?: ThemeOptions;
203
203
  /**
@@ -29,7 +29,7 @@ export interface StudioSplitPaneProps extends React.HTMLAttributes<HTMLDivElemen
29
29
  */
30
30
  position?: number | string | Partial<Record<SplitPaneLayoutKey, number>>;
31
31
  /**
32
- * When set, the split position is self-managed and persisted under this key (via `usePersistenceState`
32
+ * When set, the split position is self-managed and persisted under this key (via `usePersistentState`
33
33
  * against the surrounding persistence store) as a per-slot map. The resized position of each layout slot
34
34
  * (horizontal vs vertical split, and eventually before/after side) is remembered independently. Any slot
35
35
  * not yet resized is seeded from {@link position}; {@link onPositionChange} still fires if provided.