@sheetxl/studio-mui 0.8.0-beta.1 → 0.8.0-beta.3

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 (195) hide show
  1. package/browser/cjs/3k_KqDFr-AybPztc.cjs +5 -0
  2. package/browser/cjs/{zQsyZpeXAvcVXJMs.cjs → 3uprnzi2l0iT17Dg.cjs} +1 -1
  3. package/browser/cjs/B9GcCj7sj8XdjPZF.cjs +1 -0
  4. package/browser/cjs/{CJLwX_A3y3TQUmzj.cjs → BGvoJjUs21bbuE1i.cjs} +1 -1
  5. package/browser/cjs/{CYxc8vnRi8dNpDPk.cjs → BHb7TnK1NmimV4OX.cjs} +1 -1
  6. package/browser/cjs/BJ-wdkCaXqJaejKf.cjs +1 -0
  7. package/browser/cjs/BQMCM3iFn4MNWAkB.cjs +1 -0
  8. package/browser/cjs/BXkdjAb4jpTr412c.cjs +1 -0
  9. package/browser/cjs/Bc-YisjBtD56vBAW.cjs +1 -0
  10. package/browser/cjs/Bi26L7L89ZK_y5Pk.cjs +1 -0
  11. package/browser/cjs/CucKgy044KxMHXrx.cjs +13 -0
  12. package/browser/cjs/Cy_XmYq6BsWmCXkk.cjs +3 -0
  13. package/browser/cjs/Dq9lIOzvxW3EKYkD.cjs +8 -0
  14. package/browser/cjs/M0_dvdYwhikqP9kg.cjs +2 -0
  15. package/browser/cjs/QI6GKw7uo1f8gY8C.cjs +1 -0
  16. package/browser/cjs/eCw4rAEIYE3BftpG.cjs +1 -0
  17. package/browser/cjs/iFPhqab5w95hHEsT.cjs +1 -0
  18. package/browser/cjs/index.cjs +2 -2
  19. package/browser/esm/{zWTZ8BvT4hjgC2ua.mjs → 5g7MBAjbFzuopMX2.mjs} +2 -2
  20. package/browser/esm/B1W2xsRdzsYUrUHN.mjs +12903 -0
  21. package/browser/esm/{UJOXCQv6KrG1gY3l.mjs → B4D1LSp8TE_B0AMm.mjs} +8 -16
  22. package/browser/esm/{Bz5LiUe3SZ8g42Ia.mjs → B52mSQ33rrDgVfpp.mjs} +1 -1
  23. package/browser/esm/{DNDrQKMTzKzNMjl-.mjs → BPrlXHjf0rCkbBBI.mjs} +1 -1
  24. package/browser/esm/BZd916TsMZ7YvxWP.mjs +293 -0
  25. package/browser/esm/{Cd6n1XUgF0VItpkH.mjs → BaEXUwMO4qxI8cAG.mjs} +1 -1
  26. package/browser/esm/{CDU0rqpLNVtMLI-f.mjs → BbIR6fcRDFkeZXY0.mjs} +1 -1
  27. package/browser/esm/{CVBub6pgTsJzCc5m.mjs → BmThVkDnqURs7csb.mjs} +2100 -2214
  28. package/browser/esm/{CVfuCNRpODUw04IH.mjs → Bz1JPslneg_PywLn.mjs} +1 -1
  29. package/browser/esm/{rU8xNPVQtDSnujM-.mjs → CBtvZnCU5MNRuW6b.mjs} +3 -3
  30. package/browser/esm/CWSv0l0QyooaSl9L.mjs +268 -0
  31. package/browser/esm/{BUGepznywvV0tUjW.mjs → Cq9FaaUpYJPogPlO.mjs} +2 -2
  32. package/browser/esm/{3ydDykDMtDYbfVVn.mjs → D0TdGLsNoKJ8y8nS.mjs} +113 -111
  33. package/browser/esm/{CBU3LgLYmqtQjJbu.mjs → D5VhIdFEqZBP23Ch.mjs} +1 -1
  34. package/browser/esm/{BoLxSRdEWt-Yg2RI.mjs → DAmyMhko6L63rwJo.mjs} +130 -103
  35. package/browser/esm/{Cj2pgCNqBCGl4rTX.mjs → DKyW2a-ZhqkFjZvH.mjs} +569 -540
  36. package/browser/esm/DSAOtFgAoMMKXSJb.mjs +152 -0
  37. package/browser/esm/De_bbgjFGMBk8KXa.mjs +117 -0
  38. package/browser/esm/Dkw9Yr0Bp5RI5pRw.mjs +222 -0
  39. package/browser/esm/MplcRTnOYfsuQGe3.mjs +410 -0
  40. package/browser/esm/{DMLXV4EKl1NCp_jk.mjs → U9pABiBV0P__iZJE.mjs} +3 -3
  41. package/browser/esm/{ChwS_ougBsogOEsP.mjs → _7FBRywOYc4gCFK2.mjs} +2 -2
  42. package/browser/esm/cLX3kRi9vDkGiZwr.mjs +115 -0
  43. package/browser/esm/index.mjs +466 -135
  44. package/browser/esm/{BZBJG2tDdD3-VujP.mjs → krJU2tCMk9QwcRcw.mjs} +195 -174
  45. package/licenses/dependencies.txt +73 -73
  46. package/node/esm/BSj2vMFtYCJk4miD.mjs +4462 -0
  47. package/node/esm/{BwZcoHDBmLPIVOT5.mjs → Byoa9Sx18Y73xJBM.mjs} +1 -1
  48. package/node/esm/{C-boHCnJditFzng3.mjs → C0yEFO9L8odxQW-z.mjs} +32 -40
  49. package/node/esm/{CHi3AuWEwEPOg9IZ.mjs → C6ookLy8qjozoGUP.mjs} +1 -1
  50. package/node/esm/{DXZrzWee8K5FPOW1.mjs → CF-mBw8E2TnnbVJp.mjs} +2 -2
  51. package/node/esm/CQtseVjtpzUKq41p.mjs +294 -0
  52. package/node/esm/{BhqI3pQFkV8K_612.mjs → C_xnlCmxuBdmK2nV.mjs} +1 -1
  53. package/node/esm/CvZ05tWUwCH6MJas.mjs +268 -0
  54. package/node/esm/{yCHAZKxJR7qY_ySy.mjs → D1uCpJvXqZ16A3-X.mjs} +143 -141
  55. package/node/esm/{DM7K7-284z-PczVz.mjs → DbzH9CwsCrtCs4Ug.mjs} +1 -1
  56. package/node/esm/{Qpuqm6xBr_da38Ht.mjs → DdBJbvx8UwH8CmkE.mjs} +163 -135
  57. package/node/esm/DlNtuQ_K-rgj0iJU.mjs +116 -0
  58. package/node/esm/Dsc5FSbIPxmlRzwV.mjs +414 -0
  59. package/node/esm/index.mjs +7716 -4114
  60. package/node/esm/k8Q5jiL-22BAHe4i.mjs +115 -0
  61. package/node/esm/{CUMKTjYv6VTkcWYi.mjs → oLdQArapyVclkMMy.mjs} +1 -1
  62. package/node/esm/{BA7VzUQ2sKRLTZ5c.mjs → pZBq3MVKHmZiBS8U.mjs} +1 -1
  63. package/package.json +9 -9
  64. package/resources/locales/de/groups.cmd.json +24 -6
  65. package/resources/locales/de/studio.cmd.json +18 -1
  66. package/resources/locales/de/ui.msg.json +251 -30
  67. package/resources/locales/en/groups.cmd.json +24 -6
  68. package/resources/locales/en/studio.cmd.json +18 -1
  69. package/resources/locales/en/ui.msg.json +202 -30
  70. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +11 -1
  71. package/types/src/anchorItems/AnchorItemsPanel.d.ts +14 -0
  72. package/types/src/anchorItems/AnchoredRangeField.d.ts +40 -0
  73. package/types/src/anchorItems/index.d.ts +1 -0
  74. package/types/src/border/BorderPopupButton.d.ts +6 -6
  75. package/types/src/border/BorderStylePopupButton.d.ts +3 -3
  76. package/types/src/border/BorderTemplateIcon.d.ts +24 -0
  77. package/types/src/border/index.d.ts +1 -0
  78. package/types/src/color/ColorPanel.d.ts +8 -2
  79. package/types/src/color/ColorPopupButton.d.ts +2 -1
  80. package/types/src/command/NumberFormatQuickButtons.d.ts +32 -0
  81. package/types/src/conditions/BetweenOption.d.ts +1 -1
  82. package/types/src/conditions/ConditionEditor.d.ts +6 -1
  83. package/types/src/conditions/ConditionUtils.d.ts +31 -0
  84. package/types/src/conditions/DateTimeOption.d.ts +4 -4
  85. package/types/src/conditions/ExpressionOption.d.ts +6 -6
  86. package/types/src/conditions/ListSourceOption.d.ts +31 -0
  87. package/types/src/conditions/ScalarOption.d.ts +6 -6
  88. package/types/src/conditions/index.d.ts +1 -1
  89. package/types/src/conditions/useFormulaOption.d.ts +54 -0
  90. package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +7 -1
  91. package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -2
  92. package/types/src/dataValidation/DataValidationEditorPanel.d.ts +9 -2
  93. package/types/src/dataValidation/DataValidationIcon.d.ts +22 -0
  94. package/types/src/dataValidation/DataValidationTitle.d.ts +13 -0
  95. package/types/src/dialog/FillSeriesDialog.d.ts +16 -0
  96. package/types/src/dialog/TableNewDialog.d.ts +1 -4
  97. package/types/src/dialog/index.d.ts +0 -1
  98. package/types/src/externalLink/ExternalLinkCardBody.d.ts +9 -0
  99. package/types/src/externalLink/ExternalLinkChip.d.ts +18 -0
  100. package/types/src/externalLink/ExternalLinkLocation.d.ts +18 -0
  101. package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +18 -0
  102. package/types/src/externalLink/ExternalLinksPanel.d.ts +11 -0
  103. package/types/src/externalLink/ExternalLinksPlugin.d.ts +5 -0
  104. package/types/src/externalLink/ExternalLinksTaskPane.d.ts +19 -0
  105. package/types/src/externalLink/index.d.ts +8 -0
  106. package/types/src/fill/GradientEditor.d.ts +39 -0
  107. package/types/src/fill/PatternPopupButton.d.ts +26 -0
  108. package/types/src/fill/PatternSwatch.d.ts +53 -0
  109. package/types/src/fill/index.d.ts +4 -0
  110. package/types/src/filter/FilterList.d.ts +9 -6
  111. package/types/src/form/FormulaField.d.ts +25 -2
  112. package/types/src/form/InputField.d.ts +30 -0
  113. package/types/src/format/AlignmentPanel.d.ts +14 -0
  114. package/types/src/format/BorderPanel.d.ts +22 -0
  115. package/types/src/format/BorderPreview.d.ts +84 -0
  116. package/types/src/format/FillPanel.d.ts +25 -0
  117. package/types/src/format/FontPanel.d.ts +12 -0
  118. package/types/src/format/FormatCellPreview.d.ts +35 -0
  119. package/types/src/format/FormatPanelParts.d.ts +83 -0
  120. package/types/src/format/FormatPlugin.d.ts +11 -0
  121. package/types/src/format/FormatTaskPane.d.ts +39 -0
  122. package/types/src/format/NumberFormatOption.d.ts +43 -0
  123. package/types/src/{numberFormat → format}/NumberFormatPanel.d.ts +20 -0
  124. package/types/src/format/index.d.ts +13 -0
  125. package/types/src/format/useFormatSelection.d.ts +92 -0
  126. package/types/src/index.d.ts +3 -1
  127. package/types/src/itemsPanel/EditorPanel.d.ts +5 -1
  128. package/types/src/itemsPanel/ItemCard.d.ts +10 -1
  129. package/types/src/itemsPanel/ItemsDescriptor.d.ts +55 -19
  130. package/types/src/itemsPanel/ItemsPanel.d.ts +9 -0
  131. package/types/src/named/NamedDetailsPanel.d.ts +9 -2
  132. package/types/src/named/NamedDetailsTaskPane.d.ts +3 -2
  133. package/types/src/named/NamedEditorPanel.d.ts +1 -1
  134. package/types/src/named/NamedExpressionField.d.ts +32 -0
  135. package/types/src/named/NamedKindChip.d.ts +38 -0
  136. package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +6 -0
  137. package/types/src/protectedRange/ProtectedRangeDraft.d.ts +22 -0
  138. package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +0 -14
  139. package/types/src/protectedRange/index.d.ts +2 -1
  140. package/types/src/protection/ManageProtectionTaskPane.d.ts +29 -0
  141. package/types/src/protection/PasswordDialog.d.ts +32 -0
  142. package/types/src/protection/PasswordField.d.ts +35 -0
  143. package/types/src/protection/ProtectedCellsPanel.d.ts +20 -0
  144. package/types/src/protection/ProtectionPlugin.d.ts +11 -0
  145. package/types/src/protection/SheetProtectionPanel.d.ts +35 -0
  146. package/types/src/protection/WorkbookProtectionPanel.d.ts +34 -15
  147. package/types/src/protection/WorkbookProtectionTab.d.ts +22 -0
  148. package/types/src/protection/index.d.ts +7 -1
  149. package/types/src/studio/CommandsWrapper.d.ts +3 -0
  150. package/types/src/studio/EagerStudio.d.ts +14 -1
  151. package/types/src/studio/StudioCommandProvider.d.ts +3 -0
  152. package/types/src/studio/StudioCommands.d.ts +38 -2
  153. package/types/src/studio/StudioProps.d.ts +41 -0
  154. package/types/src/studio/splitStudioProps.d.ts +7 -0
  155. package/types/src/studio/useStudioApp.d.ts +20 -1
  156. package/types/src/template/TemplateCommands.d.ts +29 -0
  157. package/types/src/template/TemplateDialog.d.ts +19 -0
  158. package/types/src/template/TemplatePanel.d.ts +50 -0
  159. package/types/src/template/TemplateSearchField.d.ts +13 -0
  160. package/types/src/template/WelcomeDialog.d.ts +29 -0
  161. package/types/src/template/index.d.ts +3 -0
  162. package/types/src/template/useTemplateCatalog.d.ts +69 -0
  163. package/types/src/workbook/DefaultRenderers.d.ts +2 -0
  164. package/types/src/workbook/FillMenu.d.ts +21 -0
  165. package/types/src/workbook/index.d.ts +1 -0
  166. package/browser/cjs/B_D3JKseVvpRyX-E.cjs +0 -1
  167. package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +0 -2
  168. package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +0 -2
  169. package/browser/cjs/Bte6P3MhSjajJmmY.cjs +0 -7
  170. package/browser/cjs/CZm1jVZaHQ246prW.cjs +0 -1
  171. package/browser/cjs/Cm1APq2MraYNNhyI.cjs +0 -1
  172. package/browser/cjs/DO8V31Z1ewgMA1di.cjs +0 -5
  173. package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +0 -1
  174. package/browser/cjs/IASAYG6qgv7lJY7y.cjs +0 -1
  175. package/browser/cjs/UnMhi28mbvLiOXQe.cjs +0 -1
  176. package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +0 -1
  177. package/browser/cjs/w2GjebPlOFv3pCbm.cjs +0 -1
  178. package/browser/cjs/z0rB4fK6X1M6PpVD.cjs +0 -11
  179. package/browser/esm/BuY3uV47Bwbqpasq.mjs +0 -219
  180. package/browser/esm/CAs1MWvJTcRfJy26.mjs +0 -217
  181. package/browser/esm/C_XvSsQ9BVdHffCO.mjs +0 -47
  182. package/browser/esm/FT29q8yNwsEpVZjt.mjs +0 -9257
  183. package/browser/esm/Hb1rlHT4tE5hLcjM.mjs +0 -82
  184. package/browser/esm/s46El7mT6oKLSnYB.mjs +0 -411
  185. package/node/esm/9FY82fj1R1c-AczW.mjs +0 -47
  186. package/node/esm/DxXM8qHi0Oz4Zovl.mjs +0 -4575
  187. package/node/esm/sQt2wWGTRLzqeJdG.mjs +0 -82
  188. package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +0 -32
  189. package/types/src/conditions/InSetOption.d.ts +0 -37
  190. package/types/src/dialog/NumberFormatDialog.d.ts +0 -12
  191. package/types/src/numberFormat/NumberFormatTaskPane.d.ts +0 -12
  192. package/types/src/numberFormat/index.d.ts +0 -8
  193. package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +0 -3
  194. package/types/src/protectedRange/ProtectedRangePlugin.d.ts +0 -2
  195. package/types/src/protection/WorkbookProtectionDialog.d.ts +0 -23
@@ -1,28 +1,42 @@
1
1
  import { default as React } from 'react';
2
2
  export declare namespace WorkbookProtectionPanel {
3
3
  /**
4
- * What the panel edits.
4
+ * What the panel renders.
5
5
  *
6
6
  * @remarks
7
- * A password of `null` means **unchanged** — the field is showing {@link SENTINEL} and the caller
8
- * should keep what it already has. An empty string means the user cleared it. Any other string is
9
- * a new password.
7
+ * Booleans only — the panel never holds a password. Encryption's lives on the io handle and
8
+ * structure's was only ever a hash, and neither can be read back, so "is there one" is the whole
9
+ * of what a UI can honestly show. Typing happens in {@link PasswordDialog}.
10
10
  */
11
11
  interface Value {
12
- /** Encrypt the file itself, so its contents cannot be read without the password. */
13
- encrypt: boolean;
14
- encryptPassword: string | null;
12
+ /** The file is encrypted: its contents cannot be read without the password. */
13
+ hasEncryptPassword: boolean;
15
14
  /** Lock the workbook's structure — a gate the UI honours; it does not hide the data. */
16
15
  structure: boolean;
17
- structurePassword: string | null;
16
+ hasStructurePassword: boolean;
18
17
  lockStructure: boolean;
19
18
  lockWindows: boolean;
19
+ /**
20
+ * Whether the structure locks can be edited.
21
+ *
22
+ * @remarks
23
+ * `false` on a protected workbook: the model refuses option changes until it is unprotected,
24
+ * which is Excel's answer too.
25
+ */
26
+ locksEditable: boolean;
20
27
  }
21
28
  interface Props {
22
29
  value: Value;
23
- onChange(value: Value): void;
24
- /** Reports whether the current input can be committed (passwords present and matching). */
25
- onValidityChange?(valid: boolean): void;
30
+ /** Every callback commits — there is no Apply. */
31
+ onEncryptPassword(password: string, current?: string): void;
32
+ onEncryptPasswordClear(): void;
33
+ onStructureChange(enabled: boolean): void;
34
+ onStructurePassword(password: string, current?: string): void;
35
+ onStructurePasswordClear(): void;
36
+ onLocksChange(locks: {
37
+ lockStructure: boolean;
38
+ lockWindows: boolean;
39
+ }): void;
26
40
  sx?: any;
27
41
  }
28
42
  }
@@ -30,8 +44,8 @@ export declare namespace WorkbookProtectionPanel {
30
44
  * Edits a workbook's two, genuinely different, protections in one place.
31
45
  *
32
46
  * @remarks
33
- * Presentational only — no model or IO access — so the same panel serves a dialog now and a task
34
- * pane later (the {@link NumberFormatPanel} arrangement).
47
+ * Presentational — no model or IO access — so the layout stays testable on its own and the tab
48
+ * around it owns every write.
35
49
  *
36
50
  * The two halves are grouped together because a user thinking "protect this workbook" means either,
37
51
  * and split visibly because they are not the same thing at all:
@@ -43,8 +57,13 @@ export declare namespace WorkbookProtectionPanel {
43
57
  * which puts them in unrelated parts of its UI and reliably misleads people into thinking
44
58
  * "Protect Workbook" encrypts. Grouping by intent and labelling by effect is the fix.
45
59
  *
46
- * They also commit differently, which the host should surface: structure applies immediately;
47
- * encryption is only realized on the next save.
60
+ * Encryption has no switch of its own: it IS its password, so setting one encrypts and clearing it
61
+ * decrypts. Structure keeps its switch because it can be protected without a password.
62
+ *
63
+ * Nothing here has an Apply button, for the same reason the Sheet tab does not: every control is
64
+ * one unambiguous act, and a pane is not a dialog. Encryption still only reaches the FILE on the
65
+ * next save — but the intent is recorded the moment it is given, and an Apply button never changed
66
+ * that.
48
67
  */
49
68
  export declare const WorkbookProtectionPanel: React.NamedExoticComponent<WorkbookProtectionPanel.Props & React.RefAttributes<HTMLDivElement>>;
50
69
  export default WorkbookProtectionPanel;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { IWorkbook } from '@sheetxl/sdk';
3
+ export interface WorkbookProtectionTabProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** The workbook whose protection is edited. */
5
+ workbook: IWorkbook;
6
+ }
7
+ /**
8
+ * The **Workbook** tab of Manage Protection — {@link WorkbookProtectionPanel} bound to the model.
9
+ *
10
+ * @remarks
11
+ * No Apply button, for the same reason the Sheet tab has none: every control is one unambiguous act,
12
+ * and a pane is not a dialog. Encryption still only reaches the FILE on the next save — but that is
13
+ * about when bytes are written, not about when the intent is recorded, and `origin.setPassword` has
14
+ * always recorded it the moment it is given. An Apply button in front of that only added a step.
15
+ *
16
+ * The two halves commit through different objects: structure is a model change
17
+ * (`IWorkbookProtection`, effective at once), encryption is a property of the io handle. See
18
+ * `PROTECTION-DESIGN.md` §5g.
19
+ */
20
+ export declare const WorkbookProtectionTab: React.NamedExoticComponent<WorkbookProtectionTabProps & React.RefAttributes<HTMLDivElement>>;
21
+ export default WorkbookProtectionTab;
22
+ //# sourceMappingURL=WorkbookProtectionTab.d.ts.map
@@ -1,3 +1,9 @@
1
+ export * from './PasswordDialog';
2
+ export * from './PasswordField';
1
3
  export * from './WorkbookProtectionPanel';
2
- export * from './WorkbookProtectionDialog';
4
+ export * from './SheetProtectionPanel';
5
+ export * from './ProtectedCellsPanel';
6
+ export * from './WorkbookProtectionTab';
7
+ export * from './ManageProtectionTaskPane';
8
+ export * from './ProtectionPlugin';
3
9
  //# sourceMappingURL=index.d.ts.map
@@ -3,6 +3,7 @@ import { IWorkbook } from '@sheetxl/sdk';
3
3
  import { Command } from '@sheetxl/utils-react';
4
4
  import { WorkbookElementProps } from '@sheetxl/react';
5
5
  import { IDocumentTitleElement } from '../workbook';
6
+ import { StudioIODeps } from './StudioCommands';
6
7
  import { StudioProps } from './StudioProps';
7
8
  export interface CommandsWrapperProps extends Omit<StudioProps, 'workbook'> {
8
9
  /**
@@ -27,6 +28,8 @@ export interface CommandsWrapperProps extends Omit<StudioProps, 'workbook'> {
27
28
  refDocumentTitle: React.RefObject<IDocumentTitleElement | null>;
28
29
  /** Live unsaved-changes probe (read at click time); drives close/open confirm. */
29
30
  isDirty: () => boolean;
31
+ /** Receives the studio's Save, for `IStudioAttributes.save`. */
32
+ refSave?: StudioIODeps['refSave'];
30
33
  }
31
34
  /**
32
35
  * Because snackbar is configured using a context provider we have to create
@@ -1,5 +1,18 @@
1
1
  import { default as React } from 'react';
2
2
  import { StudioProps, IStudioElement } from './StudioProps';
3
- export declare const EagerStudio: React.NamedExoticComponent<StudioProps & React.RefAttributes<IStudioElement>>;
3
+ /**
4
+ * The studio's content, rendered into a root element owned by {@link Studio}.
5
+ *
6
+ * @remarks
7
+ * The root must exist before this (lazily loaded) module does, so the startup loading panel can live
8
+ * inside it and consumer `className` / `style` / `sx` apply to a single element from the first render.
9
+ */
10
+ export interface EagerStudioProps extends StudioProps {
11
+ /** The root element rendered by {@link Studio}; decorated with the {@link IStudioAttributes}. */
12
+ host: HTMLDivElement | null;
13
+ /** The per-instance theme scope class carried by {@link EagerStudioProps.host}. */
14
+ scopeClass: string;
15
+ }
16
+ export declare const EagerStudio: React.NamedExoticComponent<EagerStudioProps & React.RefAttributes<IStudioElement>>;
4
17
  export default EagerStudio;
5
18
  //# sourceMappingURL=EagerStudio.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { IWorkbook } from '@sheetxl/sdk';
3
3
  import { WorkbookInput } from '@sheetxl/react';
4
+ import { StudioIODeps } from './StudioCommands';
4
5
  /** Studio app-shell state the bridge threads into the file-I/O commands (from `CommandsWrapper`). */
5
6
  export interface StudioCommandProviderProps {
6
7
  children: ReactNode;
@@ -12,6 +13,8 @@ export interface StudioCommandProviderProps {
12
13
  workbookTitle?: string | null;
13
14
  /** Live unsaved-changes probe (read at click time) — drives close/open confirm. */
14
15
  isDirty?: () => boolean;
16
+ /** Receives the studio's Save, for {@link IStudioAttributes.save}. */
17
+ refSave?: StudioIODeps['refSave'];
15
18
  }
16
19
  /**
17
20
  * **Studio command bridge** — the studio slice. Registers the studio catalog + contributes help /
@@ -1,7 +1,8 @@
1
1
  import { RemoveListener } from '@sheetxl/utils';
2
- import { IWorkbook } from '@sheetxl/sdk';
2
+ import { IWorkbook, IWorkbookIO } from '@sheetxl/sdk';
3
3
  import { Command, IReactNotifier, ThemeMode } from '@sheetxl/utils-react';
4
- import { WorkbookInput } from '@sheetxl/react';
4
+ import { WorkbookInput, ActivateFrameOptions } from '@sheetxl/react';
5
+ import { StudioSaveOptions } from './StudioProps';
5
6
  /**
6
7
  * A port of the **studio**-level commands (`useStudioCommands`) — file I/O, theme,
7
8
  * help. This is the **placeholder** for the studio slice of the port; only the help/shortcuts family
@@ -74,6 +75,34 @@ export interface StudioFullScreenState {
74
75
  * disallows fullscreen, so the bridge re-runs this on change.
75
76
  */
76
77
  export declare function contributeStudioFullScreen(contribution: Command.CommandContribution, s: StudioFullScreenState): void;
78
+ /**
79
+ * Protect Workbook: BOTH protections behind one entry, deliberately.
80
+ *
81
+ * @remarks
82
+ * Excel splits them by storage mechanism - encryption is the file container, structure is XML inside
83
+ * the package - and so puts them in unrelated parts of its UI. That is an implementation detail
84
+ * deciding menu placement, and it reliably leads people to believe "Protect Workbook" encrypts.
85
+ * Grouped by intent here, labelled by effect in the panel.
86
+ *
87
+ * The command now OPENS the Workbook tab of Manage Protection rather than a dialog of its own; the
88
+ * key and the File-menu entry stay exactly where they were. Contributed here, and not with the file
89
+ * commands, because it is neither io nor a workbook mutation - it is a pane opener that happens to
90
+ * carry a studio-catalog key.
91
+ */
92
+ export declare function contributeStudioProtection(contribution: Command.CommandContribution, activateTaskPane: (key: string, options?: ActivateFrameOptions) => void): void;
93
+ /** What `openWorkbookFromUrl` accepts in place of a bare URL. */
94
+ export interface OpenWorkbookFromUrlArgs {
95
+ url: string;
96
+ /** The name to give the opened workbook. Defaults to the URL's file name. */
97
+ title?: string;
98
+ }
99
+ /** What `newWorkbook` accepts to start from an existing workbook rather than a blank one. */
100
+ export interface NewWorkbookArgs {
101
+ /** The URL of the workbook to start from. */
102
+ source?: string;
103
+ /** The name to give the new workbook. Defaults to the source's file name. */
104
+ title?: string;
105
+ }
77
106
  /**
78
107
  * The studio **app-shell** dependencies the file-I/O commands need — threaded from `CommandsWrapper` via
79
108
  * `StudioCommandProvider` (they live in the studio shell, not the workbook model).
@@ -95,6 +124,13 @@ export interface StudioIODeps {
95
124
  isDirty: () => boolean;
96
125
  /** Busy / error / confirm UI. */
97
126
  notifier: IReactNotifier;
127
+ /**
128
+ * Receives the studio's Save while the backing store can write, and `null` otherwise — what
129
+ * {@link IStudioAttributes.save} runs.
130
+ */
131
+ refSave?: {
132
+ current: ((options?: StudioSaveOptions) => Promise<IWorkbookIO.Origin | null>) | null;
133
+ };
98
134
  }
99
135
  /**
100
136
  * Contribute the studio **file-I/O** commands (the "studio slog", Batch 3) — `newWorkbook` /
@@ -249,6 +249,21 @@ export interface StudioProps extends Omit<PaperProps, 'autoFocus' | 'ref'> {
249
249
  * This will only be used the first time.
250
250
  */
251
251
  licenseKey?: string;
252
+ /**
253
+ * Which features to load ahead of use, once the studio is showing.
254
+ *
255
+ * - `none` - load each feature when it is first used.
256
+ * - `common` - features used in most sessions.
257
+ * - `all` - every feature.
258
+ *
259
+ * @remarks
260
+ * Nothing is loaded ahead of use while offline or when the connection asks to save data, and only
261
+ * common features on a slow connection. The script editor and its compiler are always loaded on
262
+ * first use.
263
+ *
264
+ * @defaultValue 'common'
265
+ */
266
+ prefetch?: 'none' | 'common' | 'all';
252
267
  /**
253
268
  * MUI SX props {@link https://mui.com/system/getting-started/the-sx-prop/}
254
269
  */
@@ -281,11 +296,37 @@ export type WorkbookLoadState = {
281
296
  * {@link IWorkbookElement} rather than being one — reach the chrome-free grid via
282
297
  * {@link IStudioAttributes.getWorkbookElement}.
283
298
  */
299
+ /**
300
+ * Options for {@link IStudioAttributes.save}.
301
+ */
302
+ export interface StudioSaveOptions {
303
+ /**
304
+ * Decides on a write that would lose something, in place of the studio's own dialog.
305
+ *
306
+ * @remarks
307
+ * For a host that cannot show the studio right now — an editor tab in the background, saved by
308
+ * the host's "Save All" — and so asks the user its own way. Omitted, the studio shows its dialog.
309
+ */
310
+ onWarnings?: IWorkbookIO.WriteOptions['onWarnings'];
311
+ }
284
312
  export interface IStudioAttributes {
285
313
  /**
286
314
  * For runtime type checking.
287
315
  */
288
316
  isStudioElement: () => true;
317
+ /**
318
+ * Saves the workbook exactly as the studio's own Save does — back to its origin, or asking where
319
+ * when it has none — including the studio's dialog when the write would lose something.
320
+ *
321
+ * @returns The origin written, or `null` when the save was cancelled (a dismissed picker, a
322
+ * declined lossy write).
323
+ *
324
+ * @remarks
325
+ * For a host that owns the save gesture (a VS Code extension's native Save) and needs the studio's
326
+ * behavior plus the outcome. A failure rejects with the error rather than showing it, so the host
327
+ * can report it its own way. Rejects when the active backing store cannot write.
328
+ */
329
+ save(options?: StudioSaveOptions): Promise<IWorkbookIO.Origin | null>;
289
330
  /**
290
331
  * Retrieve the chrome-free workbook grid element contained by this studio.
291
332
  *
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { StudioProps } from './StudioProps';
3
+ /**
4
+ * Splits props into those the studio consumes and those for its root element.
5
+ */
6
+ export declare const splitStudioProps: <P extends Partial<StudioProps>>(props: P) => [studioProps: Partial<StudioProps>, elementProps: React.HTMLAttributes<HTMLDivElement>];
7
+ //# sourceMappingURL=splitStudioProps.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { IWorkbook, IWorkbookIO } from '@sheetxl/sdk';
2
- import { WindowChromeOptions } from '@sheetxl/react';
2
+ import { WindowChromeOptions, WorkbookLoadEvent } from '@sheetxl/react';
3
3
  /**
4
4
  * What the studio should open. An {@link IWorkbook} / `Promise` / {@link IWorkbookIO.ReadOptions} /
5
5
  * source string. When omitted, the `?source` (and `?title`) URL query is used, else a blank
@@ -12,6 +12,23 @@ export interface StudioAppOptions extends WindowChromeOptions {
12
12
  * created. See {@link StudioAppSource}.
13
13
  */
14
14
  source?: StudioAppSource;
15
+ /**
16
+ * What to show when the app starts with no source. `'welcome'` opens the welcome dialog (start
17
+ * blank, open a workbook, or pick a template) over the blank workbook.
18
+ * @defaultValue nothing; the blank workbook is shown
19
+ */
20
+ startWith?: 'welcome';
21
+ /**
22
+ * The template catalog the welcome and "Choose a template" dialogs show: a URL serving
23
+ * `workbook-templates/contents.json`. Use it to pin a version or to serve your own templates.
24
+ * @defaultValue the latest published `@sheetxl/workbook-templates`
25
+ */
26
+ templatePath?: string;
27
+ /**
28
+ * The app's own `onWorkbookLoad` handler. Pass it here rather than on `<Studio>`, because the
29
+ * returned props carry an `onWorkbookLoad` of their own that runs it.
30
+ */
31
+ onWorkbookLoad?: (event: WorkbookLoadEvent) => void | Promise<void>;
15
32
  }
16
33
  /**
17
34
  * The props {@link useStudioApp} returns for spreading onto `<Studio>`.
@@ -23,6 +40,8 @@ export interface StudioAppProps {
23
40
  onWorkbookChange: (workbook: IWorkbook | null) => void;
24
41
  /** Tracks the unsaved-changes flag (drives the title marker + close prompt). */
25
42
  onDirtyChange: (isDirty: boolean) => void;
43
+ /** Shows the startup dialog ({@link StudioAppOptions.startWith}), then runs the app's own handler. */
44
+ onWorkbookLoad: (event: WorkbookLoadEvent) => void | Promise<void>;
26
45
  }
27
46
  /**
28
47
  * Single-call setup for a single-per-window **Studio** app: resolves what to open (an explicit
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Load the welcome dialog and its catalog while the first workbook loads, so a welcome shown at
3
+ * startup opens with the workbook rather than after it.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare const prefetchWelcome: (templatePath?: string) => void;
8
+ /** The argument `newWorkbookFromTemplate` and `showWelcome` accept. */
9
+ export interface TemplateDialogArgs {
10
+ /**
11
+ * The template catalog to show. Remembered for later dialogs, so a host passes it once.
12
+ * Defaults to the published SheetXL templates.
13
+ */
14
+ templatePath?: string;
15
+ /**
16
+ * `showWelcome` only: the app is starting. The welcome is skipped when the user has unchecked
17
+ * "Show at startup".
18
+ */
19
+ atStartup?: boolean;
20
+ }
21
+ /**
22
+ * Registers the workbook templates feature: the template commands on the `app` scope and a
23
+ * "From Template…" entry in the New menu. Idempotent.
24
+ *
25
+ * @remarks
26
+ * The studio registers it by default. The command labels live in the studio catalog.
27
+ */
28
+ export declare const TemplatesPlugin: () => void;
29
+ //# sourceMappingURL=TemplateCommands.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { InternalWindowProps } from '@sheetxl/utils-mui';
3
+ import { TemplateEntry } from './useTemplateCatalog';
4
+ export interface TemplateDialogProps extends InternalWindowProps {
5
+ /** The catalog to show. Defaults to the published SheetXL templates. */
6
+ templatePath?: string;
7
+ /** Called when a template is chosen. */
8
+ onSelectTemplate?: (entry: TemplateEntry) => void;
9
+ /** Whether "Show at startup" is checked. Omit to hide the checkbox. */
10
+ showAtStartup?: boolean;
11
+ /** Called when "Show at startup" is toggled. */
12
+ onShowAtStartupChange?: (show: boolean) => void;
13
+ }
14
+ /**
15
+ * "Choose a template": the template gallery with a search and a row of category filters.
16
+ */
17
+ declare const TemplateDialog: React.FC<TemplateDialogProps>;
18
+ export default TemplateDialog;
19
+ //# sourceMappingURL=TemplateDialog.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps, Theme } from '@mui/system';
3
+ import { TemplateCatalog, TemplateCategory, TemplateEntry } from './useTemplateCatalog';
4
+ export interface TemplatePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
5
+ /** The catalog to show, from {@link useTemplateCatalog}. */
6
+ catalog: TemplateCatalog;
7
+ /** Called when a template is chosen. */
8
+ onSelect?: (entry: TemplateEntry) => void;
9
+ /** Show only the entries that pass. */
10
+ filter?: (entry: TemplateEntry) => boolean;
11
+ /**
12
+ * Group the tiles under headings. Returns the group key for an entry; groups are shown in the
13
+ * order of `categories` when the keys are category ids, else in first-seen order.
14
+ */
15
+ groupBy?: (entry: TemplateEntry) => string;
16
+ /** Render a tile in place of the default one. */
17
+ renderTile?: (entry: TemplateEntry, props: TemplateTileProps) => React.ReactNode;
18
+ /**
19
+ * The smallest tile width, in pixels.
20
+ * @defaultValue 180
21
+ */
22
+ tileMinWidth?: number;
23
+ /**
24
+ * Shown when no entry passes the filter.
25
+ * @defaultValue "No templates here yet."
26
+ */
27
+ emptyLabel?: string;
28
+ /**
29
+ * Hold the panel at this many rows of tiles however many pass the filter; the rest scroll. A host
30
+ * short of room may shrink it, but not below one row.
31
+ * Unset, the panel is as tall as its content.
32
+ */
33
+ visibleRows?: number;
34
+ /** MUI SX props {@link https://mui.com/system/getting-started/the-sx-prop/} */
35
+ sx?: SxProps<Theme>;
36
+ }
37
+ /** What the panel hands a tile. */
38
+ export interface TemplateTileProps {
39
+ category?: TemplateCategory;
40
+ onSelect: () => void;
41
+ }
42
+ /**
43
+ * A gallery of workbook templates.
44
+ *
45
+ * @remarks
46
+ * Knows nothing about dialogs; a host decides what choosing a template does. Arrow keys move
47
+ * between tiles and Enter opens one.
48
+ */
49
+ export declare const TemplatePanel: React.NamedExoticComponent<TemplatePanelProps & React.RefAttributes<HTMLDivElement>>;
50
+ //# sourceMappingURL=TemplatePanel.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps, Theme } from '@mui/system';
3
+ import { TemplateCategory, TemplateEntry } from './useTemplateCatalog';
4
+ /** Whether an entry matches a search: its title, description, tags or category title. */
5
+ export declare const matchesTemplateQuery: (entry: TemplateEntry, query: string, category?: TemplateCategory) => boolean;
6
+ export interface TemplateSearchFieldProps {
7
+ value: string;
8
+ onChange: (value: string) => void;
9
+ sx?: SxProps<Theme>;
10
+ }
11
+ /** The template search box. Same shape as the task panes' search fields. */
12
+ export declare const TemplateSearchField: (props: TemplateSearchFieldProps) => React.ReactElement;
13
+ //# sourceMappingURL=TemplateSearchField.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { default as React } from 'react';
2
+ import { InternalWindowProps } from '@sheetxl/utils-mui';
3
+ import { TemplateEntry } from './useTemplateCatalog';
4
+ export interface WelcomeDialogProps extends InternalWindowProps {
5
+ /** The catalog to show. Defaults to the published SheetXL templates. */
6
+ templatePath?: string;
7
+ /** Shown at the top of the rail. Defaults to the SheetXL logo. */
8
+ logo?: React.ReactNode;
9
+ /** Keep the blank workbook. */
10
+ onBlank?: () => void;
11
+ /** Open a workbook from the device. */
12
+ onOpenFromDevice?: () => void;
13
+ /** Open a workbook from a web address. Omit to hide the entry. */
14
+ onOpenFromWeb?: () => void;
15
+ /** Called when a template is chosen. */
16
+ onSelectTemplate?: (entry: TemplateEntry) => void;
17
+ /** Whether "Show at startup" is checked. Omit to hide the checkbox. */
18
+ showAtStartup?: boolean;
19
+ /** Called when "Show at startup" is toggled. */
20
+ onShowAtStartupChange?: (show: boolean) => void;
21
+ }
22
+ /**
23
+ * The startup surface: a rail of ways to begin (blank, open) beside the template gallery.
24
+ */
25
+ declare const WelcomeDialog: React.FC<WelcomeDialogProps>;
26
+ /** @internal Fetch the catalog the dialog will show, ahead of showing it. */
27
+ export declare const prefetchCatalog: (templatePath?: string) => void;
28
+ export default WelcomeDialog;
29
+ //# sourceMappingURL=WelcomeDialog.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './useTemplateCatalog';
2
+ export * from './TemplatePanel';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,69 @@
1
+ import { ResourceIndex } from '@sheetxl/utils';
2
+ /**
3
+ * Where the template catalog is read from when no `templatePath` is given: the latest published
4
+ * `@sheetxl/workbook-templates`.
5
+ */
6
+ export declare const DEFAULT_TEMPLATE_PATH = "https://unpkg.com/@sheetxl/workbook-templates/dist";
7
+ /** A group of templates. Each category is a folder in the catalog. */
8
+ export interface TemplateCategory {
9
+ /** The folder name. Entries refer to their category by this id. */
10
+ id: string;
11
+ /** The display title. */
12
+ title: string;
13
+ description?: string;
14
+ icon?: string;
15
+ }
16
+ /** One template in a catalog. */
17
+ export interface TemplateEntry {
18
+ /** The template's path within the catalog (`finance/invoice.xlsx`). Stable across renames of its title. */
19
+ id: string;
20
+ /** The display title. Also used as the name of the opened workbook. */
21
+ title: string;
22
+ /** The id of the {@link TemplateCategory} it belongs to. */
23
+ category: string;
24
+ description?: string;
25
+ tags?: string[];
26
+ /** A preview image, when the catalog has one. */
27
+ thumbnailUrl?: string;
28
+ /** The preview on the dark grid, when the catalog has one. */
29
+ thumbnailDarkUrl?: string;
30
+ /** The workbook to open. */
31
+ sourceUrl: string;
32
+ }
33
+ /** The loaded state of a template catalog. */
34
+ export interface TemplateCatalog {
35
+ status: 'loading' | 'ready' | 'error';
36
+ /** The categories, in the catalog's display order. */
37
+ categories: TemplateCategory[];
38
+ entries: TemplateEntry[];
39
+ error?: unknown;
40
+ /** Fetch the catalog again, for use after an error. */
41
+ retry: () => void;
42
+ }
43
+ export interface TemplateCatalogOptions {
44
+ /**
45
+ * The catalog to read: a URL that serves `workbook-templates/contents.json`. Use it to pin a
46
+ * version (`https://unpkg.com/@sheetxl/workbook-templates@1.4.0/dist`) or to serve your own.
47
+ * @defaultValue {@link DEFAULT_TEMPLATE_PATH}
48
+ */
49
+ path?: string;
50
+ }
51
+ type LoadedCatalog = Pick<TemplateCatalog, 'categories' | 'entries'>;
52
+ /**
53
+ * Map a catalog's resource index to categories and entries, with asset URLs resolved against
54
+ * `path`. Exported for tests.
55
+ *
56
+ * @internal
57
+ */
58
+ export declare const toTemplateCatalog: (index: ResourceIndex, path: string) => LoadedCatalog;
59
+ /** @internal Fetch a catalog ahead of the gallery that shows it. Shared with {@link useTemplateCatalog}. */
60
+ export declare const loadCatalog: (path?: string) => Promise<LoadedCatalog>;
61
+ /**
62
+ * Load a workbook template catalog.
63
+ *
64
+ * @remarks
65
+ * The catalog is fetched once per `path` and shared by every caller.
66
+ */
67
+ export declare const useTemplateCatalog: (options?: TemplateCatalogOptions) => TemplateCatalog;
68
+ export {};
69
+ //# sourceMappingURL=useTemplateCatalog.d.ts.map
@@ -8,7 +8,9 @@ import { MovableContextMenuProps } from '../movable';
8
8
  import { SheetsAllMenuProps, SheetTabMenuProps } from '../sheet';
9
9
  import { WorkbookStripProps } from './WorkbookStrip';
10
10
  import { WorkbookContextMenuProps } from './WorkbookContextMenu';
11
+ import { FillMenuProps } from './FillMenu';
11
12
  export declare const renderMovableContextMenu: (props: MovableContextMenuProps) => React.ReactElement;
13
+ export declare const renderFillMenu: (props: FillMenuProps) => React.ReactElement;
12
14
  export declare const renderWorkbookContextMenu: (props: WorkbookContextMenuProps) => React.ReactElement;
13
15
  export declare const renderColumnMenu: (props: ColumnMenuProps) => React.ReactElement;
14
16
  export declare const renderWorkbookFormulaBar: (props: FormulaBarProps) => React.ReactElement;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { IWorkbook } from '@sheetxl/sdk';
3
+ import { FloatReference } from '@sheetxl/utils-react';
4
+ import { CommandContext } from '@sheetxl/react';
5
+ export interface FillMenuProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ /** The workbook the drag happened in. */
7
+ workbook: IWorkbook;
8
+ /** What the drag offers and runs — see {@link CommandContext.FillMenu}. */
9
+ menu: CommandContext.FillMenu;
10
+ disabled?: boolean;
11
+ floatReference: FloatReference;
12
+ }
13
+ /**
14
+ * Excel's fill menu — what a right-drag of the fill handle offers on release.
15
+ *
16
+ * @remarks
17
+ * Presentation only: the entries and their order live here, their labels are the shared preset
18
+ * labels, and everything else (which apply, what an entry does) is the context's.
19
+ */
20
+ export declare const FillMenu: React.NamedExoticComponent<FillMenuProps & React.RefAttributes<HTMLDivElement>>;
21
+ //# sourceMappingURL=FillMenu.d.ts.map
@@ -2,6 +2,7 @@ export { setPrintExamplesOnLoad } from '@sheetxl/react';
2
2
  export * from './WorkbookElement';
3
3
  export * from './DocumentTitle';
4
4
  export * from './WorkbookContextMenu';
5
+ export * from './FillMenu';
5
6
  export * from './WorkbookStrip';
6
7
  export { renderWorkbookSheetTab } from './DefaultRenderers';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- const e=require("./CPcBvw4ZPwHVTUZF.cjs"),t=require("./IASAYG6qgv7lJY7y.cjs");let n=require("@sheetxl/react"),r=require("@sheetxl/utils-react"),i=require("react"),a=require("@sheetxl/utils-mui"),o=require("react/jsx-runtime"),s=require("@mui/material");var c=e=>{e.button===0&&e.preventDefault()},l=(0,i.memo)((0,i.forwardRef)((l,u)=>{let{disabled:d,className:f,sx:p,defaultInput:m,value:h,formName:g,formOptions:_,onChangeInput:v,onChangeText:y,onDone:b,changeOn:x,onValidate:S,apiRef:C,label:w,hideAdornment:T,onKeyDown:E,onFocus:D,...O}=l,k=(0,r.useTranslator)(),A=w??k(`namedInput.label`),j=t.r(),M=g&&j?j.register(g,_):null,N=(0,n.useInputField)({value:h??``,onChange:v,onChangeText:y,onDone:b,changeOn:x,onValidate:S,disabled:d});(0,i.useImperativeHandle)(C,()=>N,[N]);let P=(0,i.useRef)(j);P.current=j;let F=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!g||N.error===F.current)return;F.current=N.error;let e=P.current;e&&(N.error?e.setError(g,{message:k(N.error)}):e.clearErrors(g))},[N.error,g]);let I=!!b,L=(0,i.useMemo)(()=>{if(!T&&I)return(0,o.jsxs)(s.InputAdornment,{tabIndex:-1,onMouseDown:c,"aria-hidden":!N.engaged,sx:{display:`flex`,position:`relative`,flex:`0`,...N.engaged?null:{visibility:`hidden`,pointerEvents:`none`}},position:`end`,children:[(0,o.jsx)(a.ExhibitIconButton,{dense:!0,outlined:!1,color:`primary`,"aria-label":`commit-input`,icon:(0,o.jsx)(r.DynamicIcon,{iconKey:`CheckSuccess`}),propsTooltip:{label:k(`referenceInput.commit`),simple:!0},disabled:!!N.error,tabIndex:-1,onMouseDown:c,onClick:()=>{N.commit()}}),(0,o.jsx)(a.ExhibitIconButton,{dense:!0,outlined:!1,color:`warning`,"aria-label":`cancel-input`,icon:(0,o.jsx)(r.DynamicIcon,{iconKey:`CloseError`}),propsTooltip:{label:k(`referenceInput.cancel`),simple:!0},tabIndex:-1,onMouseDown:c,onClick:()=>{N.cancel()}})]})},[T,I,N.engaged,N.commit,N.cancel,!!N.error]);return(0,o.jsx)(s.FormControl,{sx:{minWidth:135,width:`100%`,...p},size:`small`,ref:u,className:e.t(`sxl-input-field`,f),...O,children:(0,o.jsx)(s.TextField,{label:A,placeholder:m,disabled:d,error:!!N.error,helperText:N.error?k(N.error):` `,sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{input:{endAdornment:L},inputLabel:{shrink:!0},htmlInput:{className:`autoFocus`,name:g,spellCheck:!1,autoComplete:`off`,readOnly:d,sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},value:N.inputProps.value,inputRef:e=>{N.inputProps.ref(e),M?.ref&&M.ref(e)},onChange:e=>{N.inputProps.onChange(e),M?.onChange(e)},onKeyDown:e=>{N.inputProps.onKeyDown(e),e.defaultPrevented||E?.(e)},onFocus:e=>{N.inputProps.onFocus(e),D?.(e)},onBlur:e=>{N.inputProps.onBlur(e),M?.onBlur(e)},onContextMenu:e=>{e.stopPropagation()}})})}));l.displayName=`InputField`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -1,2 +0,0 @@
1
- let e=require("@sheetxl/utils-react"),t=require("react"),n=require("@sheetxl/utils-mui"),r=require("react/jsx-runtime"),i=require("@mui/material");var a=[`Ok`,`Cancel`],o=(0,t.memo)(o=>{let{initialValue:s=null,onInput:c,context:l,onOption:u,onValidateOption:d,onDone:f,options:p=a,defaultOption:m=p?.[0],cancelOption:h=`Cancel`,sx:g,..._}=o,v=(0,e.useTranslator)(),y=(0,t.useMemo)(()=>{let e=s??l?.()?.getComments(),t=``;if(e&&e.content&&e.content.runs){let n=e.content.runs;for(let e=0;e<n.length;e++){let r=n[e];t+=r?.text}}return t},[]),[b,x]=(0,t.useState)(y),[S,C]=(0,t.useState)(!1),w=(0,t.useCallback)(async(e,t)=>null,[]),T=(0,e.useCallbackRef)(async e=>{let t=b===``?[]:b.split(`
2
- `),n=e===h;if(!n){let e=t.length,n=Array(e);for(let r=0;r<e;r++)n[r]={text:t[r]};c?.({content:{runs:n}})}u?.(e,n,e===m),f?.()},[b,c,f,u,m,h]),E=(0,e.useCallbackRef)(e=>{x(e.target.value),w(e.target.value)},[d]),D=(0,e.useCallbackRef)(async e=>{let t=await Promise.resolve(d?.(e));try{!1!==t&&(t=await w(b,e))}catch{}return t??!0},[d,b]);return(0,r.jsx)(n.OptionsDialog,{title:v(y?`comments.titleEdit`:`comments.titleInsert`),options:p,onDone:f,onOption:e=>T(e),onValidateOption:D,defaultOption:m,cancelOption:h,autoFocusSel:`.autoFocus`,sx:{width:`480px`,...g},..._,children:(0,r.jsx)(i.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:`flex`,flexDirection:`column`},children:(0,r.jsx)(i.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:`100%`},size:`small`,children:(0,r.jsx)(i.TextField,{label:v(`comments.label`),placeholder:v(`comments.placeholder`),onFocus:e=>{S||e.target?.select(),C(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:`autoFocus`,spellCheck:!1,autoComplete:`off`,sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},value:b,onChange:E,onContextMenu:e=>{e.stopPropagation()}})})})})});exports.CommentsDialog=o,exports.default=o;