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

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 (243) hide show
  1. package/browser/esm/{Cd6n1XUgF0VItpkH.mjs → 5cbK03T_Oh3tNdR7.mjs} +7 -5
  2. package/browser/esm/{Bz5LiUe3SZ8g42Ia.mjs → 9eKCkvqpMQwqcXiw.mjs} +1 -1
  3. package/browser/esm/B1Yp_uy1vFHcJB3U.mjs +13 -0
  4. package/browser/esm/Biy7bhzzzPb5sfRN.mjs +152 -0
  5. package/browser/esm/Blaj2R5hYxtLAW__.mjs +117 -0
  6. package/browser/esm/{ChwS_ougBsogOEsP.mjs → ByeL_BZuJ2kl8gtf.mjs} +46 -47
  7. package/browser/esm/{BUGepznywvV0tUjW.mjs → C1Rp2hZrApo5MUc8.mjs} +2 -2
  8. package/browser/esm/{DMLXV4EKl1NCp_jk.mjs → CEvZe2cZK-voZTif.mjs} +5 -5
  9. package/browser/esm/{BZBJG2tDdD3-VujP.mjs → CIu1bjPJe_x31Oww.mjs} +195 -174
  10. package/browser/esm/COv-m-c2byCgvU3M.mjs +14861 -0
  11. package/browser/esm/CjznclrKqJRi7u9O.mjs +77 -0
  12. package/browser/esm/{Cj2pgCNqBCGl4rTX.mjs → CoSiOS-og0zFw4Ws.mjs} +587 -556
  13. package/browser/esm/{rU8xNPVQtDSnujM-.mjs → CtEFHbzYNvYjDYvi.mjs} +7 -7
  14. package/browser/esm/D6S8kVTzOjCn0-SK.mjs +627 -0
  15. package/browser/esm/{DNDrQKMTzKzNMjl-.mjs → D8al_cJ4U-NgzwoK.mjs} +1 -1
  16. package/browser/esm/DBtc4lku0uHVcqWn.mjs +71 -0
  17. package/browser/esm/{BoLxSRdEWt-Yg2RI.mjs → DHY19rkSiiRZxShC.mjs} +130 -103
  18. package/browser/esm/{zWTZ8BvT4hjgC2ua.mjs → DU3J8Gcf-WpBxNYg.mjs} +11 -10
  19. package/browser/esm/Die9NXVFveHvcCT-.mjs +4205 -0
  20. package/browser/esm/{CVfuCNRpODUw04IH.mjs → DmCQbW4zwkT_Rq88.mjs} +1 -1
  21. package/browser/esm/IQLeaAbtGTipUsOD.mjs +516 -0
  22. package/browser/esm/{3ydDykDMtDYbfVVn.mjs → X1Db3b_7b_7OuCk6.mjs} +178 -129
  23. package/browser/esm/fb126BNj3F8URR19.mjs +225 -0
  24. package/browser/esm/index.mjs +418 -135
  25. package/browser/esm/sFOAxZpxXo-qvDSp.mjs +293 -0
  26. package/browser/esm/sam1KGQZ59B_fADz.mjs +1941 -0
  27. package/browser/esm/xKiLJKiLxto8SayF.mjs +256 -0
  28. package/browser/esm/yZxC4qUENOlMhVUH.mjs +68 -0
  29. package/licenses/dependencies.txt +58 -311
  30. package/node/esm/B8SQfjKjzYHLxzZR.mjs +632 -0
  31. package/node/esm/{DM7K7-284z-PczVz.mjs → BYVLi0md4AYuDsB_.mjs} +1 -1
  32. package/node/esm/BYsG3KYVmxSe_CIQ.mjs +294 -0
  33. package/node/esm/BYwXhrEwkRAt9nJS.mjs +71 -0
  34. package/node/esm/B_jRGdwGFkudwmL-.mjs +68 -0
  35. package/node/esm/Bb1sLMqXWKjdve23.mjs +77 -0
  36. package/node/esm/{BwZcoHDBmLPIVOT5.mjs → BcwMb6CyVfvEwbHn.mjs} +69 -70
  37. package/node/esm/{BhqI3pQFkV8K_612.mjs → CKu1AtRgyltyEdEN.mjs} +1 -1
  38. package/node/esm/Cmt8Wv806N7NmE4Y.mjs +3344 -0
  39. package/node/esm/{DXZrzWee8K5FPOW1.mjs → D6oQL8knsPpgdXuk.mjs} +2 -2
  40. package/node/esm/{BA7VzUQ2sKRLTZ5c.mjs → D9rzScOA9pEYFrtz.mjs} +1 -1
  41. package/node/esm/DNSjK5DAH3M14Qbc.mjs +521 -0
  42. package/node/esm/{CUMKTjYv6VTkcWYi.mjs → DZzvTQxIKr9LbEsA.mjs} +1 -1
  43. package/node/esm/{Qpuqm6xBr_da38Ht.mjs → ETK6T6G0SIcFXDe5.mjs} +163 -135
  44. package/node/esm/ah3CUg4-VmNstGk_.mjs +256 -0
  45. package/node/esm/{CHi3AuWEwEPOg9IZ.mjs → ci8d-mF1H9wnYzix.mjs} +1 -1
  46. package/node/esm/cqzp431iNSLWictb.mjs +116 -0
  47. package/node/esm/index.mjs +14783 -6793
  48. package/package.json +15 -18
  49. package/resources/locales/de/groups.cmd.json +29 -16
  50. package/resources/locales/de/studio.cmd.json +18 -1
  51. package/resources/locales/de/ui.msg.json +350 -40
  52. package/resources/locales/en/groups.cmd.json +39 -17
  53. package/resources/locales/en/studio.cmd.json +18 -1
  54. package/resources/locales/en/ui.msg.json +306 -40
  55. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +17 -1
  56. package/types/src/anchorItems/AnchorItemsPanel.d.ts +14 -0
  57. package/types/src/anchorItems/AnchoredRangeField.d.ts +40 -0
  58. package/types/src/anchorItems/index.d.ts +1 -0
  59. package/types/src/border/BorderPopupButton.d.ts +6 -6
  60. package/types/src/border/BorderStylePopupButton.d.ts +3 -3
  61. package/types/src/border/BorderTemplateIcon.d.ts +24 -0
  62. package/types/src/border/index.d.ts +1 -0
  63. package/types/src/color/ColorPanel.d.ts +8 -2
  64. package/types/src/color/ColorPopupButton.d.ts +2 -1
  65. package/types/src/command/NumberFormatQuickButtons.d.ts +32 -0
  66. package/types/src/command/PresetCellStylesCommandButton.d.ts +3 -3
  67. package/types/src/command/SheetZoomCommandButton.d.ts +4 -3
  68. package/types/src/comments/CommentCard.d.ts +41 -0
  69. package/types/src/comments/CommentsPlugin.d.ts +6 -0
  70. package/types/src/comments/CommentsTaskPane.d.ts +23 -0
  71. package/types/src/comments/index.d.ts +4 -0
  72. package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +4 -4
  73. package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +2 -2
  74. package/types/src/conditionalFormat/IconSetRulePanel.d.ts +1 -1
  75. package/types/src/conditions/BetweenOption.d.ts +6 -1
  76. package/types/src/conditions/CombinatorOption.d.ts +7 -0
  77. package/types/src/conditions/ConditionEditor.d.ts +61 -4
  78. package/types/src/conditions/ConditionUtils.d.ts +65 -6
  79. package/types/src/conditions/ExpressionOption.d.ts +12 -6
  80. package/types/src/conditions/MembershipOption.d.ts +67 -0
  81. package/types/src/conditions/OperatorAndParamEditor.d.ts +36 -1
  82. package/types/src/conditions/ScalarOption.d.ts +25 -6
  83. package/types/src/conditions/SelectorSelect.d.ts +16 -7
  84. package/types/src/conditions/index.d.ts +1 -1
  85. package/types/src/conditions/useFormulaOption.d.ts +54 -0
  86. package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +7 -1
  87. package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -2
  88. package/types/src/dataValidation/DataValidationEditorPanel.d.ts +13 -2
  89. package/types/src/dataValidation/DataValidationIcon.d.ts +22 -0
  90. package/types/src/dataValidation/DataValidationTitle.d.ts +13 -0
  91. package/types/src/dialog/FillSeriesDialog.d.ts +16 -0
  92. package/types/src/dialog/OutlineSettingsDialog.d.ts +12 -0
  93. package/types/src/dialog/TableNewDialog.d.ts +1 -4
  94. package/types/src/dialog/_ShortcutSearch.d.ts +26 -0
  95. package/types/src/dialog/index.d.ts +0 -2
  96. package/types/src/externalLink/ExternalLinkCardBody.d.ts +9 -0
  97. package/types/src/externalLink/ExternalLinkChip.d.ts +18 -0
  98. package/types/src/externalLink/ExternalLinkLocation.d.ts +18 -0
  99. package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +18 -0
  100. package/types/src/externalLink/ExternalLinksPanel.d.ts +11 -0
  101. package/types/src/externalLink/ExternalLinksPlugin.d.ts +5 -0
  102. package/types/src/externalLink/ExternalLinksTaskPane.d.ts +19 -0
  103. package/types/src/externalLink/index.d.ts +8 -0
  104. package/types/src/fill/GradientEditor.d.ts +41 -0
  105. package/types/src/fill/GradientStopsBar.d.ts +43 -0
  106. package/types/src/fill/PatternPopupButton.d.ts +26 -0
  107. package/types/src/fill/PatternSwatch.d.ts +53 -0
  108. package/types/src/fill/index.d.ts +5 -0
  109. package/types/src/filter/ColumnMenu.d.ts +31 -1
  110. package/types/src/filter/index.d.ts +0 -1
  111. package/types/src/form/FormulaField.d.ts +35 -6
  112. package/types/src/form/InputField.d.ts +35 -5
  113. package/types/src/format/AlignmentPanel.d.ts +13 -0
  114. package/types/src/format/BorderPanel.d.ts +22 -0
  115. package/types/src/format/BorderPreview.d.ts +94 -0
  116. package/types/src/format/FillPanel.d.ts +65 -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 +85 -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/LinePanel.d.ts +53 -0
  123. package/types/src/format/LinePreviews.d.ts +71 -0
  124. package/types/src/format/NumberFormatOption.d.ts +43 -0
  125. package/types/src/{numberFormat → format}/NumberFormatPanel.d.ts +20 -0
  126. package/types/src/format/index.d.ts +14 -0
  127. package/types/src/format/useFormatSelection.d.ts +93 -0
  128. package/types/src/formulaBar/IFormulaBar.d.ts +11 -0
  129. package/types/src/formulaBar/MobileFormulaBar.d.ts +21 -0
  130. package/types/src/formulaBar/MobileInputToolbar.d.ts +37 -0
  131. package/types/src/formulaBar/index.d.ts +3 -0
  132. package/types/src/formulaBar/useFormulaBarSession.d.ts +65 -0
  133. package/types/src/index.d.ts +7 -1
  134. package/types/src/itemsPanel/EditorCommit.d.ts +32 -0
  135. package/types/src/itemsPanel/EditorPanel.d.ts +4 -1
  136. package/types/src/itemsPanel/ItemCard.d.ts +60 -8
  137. package/types/src/itemsPanel/ItemsDescriptor.d.ts +68 -19
  138. package/types/src/itemsPanel/ItemsPanel.d.ts +9 -0
  139. package/types/src/itemsPanel/ItemsSearchField.d.ts +17 -0
  140. package/types/src/itemsPanel/index.d.ts +2 -0
  141. package/types/src/named/NamedDetailsPanel.d.ts +9 -2
  142. package/types/src/named/NamedDetailsTaskPane.d.ts +3 -2
  143. package/types/src/named/NamedEditorPanel.d.ts +1 -1
  144. package/types/src/named/NamedExpressionField.d.ts +32 -0
  145. package/types/src/named/NamedKindChip.d.ts +38 -0
  146. package/types/src/picture/PicturePlugin.d.ts +6 -0
  147. package/types/src/picture/index.d.ts +2 -0
  148. package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +6 -0
  149. package/types/src/protectedRange/ProtectedRangeDraft.d.ts +22 -0
  150. package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +0 -14
  151. package/types/src/protectedRange/index.d.ts +2 -1
  152. package/types/src/protection/ManageProtectionTaskPane.d.ts +29 -0
  153. package/types/src/protection/PasswordDialog.d.ts +32 -0
  154. package/types/src/protection/PasswordField.d.ts +35 -0
  155. package/types/src/protection/ProtectedCellsPanel.d.ts +20 -0
  156. package/types/src/protection/ProtectionPlugin.d.ts +11 -0
  157. package/types/src/protection/SheetProtectionPanel.d.ts +35 -0
  158. package/types/src/protection/WorkbookProtectionPanel.d.ts +34 -15
  159. package/types/src/protection/WorkbookProtectionTab.d.ts +22 -0
  160. package/types/src/protection/index.d.ts +7 -1
  161. package/types/src/shape/InsertShapeCommandButton.d.ts +20 -0
  162. package/types/src/shape/ShapeFormatPanel.d.ts +11 -0
  163. package/types/src/shape/ShapePlugin.d.ts +6 -0
  164. package/types/src/shape/index.d.ts +3 -0
  165. package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +18 -0
  166. package/types/src/slicer/SlicerPlugin.d.ts +6 -0
  167. package/types/src/slicer/index.d.ts +3 -0
  168. package/types/src/statusBar/SheetZoomScale.d.ts +6 -0
  169. package/types/src/studio/CommandsWrapper.d.ts +5 -0
  170. package/types/src/studio/EagerStudio.d.ts +14 -1
  171. package/types/src/studio/StudioCommandProvider.d.ts +10 -0
  172. package/types/src/studio/StudioCommands.d.ts +40 -4
  173. package/types/src/studio/StudioProps.d.ts +64 -2
  174. package/types/src/studio/StudioSplitPane.d.ts +1 -1
  175. package/types/src/studio/formulaBarPlacement.d.ts +35 -0
  176. package/types/src/studio/splitStudioProps.d.ts +7 -0
  177. package/types/src/studio/useStudioApp.d.ts +31 -18
  178. package/types/src/template/TemplateCommands.d.ts +29 -0
  179. package/types/src/template/TemplateDialog.d.ts +19 -0
  180. package/types/src/template/TemplatePanel.d.ts +50 -0
  181. package/types/src/template/TemplateSearchField.d.ts +29 -0
  182. package/types/src/template/WelcomeDialog.d.ts +29 -0
  183. package/types/src/template/categoryColor.d.ts +8 -0
  184. package/types/src/template/index.d.ts +3 -0
  185. package/types/src/template/useTemplateCatalog.d.ts +71 -0
  186. package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
  187. package/types/src/workbook/DefaultRenderers.d.ts +15 -1
  188. package/types/src/workbook/FillMenu.d.ts +21 -0
  189. package/types/src/workbook/OutlineButtons.d.ts +11 -0
  190. package/types/src/workbook/WorkbookElement.d.ts +1 -1
  191. package/types/src/workbook/index.d.ts +1 -0
  192. package/browser/cjs/BQJKf40kttQWOzLw.cjs +0 -20
  193. package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +0 -1
  194. package/browser/cjs/B_D3JKseVvpRyX-E.cjs +0 -1
  195. package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +0 -2
  196. package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +0 -2
  197. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
  198. package/browser/cjs/Bte6P3MhSjajJmmY.cjs +0 -7
  199. package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
  200. package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +0 -1
  201. package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +0 -1
  202. package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +0 -1
  203. package/browser/cjs/CYxc8vnRi8dNpDPk.cjs +0 -1
  204. package/browser/cjs/CZm1jVZaHQ246prW.cjs +0 -1
  205. package/browser/cjs/CdDYyAfccXme8w6m.cjs +0 -1
  206. package/browser/cjs/Cm1APq2MraYNNhyI.cjs +0 -1
  207. package/browser/cjs/DO8V31Z1ewgMA1di.cjs +0 -5
  208. package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +0 -1
  209. package/browser/cjs/IASAYG6qgv7lJY7y.cjs +0 -1
  210. package/browser/cjs/KZvriGbhEOVkQD0b.cjs +0 -1
  211. package/browser/cjs/UnMhi28mbvLiOXQe.cjs +0 -1
  212. package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +0 -1
  213. package/browser/cjs/iMWEL01eC83oU-YY.cjs +0 -1
  214. package/browser/cjs/index.cjs +0 -2
  215. package/browser/cjs/w2GjebPlOFv3pCbm.cjs +0 -1
  216. package/browser/cjs/z0rB4fK6X1M6PpVD.cjs +0 -11
  217. package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +0 -1
  218. package/browser/esm/BuY3uV47Bwbqpasq.mjs +0 -219
  219. package/browser/esm/CAs1MWvJTcRfJy26.mjs +0 -217
  220. package/browser/esm/CBU3LgLYmqtQjJbu.mjs +0 -1150
  221. package/browser/esm/CDU0rqpLNVtMLI-f.mjs +0 -52
  222. package/browser/esm/CVBub6pgTsJzCc5m.mjs +0 -5429
  223. package/browser/esm/C_XvSsQ9BVdHffCO.mjs +0 -47
  224. package/browser/esm/FT29q8yNwsEpVZjt.mjs +0 -9257
  225. package/browser/esm/Hb1rlHT4tE5hLcjM.mjs +0 -82
  226. package/browser/esm/UJOXCQv6KrG1gY3l.mjs +0 -105
  227. package/browser/esm/s46El7mT6oKLSnYB.mjs +0 -411
  228. package/node/esm/9FY82fj1R1c-AczW.mjs +0 -47
  229. package/node/esm/C-boHCnJditFzng3.mjs +0 -106
  230. package/node/esm/DxXM8qHi0Oz4Zovl.mjs +0 -4575
  231. package/node/esm/sQt2wWGTRLzqeJdG.mjs +0 -82
  232. package/node/esm/yCHAZKxJR7qY_ySy.mjs +0 -470
  233. package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +0 -32
  234. package/types/src/conditions/DateTimeOption.d.ts +0 -43
  235. package/types/src/conditions/InSetOption.d.ts +0 -37
  236. package/types/src/dialog/CommentsDialog.d.ts +0 -11
  237. package/types/src/dialog/NumberFormatDialog.d.ts +0 -12
  238. package/types/src/filter/FilterList.d.ts +0 -28
  239. package/types/src/numberFormat/NumberFormatTaskPane.d.ts +0 -12
  240. package/types/src/numberFormat/index.d.ts +0 -8
  241. package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +0 -3
  242. package/types/src/protectedRange/ProtectedRangePlugin.d.ts +0 -2
  243. package/types/src/protection/WorkbookProtectionDialog.d.ts +0 -23
@@ -1,28 +1,41 @@
1
1
  import { IWorkbook, IWorkbookIO } from '@sheetxl/sdk';
2
- import { WindowChromeOptions } from '@sheetxl/react';
2
+ import { WindowChromeOptions, WorkbookLoadEvent } from '@sheetxl/react';
3
+ import { StudioProps } from './StudioProps';
3
4
  /**
4
5
  * What the studio should open. An {@link IWorkbook} / `Promise` / {@link IWorkbookIO.ReadOptions} /
5
6
  * source string. When omitted, the `?source` (and `?title`) URL query is used, else a blank
6
7
  * workbook is created.
7
8
  */
8
9
  export type StudioAppSource = IWorkbook | Promise<IWorkbook> | IWorkbookIO.ReadOptions | string;
9
- export interface StudioAppOptions extends WindowChromeOptions {
10
+ /**
11
+ * Options for {@link useStudioApp}: the app's own (what to open, the startup dialog, the window chrome)
12
+ * plus **any `Studio` prop**, passed through to the returned props — so the hook's result is the whole
13
+ * `<Studio>` spread. `workbook` is spelled {@link StudioAppOptions.source} here, since the app's source
14
+ * may also be a string.
15
+ */
16
+ export interface StudioAppOptions extends WindowChromeOptions, Omit<StudioProps, 'workbook'> {
10
17
  /**
11
18
  * What to open. If omitted, the `?source` / `?title` URL query is read, else a blank workbook is
12
19
  * created. See {@link StudioAppSource}.
13
20
  */
14
21
  source?: StudioAppSource;
15
- }
16
- /**
17
- * The props {@link useStudioApp} returns for spreading onto `<Studio>`.
18
- */
19
- export interface StudioAppProps {
20
- /** The studio's value object — pass straight to `<Studio workbook={…} />`. */
21
- workbook?: IWorkbook | Promise<IWorkbook> | IWorkbookIO.ReadOptions;
22
- /** Tracks the studio's live workbook (so the window chrome follows in-app opens). */
23
- onWorkbookChange: (workbook: IWorkbook | null) => void;
24
- /** Tracks the unsaved-changes flag (drives the title marker + close prompt). */
25
- onDirtyChange: (isDirty: boolean) => void;
22
+ /**
23
+ * What to show when the app starts with no source. `'welcome'` opens the welcome dialog (start
24
+ * blank, open a workbook, or pick a template) over the blank workbook.
25
+ * @defaultValue nothing; the blank workbook is shown
26
+ */
27
+ startWith?: 'welcome';
28
+ /**
29
+ * The template catalog the welcome and "Choose a template" dialogs show: a URL serving
30
+ * `templates-workbook/contents.json`. Use it to pin a version or to serve your own templates.
31
+ * @defaultValue the latest published `@sheetxl/templates-workbook`
32
+ */
33
+ templatePath?: string;
34
+ /**
35
+ * The app's own `onWorkbookLoad` handler, run after the startup dialog. (The hook also chains your
36
+ * `onWorkbookChange` / `onDirtyChange`, which it needs for the window chrome.)
37
+ */
38
+ onWorkbookLoad?: (event: WorkbookLoadEvent) => void | Promise<void>;
26
39
  }
27
40
  /**
28
41
  * Single-call setup for a single-per-window **Studio** app: resolves what to open (an explicit
@@ -30,9 +43,9 @@ export interface StudioAppProps {
30
43
  * window chrome — document/tab title (with an unsaved `●` marker), an unsaved-changes close prompt,
31
44
  * and a browser keyboard guard.
32
45
  *
33
- * @returns props to spread onto `<Studio>` — `workbook` (the value to open) plus the
34
- * `onWorkbookChange` / `onDirtyChange` callbacks the studio fires as it opens/replaces workbooks,
35
- * so the chrome follows.
46
+ * @returns the `<Studio>` props: every `Studio` prop given in `options`, plus `workbook` (the value to
47
+ * open) and the `onWorkbookChange` / `onDirtyChange` / `onWorkbookLoad` callbacks the studio fires as
48
+ * it opens/replaces workbooks, so the chrome follows (yours are chained after the hook's).
36
49
  *
37
50
  * @remarks
38
51
  * Studio owns the workbook lifecycle (resolve, Open/replace, save, dirty tracking) and reports the
@@ -43,9 +56,9 @@ export interface StudioAppProps {
43
56
  *
44
57
  * @example
45
58
  * ```tsx
46
- * const studioApp = useStudioApp(); // reads ?source, else a blank workbook
59
+ * const studioApp = useStudioApp({ startWith: 'welcome', propsWorkbook: { … } }); // reads ?source, else a blank workbook
47
60
  * return <Studio {...studioApp} />;
48
61
  * ```
49
62
  */
50
- export declare const useStudioApp: (options?: StudioAppOptions) => StudioAppProps;
63
+ export declare const useStudioApp: (options?: StudioAppOptions) => StudioProps;
51
64
  //# sourceMappingURL=useStudioApp.d.ts.map
@@ -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 that can be limited to categories.
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,29 @@
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
+ /**
7
+ * The gallery filter for a search: entries in any of `categoryIds` (all categories when empty) that
8
+ * match `query`. `undefined` when nothing is filtered.
9
+ */
10
+ export declare const useTemplateFilter: (categories: readonly TemplateCategory[], query: string, categoryIds: readonly string[]) => ((entry: TemplateEntry) => boolean) | undefined;
11
+ export interface TemplateSearchFieldProps {
12
+ value: string;
13
+ onChange: (value: string) => void;
14
+ /** The categories offered as filters. With fewer than two, the field is a plain search. */
15
+ categories?: readonly TemplateCategory[];
16
+ /** The ids of the categories the search is limited to. Empty is every category. */
17
+ categoryIds?: readonly string[];
18
+ onCategoryIdsChange?: (categoryIds: string[]) => void;
19
+ sx?: SxProps<Theme>;
20
+ }
21
+ /**
22
+ * The template search box. Same shape as the task panes' search fields.
23
+ *
24
+ * @remarks
25
+ * Given categories, the search icon opens a list of them. A chosen category shows as a chip in the
26
+ * field and limits the search to it; with several chosen, an entry in any of them is shown.
27
+ */
28
+ export declare const TemplateSearchField: (props: TemplateSearchFieldProps) => React.ReactElement;
29
+ //# 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,8 @@
1
+ import { Theme } from '@mui/system';
2
+ import { TemplateCategory } from './useTemplateCatalog';
3
+ /** The category's color and the black or white that reads on it, for the theme in use. */
4
+ export declare const resolveCategoryColor: (category: TemplateCategory | undefined, theme: Theme) => {
5
+ fill: string;
6
+ text: string;
7
+ } | null;
8
+ //# sourceMappingURL=categoryColor.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './useTemplateCatalog';
2
+ export * from './TemplatePanel';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,71 @@
1
+ import { ResourceIndex } from '@sheetxl/utils';
2
+ /**
3
+ * Where the template catalog is read from when no `templatePath` is given: the published
4
+ * `@sheetxl/templates-workbook` for this build's release channel.
5
+ */
6
+ export declare const DEFAULT_TEMPLATE_PATH: string;
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
+ /** A CSS color for the light theme. The dark theme shows it inverted. */
16
+ color?: string;
17
+ }
18
+ /** One template in a catalog. */
19
+ export interface TemplateEntry {
20
+ /** The template's path within the catalog (`finance/invoice.xlsx`). Stable across renames of its title. */
21
+ id: string;
22
+ /** The display title. Also used as the name of the opened workbook. */
23
+ title: string;
24
+ /** The id of the {@link TemplateCategory} it belongs to. */
25
+ category: string;
26
+ description?: string;
27
+ tags?: string[];
28
+ /** A preview image, when the catalog has one. */
29
+ thumbnailUrl?: string;
30
+ /** The preview on the dark grid, when the catalog has one. */
31
+ thumbnailDarkUrl?: string;
32
+ /** The workbook to open. */
33
+ sourceUrl: string;
34
+ }
35
+ /** The loaded state of a template catalog. */
36
+ export interface TemplateCatalog {
37
+ status: 'loading' | 'ready' | 'error';
38
+ /** The categories, in the catalog's display order. */
39
+ categories: TemplateCategory[];
40
+ entries: TemplateEntry[];
41
+ error?: unknown;
42
+ /** Fetch the catalog again, for use after an error. */
43
+ retry: () => void;
44
+ }
45
+ export interface TemplateCatalogOptions {
46
+ /**
47
+ * The catalog to read: a URL that serves `templates-workbook/contents.json`. Use it to pin a
48
+ * version (`https://unpkg.com/@sheetxl/templates-workbook@1.4.0/dist`) or to serve your own.
49
+ * @defaultValue {@link DEFAULT_TEMPLATE_PATH}
50
+ */
51
+ path?: string;
52
+ }
53
+ type LoadedCatalog = Pick<TemplateCatalog, 'categories' | 'entries'>;
54
+ /**
55
+ * Map a catalog's resource index to categories and entries, with asset URLs resolved against
56
+ * `path`. Exported for tests.
57
+ *
58
+ * @internal
59
+ */
60
+ export declare const toTemplateCatalog: (index: ResourceIndex, path: string) => LoadedCatalog;
61
+ /** @internal Fetch a catalog ahead of the gallery that shows it. Shared with {@link useTemplateCatalog}. */
62
+ export declare const loadCatalog: (path?: string) => Promise<LoadedCatalog>;
63
+ /**
64
+ * Load a workbook template catalog.
65
+ *
66
+ * @remarks
67
+ * The catalog is fetched once per `path` and shared by every caller.
68
+ */
69
+ export declare const useTemplateCatalog: (options?: TemplateCatalogOptions) => TemplateCatalog;
70
+ export {};
71
+ //# sourceMappingURL=useTemplateCatalog.d.ts.map
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { PaperProps, ToolbarProps } from '@mui/material';
4
4
  /**
5
- * Fallback tab list used only when the {@link TOOLBAR_STRIP_KEY} strip panel is not registered (a bare
5
+ * Fallback tab list used only when the {@link WORKBOOK_TOOLBARS_KEY} strip panel is not registered (a bare
6
6
  * host that never called `registerWorkbookCommandGroups`). Normally the strip's members ARE the config.
7
7
  */
8
8
  export declare const DefaultWorkbookToolbars: readonly string[];
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { SheetElementProps, SheetTabProps } from '@sheetxl/react';
2
+ import { SheetElementProps, SheetTabProps, CommentCardRenderProps, HyperlinkCardRenderProps, TableToolbarRenderProps, OutlineButtonProps, OutlineLevelButtonProps } from '@sheetxl/react';
3
3
  import { AnimatedLoadingPanelProps, StackTraceErrorPanelProps } from '@sheetxl/utils-mui';
4
4
  import { FormulaBarProps } from '../formulaBar';
5
5
  import { ColumnMenuProps } from '../filter';
@@ -8,9 +8,23 @@ 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';
12
+ /** The card of a threaded comment as it floats beside its cell. */
13
+ export declare const renderCommentCard: (props: CommentCardRenderProps) => React.ReactElement;
14
+ export declare const renderHyperlinkCard: (props: HyperlinkCardRenderProps) => React.ReactElement;
15
+ export declare const renderTableToolbar: (props: TableToolbarRenderProps) => React.ReactElement;
16
+ /** The collapse / expand button of a row or column group, in the outline gutter. */
17
+ export declare const renderOutlineButton: (props: OutlineButtonProps) => React.ReactElement;
18
+ /** A level button `1`..`n` of the outline. */
19
+ export declare const renderOutlineLevelButton: (props: OutlineLevelButtonProps) => React.ReactElement;
11
20
  export declare const renderMovableContextMenu: (props: MovableContextMenuProps) => React.ReactElement;
21
+ export declare const renderFillMenu: (props: FillMenuProps) => React.ReactElement;
12
22
  export declare const renderWorkbookContextMenu: (props: WorkbookContextMenuProps) => React.ReactElement;
13
23
  export declare const renderColumnMenu: (props: ColumnMenuProps) => React.ReactElement;
24
+ /**
25
+ * The formula bar for the studio's placement: the desktop bar above the grid, the mobile host when
26
+ * the bar sits at the bottom.
27
+ */
14
28
  export declare const renderWorkbookFormulaBar: (props: FormulaBarProps) => React.ReactElement;
15
29
  export declare const renderWorkbookLoading: (props: AnimatedLoadingPanelProps) => React.ReactElement;
16
30
  export declare const renderWorkbookError: (props: StackTraceErrorPanelProps) => 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
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { OutlineButtonProps, OutlineLevelButtonProps } from '@sheetxl/react';
3
+ /**
4
+ * The studio's collapse / expand button for a row or column group.
5
+ */
6
+ export declare const OutlineButton: (props: OutlineButtonProps) => React.ReactElement;
7
+ /**
8
+ * The studio's level button `1`..`n`: the collapse button's hover, in the corner knob's colors.
9
+ */
10
+ export declare const OutlineLevelButton: (props: OutlineLevelButtonProps) => React.ReactElement;
11
+ //# sourceMappingURL=OutlineButtons.d.ts.map
@@ -3,7 +3,7 @@ import { WorkbookElementProps, IWorkbookElement } from '@sheetxl/react';
3
3
  * The MUI workbook element.
4
4
  *
5
5
  * A thin wrapper around the chromeless `WorkbookElement` from `@sheetxl/react`: it supplies the grid's
6
- * own MUI popups (tabs, context/column/movable menus, loading) via the render seams. Theming flows
6
+ * own MUI popups (tabs, context/column/movable menus, comment cards, loading) via the render seams. Theming flows
7
7
  * through the injected `--sxl-*` token matrix (from the studio root) — no theme bridge is needed here;
8
8
  * the grid self-sources its light/dark scheme from the shared appearance preference. The surrounding
9
9
  * chrome (toolbar, formula bar, status bar) is composed by the Studio layer, not here.
@@ -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,20 +0,0 @@
1
- const e=require("./iMWEL01eC83oU-YY.cjs");let t=require("@sheetxl/utils-react"),n=require("react"),r=require("react/jsx-runtime"),i=require("@mui/material");function a(e){return a=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},a(e)}var o=/^\s+/,s=/\s+$/;function c(e,t){if(t||={},(e||=``)instanceof c)return e;if(!(this instanceof c))return new c(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,c=null,l=!1,u=!1;typeof e==`string`&&(e=function(e){e=e.replace(o,``).replace(s,``).toLowerCase();var t,n=!1;if(T[e])e=T[e],n=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};return(t=R.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=R.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=R.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=R.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=R.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=R.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=R.hex8.exec(e))?{r:A(t[1]),g:A(t[2]),b:A(t[3]),a:P(t[4]),format:n?`name`:`hex8`}:(t=R.hex6.exec(e))?{r:A(t[1]),g:A(t[2]),b:A(t[3]),format:n?`name`:`hex`}:(t=R.hex4.exec(e))?{r:A(t[1]+``+t[1]),g:A(t[2]+``+t[2]),b:A(t[3]+``+t[3]),a:P(t[4]+``+t[4]),format:n?`name`:`hex8`}:!!(t=R.hex3.exec(e))&&{r:A(t[1]+``+t[1]),g:A(t[2]+``+t[2]),b:A(t[3]+``+t[3]),format:n?`name`:`hex`}}(e)),a(e)==`object`&&(z(e.r)&&z(e.g)&&z(e.b)?(d=e.r,f=e.g,p=e.b,t={r:255*O(d,255),g:255*O(f,255),b:255*O(p,255)},l=!0,u=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):z(e.h)&&z(e.s)&&z(e.v)?(r=M(e.s),i=M(e.v),t=function(e,t,n){e=6*O(e,360),t=O(t,100),n=O(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:255*l,g:255*u,b:255*d}}(e.h,r,i),l=!0,u=`hsv`):z(e.h)&&z(e.s)&&z(e.l)&&(r=M(e.s),c=M(e.l),t=function(e,t,n){var r,i,a;function o(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=O(e,360),t=O(t,100),n=O(n,100),t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return{r:255*r,g:255*i,b:255*a}}(e.h,r,c),l=!0,u=`hsl`),e.hasOwnProperty(`a`)&&(n=e.a));var d,f,p;return n=D(n),{ok:l,format:e.format||u,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function l(e,t,n){e=O(e,255),t=O(t,255),n=O(n,255);var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var c=a-o;switch(i=s>.5?c/(2-a-o):c/(a+o),a){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return{h:r,s:i,l:s}}function u(e,t,n){e=O(e,255),t=O(t,255),n=O(n,255);var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=a,c=a-o;if(i=a===0?0:c/a,a==o)r=0;else{switch(a){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return{h:r,s:i,v:s}}function d(e,t,n,r){var i=[j(Math.round(e).toString(16)),j(Math.round(t).toString(16)),j(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function f(e,t,n,r){return[j(N(r)),j(Math.round(e).toString(16)),j(Math.round(t).toString(16)),j(Math.round(n).toString(16))].join(``)}function p(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=k(n.s),c(n)}function m(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=k(n.s),c(n)}function h(e){return c(e).desaturate(100)}function g(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=k(n.l),c(n)}function _(e,t){t=t===0?0:t||10;var n=c(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),c(n)}function v(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=k(n.l),c(n)}function y(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function b(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function x(e,t){if(isNaN(t)||t<=0)throw Error(`Argument to polyad must be a positive number`);for(var n=c(e).toHsl(),r=[c(e)],i=360/t,a=1;a<t;a++)r.push(c({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function S(e){var t=c(e).toHsl(),n=t.h;return[c(e),c({h:(n+72)%360,s:t.s,l:t.l}),c({h:(n+216)%360,s:t.s,l:t.l})]}function C(e,t,n){t||=6,n||=30;var r=c(e).toHsl(),i=360/n,a=[c(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(c(r));return a}function w(e,t){t||=6;for(var n=c(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(c({h:r,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return .2126*(t<=.03928?t/12.92:((t+.055)/1.055)**2.4)+.7152*(n<=.03928?n/12.92:((n+.055)/1.055)**2.4)+.0722*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)},setAlpha:function(e){return this._a=D(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=u(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return this._a==1?`hsv(`+t+`, `+n+`%, `+r+`%)`:`hsva(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHsl:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return this._a==1?`hsl(`+t+`, `+n+`%, `+r+`%)`:`hsla(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var a=[j(Math.round(e).toString(16)),j(Math.round(t).toString(16)),j(Math.round(n).toString(16)),j(N(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(``)}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(100*O(this._r,255))+`%`,g:Math.round(100*O(this._g,255))+`%`,b:Math.round(100*O(this._b,255))+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(100*O(this._r,255))+`%, `+Math.round(100*O(this._g,255))+`%, `+Math.round(100*O(this._b,255))+`%)`:`rgba(`+Math.round(100*O(this._r,255))+`%, `+Math.round(100*O(this._g,255))+`%, `+Math.round(100*O(this._b,255))+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:!(this._a<1)&&(E[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t=`#`+f(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?`GradientType = 1, `:``;if(e){var i=c(e);n=`#`+f(i._r,i._g,i._b,i._a)}return`progid:DXImageTransform.Microsoft.gradient(`+r+`startColorstr=`+t+`,endColorstr=`+n+`)`},toString:function(e){var t=!!e;e||=this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||e!==`hex`&&e!==`hex6`&&e!==`hex3`&&e!==`hex4`&&e!==`hex8`&&e!==`name`?(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),e!==`hex`&&e!==`hex6`||(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString()):e===`name`&&this._a===0?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(h,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(x,[3])},tetrad:function(){return this._applyCombination(x,[4])}},c.fromRatio=function(e,t){if(a(e)==`object`){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=r===`a`?e[r]:M(e[r]));e=n}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},c.mix=function(e,t,n){n=n===0?0:n||50;var r=c(e).toRgb(),i=c(t).toRgb(),a=n/100;return c({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},c.readability=function(e,t){var n=c(e),r=c(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},c.isReadable=function(e,t,n){var r,i=c.readability(e,t),a=!1;switch((r=function(e){var t=((e||={level:`AA`,size:`small`}).level||`AA`).toUpperCase(),n=(e.size||`small`).toLowerCase();return t!==`AA`&&t!==`AAA`&&(t=`AA`),n!==`small`&&n!==`large`&&(n=`small`),{level:t,size:n}}(n)).level+r.size){case`AAsmall`:case`AAAlarge`:a=i>=4.5;break;case`AAlarge`:a=i>=3;break;case`AAAsmall`:a=i>=7}return a},c.mostReadable=function(e,t,n){var r,i,a,o,s=null,l=0;i=(n||={}).includeFallbackColors,a=n.level,o=n.size;for(var u=0;u<t.length;u++)(r=c.readability(e,t[u]))>l&&(l=r,s=c(t[u]));return c.isReadable(e,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,c.mostReadable(e,[`#fff`,`#000`],n))};var T=c.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},E=c.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(T);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(e,t){(function(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1})(e)&&(e=`100%`);var n=function(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function k(e){return Math.min(1,Math.max(0,e))}function A(e){return parseInt(e,16)}function j(e){return e.length==1?`0`+e:``+e}function M(e){return e<=1&&(e=100*e+`%`),e}function N(e){return Math.round(255*parseFloat(e)).toString(16)}function P(e){return A(e)/255}var F,I,L,R=(I=`[\\s|\\(]+(`+(F=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`)+`)[,|\\s]+(`+F+`)[,|\\s]+(`+F+`)\\s*\\)?`,L=`[\\s|\\(]+(`+F+`)[,|\\s]+(`+F+`)[,|\\s]+(`+F+`)[,|\\s]+(`+F+`)\\s*\\)?`,{CSS_UNIT:new RegExp(F),rgb:RegExp(`rgb`+I),rgba:RegExp(`rgba`+L),hsl:RegExp(`hsl`+I),hsla:RegExp(`hsla`+L),hsv:RegExp(`hsv`+I),hsva:RegExp(`hsva`+L),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function z(e){return!!R.CSS_UNIT.exec(e)}var B=class extends (n.PureComponent||n.Component){constructor(...e){super(...e),this.handleChange=e=>{let t=((e,t,n,r)=>{let i=r.clientWidth,a=r.clientHeight,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(r.getBoundingClientRect().left+window.pageXOffset),l=s-(r.getBoundingClientRect().top+window.pageYOffset);if(t===`vertical`){let e;if(e=l<0?359:l>a?0:360*(-100*l/a+100)/100,n.h!==e)return{h:e,s:n.s,l:n.l,a:n.a,source:`hsl`}}else{let e;if(e=c<0?0:c>i?359:100*c/i*360/100,n.h!==e)return{h:e,s:n.s,l:n.l,a:n.a,source:`hsl`}}return null})(e,this.props.direction,this.props.hsl,this.container);t&&typeof this.props.onChange==`function`&&this.props.onChange(t,e)},this.handleMouseDown=e=>{this.handleChange(e),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},this.handleMouseUp=()=>{this.unbindEventListeners()}}componentWillUnmount(){this.unbindEventListeners()}unbindEventListeners(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}render(){let e=this.props.direction??`horizontal`,t=e===`vertical`,n={hue:{position:`absolute`,top:`0px`,right:`0px`,bottom:`0px`,left:`0px`,borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:`0 2px`,position:`relative`,height:`100%`,borderRadius:this.props.radius},pointer:{position:`absolute`,left:t?`0px`:100*this.props.hsl.h/360+`%`,...t?{top:-100*this.props.hsl.h/360+100+`%`}:{}},slider:{marginTop:`1px`,width:`4px`,borderRadius:`1px`,height:`8px`,boxShadow:`0 0 2px rgba(0, 0, 0, .6)`,background:`#fff`,transform:`translateX(-2px)`}};return(0,r.jsx)(`div`,{style:n.hue,children:(0,r.jsxs)(`div`,{className:`hue-${e}`,style:n.container,ref:e=>{this.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange,children:[(0,r.jsx)(`style`,{children:`
2
- .hue-horizontal {
3
- background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
4
- background: -webkit-linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
5
- }
6
- .hue-vertical {
7
- background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
8
- background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
9
- }
10
- `}),(0,r.jsx)(`div`,{style:n.pointer,children:this.props.pointer?(0,r.jsx)(this.props.pointer,{...this.props}):(0,r.jsx)(`div`,{style:n.slider})})]})})}},V=class extends (n.PureComponent||n.Component){constructor(...e){super(...e),this.handleChange=e=>{let t=((e,t,n,r,i)=>{let a=i.clientWidth,o=i.clientHeight,s=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,c=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,l=s-(i.getBoundingClientRect().left+window.pageXOffset),u=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n===`vertical`){let e;if(e=u<0?0:u>o?1:Math.round(100*u/o)/100,t.a!==e)return{h:t.h,s:t.s,l:t.l,a:e,source:`rgb`}}else{let e;if(e=l<0?0:l>a?1:Math.round(100*l/a)/100,r!==e)return{h:t.h,s:t.s,l:t.l,a:e,source:`rgb`}}return null})(e,this.props.hsl,this.props.direction,this.props.a,this.container);t&&typeof this.props.onChange==`function`&&this.props.onChange(t,e)},this.handleMouseDown=e=>{this.handleChange(e),window.addEventListener(`mousemove`,this.handleChange),window.addEventListener(`mouseup`,this.handleMouseUp)},this.handleMouseUp=()=>{this.unbindEventListeners()},this.unbindEventListeners=()=>{window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}}componentWillUnmount(){this.unbindEventListeners()}render(){let{rgb:t}=this.props,n=this.props.direction===`vertical`,i={position:`absolute`,top:`0px`,right:`0px`,bottom:`0px`,left:`0px`},a=`linear-gradient(to right, rgba(${t.r},${t.g},${t.b}, 0) 0%,\n rgba(${t.r},${t.g},${t.b}, 1) 100%)`,o=`linear-gradient(to bottom, rgba(${t.r},${t.g},${t.b}, 0) 0%,\n rgba(${t.r},${t.g},${t.b}, 1) 100%)`,s={alpha:{...i,borderRadius:this.props.radius},checkboard:{...i,overflow:`hidden`,borderRadius:this.props.radius},gradient:{...i,background:n?o:a,boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:`relative`,height:`100%`,margin:`0 3px`},pointer:{position:`absolute`,left:n?0:100*t.a+`%`,...n?{top:100*t.a+`%`}:{}},slider:{width:`4px`,borderRadius:`1px`,height:`8px`,boxShadow:`0 0 2px rgba(0, 0, 0, .6)`,background:`#fff`,marginTop:`1px`,transform:`translateX(-2px)`}};return(0,r.jsxs)(`div`,{style:s.alpha,children:[(0,r.jsx)(`div`,{style:s.checkboard,children:(0,r.jsx)(e.t,{grey:`rgba(0,0,0,.08)`,renderers:this.props.renderers})}),(0,r.jsx)(`div`,{style:s.gradient}),(0,r.jsx)(`div`,{style:s.container,ref:e=>{this.container=e},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange,children:(0,r.jsx)(`div`,{style:s.pointer,children:this.props.pointer?(0,r.jsx)(this.props.pointer,{...this.props}):(0,r.jsx)(`div`,{style:s.slider})})})]})}},H=[38,40],U=1,W=class extends (n.PureComponent||n.Component){constructor(e){super(e),this.handleBlur=()=>{this.state.blurValue&&this.setState({value:this.state.blurValue,blurValue:null})},this.handleChange=e=>{this.setUpdatedValue(e.target.value,e)},this.handleKeyDown=e=>{let t=(e=>Number(String(e).replace(/%/g,``)))(e.target.value);if(!isNaN(t)&&(n=e.keyCode,H.indexOf(n)>-1)){let n=this.getArrowOffset(),r=e.keyCode===38?t+n:t-n;this.setUpdatedValue(r,e)}var n},this.handleDrag=e=>{if(this.props.dragLabel){let t=Math.round(this.props.value+e.movementX);t>=0&&t<=this.props.dragMax&&this.props.onChange&&this.props.onChange(this.getValueObjectWithLabel(t),e)}},this.handleMouseDown=e=>{this.props.dragLabel&&(e.preventDefault(),this.handleDrag(e),window.addEventListener(`mousemove`,this.handleDrag),window.addEventListener(`mouseup`,this.handleMouseUp))},this.handleMouseUp=()=>{this.unbindEventListeners()},this.unbindEventListeners=()=>{window.removeEventListener(`mousemove`,this.handleDrag),window.removeEventListener(`mouseup`,this.handleMouseUp)},this.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},this.inputId=`rc-editable-input-`+U++}componentDidUpdate(e,t){this.props.value===this.state.value||e.value===this.props.value&&t.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}componentWillUnmount(){this.unbindEventListeners()}getValueObjectWithLabel(e){return{[this.props.label]:e}}getArrowOffset(){return this.props.arrowOffset||1}setUpdatedValue(e,t){let n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}render(){let e=this.props.style||{},t={wrap:{position:`relative`,...e.wrap||{}},input:{...e.input||{}},label:{...e.label||{},...this.props.dragLabel?{cursor:`ew-resize`}:{}}};return(0,r.jsxs)(`div`,{style:t.wrap,children:[(0,r.jsx)(`input`,{id:this.inputId,style:t.input,ref:e=>{this.input=e},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:`false`}),this.props.label&&!this.props.hideLabel?(0,r.jsx)(`label`,{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown,children:this.props.label}):null]})}},G=({onChange:e,rgb:t,hsl:n,hex:i,disableAlpha:a})=>{let o={fields:{display:`flex`,paddingTop:`4px`},single:{flex:`1`,paddingLeft:`6px`},alpha:{flex:`1`,paddingLeft:`6px`,...a?{display:`none`}:{}},double:{flex:`2`},input:{width:`80%`,padding:`4px 10% 3px`,border:`none`,boxShadow:`inset 0 0 0 1px #ccc`,fontSize:`11px`},label:{display:`block`,textAlign:`center`,fontSize:`11px`,color:`#222`,paddingTop:`3px`,paddingBottom:`4px`,textTransform:`capitalize`}},s=(r,i)=>{r.hex?(e=>{if(e===`transparent`)return!0;let t=+(String(e).charAt(0)===`#`);return e.length!==4+t&&e.length<7+t&&c(e).isValid()})(r.hex)&&e({hex:r.hex,source:`hex`},i):r.r||r.g||r.b?e({r:r.r||t.r,g:r.g||t.g,b:r.b||t.b,a:t.a,source:`rgb`},i):r.a&&(r.a<0?r.a=0:r.a>100&&(r.a=100),r.a/=100,e({h:n.h,s:n.s,l:n.l,a:r.a,source:`rgb`},i))};return(0,r.jsxs)(`div`,{style:o.fields,className:`flexbox-fix`,children:[(0,r.jsx)(`div`,{style:o.double,children:(0,r.jsx)(W,{style:{input:o.input,label:o.label},label:`hex`,value:i.replace(`#`,``),onChange:s})}),(0,r.jsx)(`div`,{style:o.single,children:(0,r.jsx)(W,{style:{input:o.input,label:o.label},label:`r`,value:t.r,onChange:s,dragLabel:`true`,dragMax:`255`})}),(0,r.jsx)(`div`,{style:o.single,children:(0,r.jsx)(W,{style:{input:o.input,label:o.label},label:`g`,value:t.g,onChange:s,dragLabel:`true`,dragMax:`255`})}),(0,r.jsx)(`div`,{style:o.single,children:(0,r.jsx)(W,{style:{input:o.input,label:o.label},label:`b`,value:t.b,onChange:s,dragLabel:`true`,dragMax:`255`})}),(0,r.jsx)(`div`,{style:o.alpha,children:(0,r.jsx)(W,{style:{input:o.input,label:o.label},label:`a`,value:Math.round(100*t.a),onChange:s,dragLabel:`true`,dragMax:`100`})})]})},K=class extends (n.PureComponent||n.Component){constructor(e){super(e),this.handleChange=e=>{typeof this.props.onChange==`function`&&this.throttle(this.props.onChange,((e,t,n)=>{var r=n.getBoundingClientRect(),i=r.width,a=r.height,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(n.getBoundingClientRect().left+window.pageXOffset),l=s-(n.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),l<0?l=0:l>a&&(l=a);var u=c/i,d=1-l/a;return{h:t.h,s:u,v:d,a:t.a,source:`hsv`}})(e,this.props.hsl,this.container),e),e.preventDefault()},this.handleMouseDown=e=>{this.handleChange(e);let t=this.getContainerRenderWindow();t.addEventListener(`mousemove`,this.handleChange),t.addEventListener(`mouseup`,this.handleMouseUp)},this.handleMouseUp=e=>{e.preventDefault(),this.unbindEventListeners()},this.throttle=function(e,t,n){let r,i,a,o;var s=0;n||={};let c=function(){s=!1===n.leading?0:Date.now(),r=null,o=e.apply(i,a),r||(i=a=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=t-(l-s);return i=this,a=arguments,u<=0||u>t?(r&&=(clearTimeout(r),null),s=l,o=e.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(c,u)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l}((e,t,n)=>{e(t,n)},50)}componentWillUnmount(){this.throttle.cancel(),this.unbindEventListeners()}getContainerRenderWindow(){let{container:e}=this,t=window;for(;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}unbindEventListeners(){let e=this.getContainerRenderWindow();e.removeEventListener(`mousemove`,this.handleChange),e.removeEventListener(`mouseup`,this.handleMouseUp)}render(){let{color:e,white:t,black:n,pointer:i,circle:a}=this.props||{},o={position:`absolute`,top:`0px`,left:`0px`,right:`0px`,bottom:`0px`},s={color:{...o,backgroundColor:`hsl(${this.props.hsl?.h},100%, 50%)`,borderRadius:this.props.style?.borderRadius},white:{...o,borderRadius:this.props.style?.borderRadius},black:{...o,boxShadow:this.props.style?.boxShadow,borderRadius:this.props.style?.borderRadius},pointer:{...o,top:-100*this.props.hsv?.v+100+`%`,left:100*this.props.hsv?.s+`%`,cursor:`default`},circle:{width:`4px`,height:`4px`,boxShadow:`0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
11
- 0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:`50%`,cursor:`hand`,transform:`translate(-2px, -2px)`}};return(0,r.jsxs)(`div`,{style:s.color,ref:e=>this.container=e,onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange,children:[(0,r.jsx)(`style`,{children:`
12
- .saturation-white {
13
- background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
14
- background: linear-gradient(to right, #fff, rgba(255,255,255,0));
15
- }
16
- .saturation-black {
17
- background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
18
- background: linear-gradient(to top, #000, rgba(0,0,0,0));
19
- }
20
- `}),(0,r.jsxs)(`div`,{style:s.white,className:`saturation-white`,children:[(0,r.jsx)(`div`,{style:s.black,className:`saturation-black`}),(0,r.jsx)(`div`,{style:s.pointer,children:this.props.pointer?(0,r.jsx)(this.props.pointer,{...this.props}):(0,r.jsx)(`div`,{style:s.circle})})]})]})}},q=(e,t=null)=>{let n=e.hex?c(e.hex):c(e||`transparent`),r=n.toHsl(),i=n.toHsv(),a=n.toRgb(),o=n.toHex();return r.s===0&&(r.h=t??0,i.h=t??0),{hsl:r,hex:`#`+o,rgb:a,hsv:i,source:e.source}},J=(0,n.memo)(a=>{let{selectedColor:o,onColorChange:s,renderers:c,disableAlpha:l=!1,style:u=t.ReactUtils.EmptyCssProperties,...d}=a,f=(0,i.useTheme)(),[p,m]=(0,n.useState)(()=>q(o)),[h,g]=(0,n.useState)(p.hsl.h??0),_=(0,n.useCallback)(e=>{let t=q(e,h);return g(t.hsl.h??0),m(t),t},[h]),v=(0,n.useCallback)(e=>{let t=_(e),n=`rgba(${t.rgb.r},${t.rgb.g},${t.rgb.b},${l?1:t.rgb.a})`;s?.(n)},[s,_,l]);(0,n.useLayoutEffect)(()=>{_(o)},[o,_]);let y=(0,r.jsx)(`div`,{style:{position:`relative`,minHeight:`10px`,maxHeight:`10px`,width:`100%`},children:(0,r.jsx)(V,{style:{radius:`2px`,shadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`},rgb:p.rgb,hsl:p.hsl,renderers:c,onChange:v})});return(0,r.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,...u},...d,children:[(0,r.jsx)(`div`,{style:{width:`100%`,flex:`1 1 100%`,position:`relative`,overflow:`hidden`},children:(0,r.jsx)(K,{style:{borderRadius:`3px`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`},hsl:p.hsl,hsv:p.hsv,onChange:v})}),(0,r.jsxs)(`div`,{style:{marginTop:`4px`,display:`flex`,gap:`4px`},children:[(0,r.jsxs)(`div`,{style:{flex:`1`,display:`flex`,flexDirection:l?`row`:`column`,justifyContent:`space-between`,alignItems:`center`},children:[(0,r.jsx)(`div`,{style:{position:`relative`,minHeight:`10px`,maxHeight:`10px`,width:`100%`},children:(0,r.jsx)(B,{style:{radius:`2px`,shadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`},hsl:p.hsl,onChange:v})}),l?null:y]}),(0,r.jsxs)(`div`,{style:{minWidth:`24px`,maxWidth:`24px`,minHeight:`24px`,maxHeight:`24px`,position:`relative`,borderRadius:`1px`,overflow:`hidden`},children:[(0,r.jsx)(e.t,{grey:f.palette.text.icon??f.palette.action.active}),(0,r.jsx)(`div`,{style:{position:`absolute`,height:`100%`,width:`100%`,background:`rgba(${p.rgb.r},${p.rgb.g},${p.rgb.b},${l?1:p.rgb.a})`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`}})]})]}),(0,r.jsx)(i.Box,{sx:{marginBottom:`4px`,"& label":{fontFamily:e=>`${e.typography.fontFamily} !important`,color:e=>`${e.palette.text.secondary} !important`},"& *":{fontFamily:e=>`${e.typography.fontFamily} !important`,userSelect:`none`},"& input":{paddingLeft:e=>`${e.spacing(.5)} !important`,paddingRight:e=>`${e.spacing(.5)} !important`,outline:`none`,boxSizing:`border-box`,width:`100% !important`,textAlign:`center`}},children:(0,r.jsx)(G,{rgb:p.rgb,hsl:p.hsl,hex:p.hex,disableAlpha:l,onChange:v})})]})});exports.CustomColorPanel=J,exports.default=J;
@@ -1 +0,0 @@
1
- let e=require("@sheetxl/sdk"),t=require("@sheetxl/utils-react"),n=require("react"),r=require("@sheetxl/utils-mui"),i=require("react/jsx-runtime"),a=require("@mui/material");var o=[`Autofit`,`Ok`,`Cancel`],s=(0,n.memo)(s=>{let{initialValue:c,context:l,onOption:u,onValidateOption:d,onInput:f,onDone:p,options:m=o,defaultOption:h=m?.[1],cancelOption:g=`Cancel`,sx:_,...v}=s,y=(0,t.useTranslator)(),b=(0,n.useMemo)(()=>l?.().getAxis()===e.IRange.Axis.Column,[l]),[x,S]=(0,n.useState)(c??{size:0}),[C,w]=(0,n.useState)(!1),T=(0,n.useCallback)(async(e,t)=>!0,[]),E=(0,n.useMemo)(()=>{let e=l?.();if(!e?.toUnits)return null;let t=x?.size??0,n=`Px`;return x.unit===`Px`?(t=e.toUnits?.(t)??t,n=e.getUnitText()):(t=e.toPixels?.(t)??t,n=`Px`),{size:t,unit:n}},[x?.unit,x?.size]),D=(0,t.useCallbackRef)(async e=>{let t=e===g;t||f?.(x,e),u?.(e,t,e===h),p?.()},[x,f,p,u,g,h]),O=(0,t.useCallbackRef)(async e=>{e.keyCode===t.KeyCodes.Enter&&!1!==await T?.(x)&&D(h)},[x,D]),k=(0,t.useCallbackRef)(async e=>{let t=await Promise.resolve(d?.(e));try{!1!==t&&(t=await Promise.resolve(T?.(x,e))??!0)}catch{}return t??!0},[d]),A=(0,t.useCallbackRef)(e=>{let t={...x,size:Number(e.target.value)};S(t),T?.(t)},[x,d]),j=(0,t.useCallbackRef)(e=>{let t=e.target.value,n={...x,unit:t};S(n)},[x]),M=(0,n.useMemo)(()=>{let e=l?.().getUnitText()??``,t=e=>(0,i.jsx)(a.MenuItem,{value:e,children:e},e),n=[];return n.push(t(`Px`)),n.push(t(e)),n},[]),N=(0,n.useMemo)(()=>m.map(e=>e===`Autofit`?{id:`Autofit`,label:()=>y(`resizeHeader.autofit`)}:e),[m,y]);return(0,i.jsx)(r.OptionsDialog,{title:y(b?`resizeHeader.titleColumns`:`resizeHeader.titleRows`),options:N,onDone:p,onOption:e=>D(e),onValidateOption:k,defaultOption:h,cancelOption:g,autoFocusSel:`.autoFocus`,sx:{width:`380px`,..._},...v,children:(0,i.jsxs)(a.Box,{sx:{paddingTop:e=>e.spacing(0),paddingBottom:e=>e.spacing(1),display:`flex`,flexDirection:`column`},children:[(0,i.jsxs)(a.Box,{sx:{rowGap:e=>e.spacing(1),display:`flex`,flexDirection:`row`,gap:e=>e.spacing(.5),alignItems:`end`,justifyContent:`center`},children:[(0,i.jsx)(a.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:`100%`},size:`small`,children:(0,i.jsx)(a.TextField,{label:y(`resizeHeader.size`),onFocus:e=>{C||e.target?.select(),w(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:`autoFocus`,spellCheck:!1,autoComplete:`off`,type:`number`,inputMode:`numeric`,min:0,pattern:`[0-9]*`,sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},value:x.size,onChange:A,onKeyDown:O,onContextMenu:e=>{e.stopPropagation()}})}),(0,i.jsxs)(a.FormControl,{sx:{minWidth:85},size:`small`,children:[(0,i.jsx)(a.InputLabel,{children:y(`resizeHeader.unit`)}),(0,i.jsx)(a.Select,{value:x.unit,label:y(`resizeHeader.unit`),onChange:j,children:M})]})]}),E&&(0,i.jsx)(a.Box,{children:(0,i.jsxs)(a.Typography,{variant:`body2`,component:`div`,sx:{paddingLeft:e=>e.spacing(2)},children:[E.size,` `,E.unit]})})]})})});exports.ResizeHeaderDialog=s,exports.default=s;
@@ -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;
@@ -1,2 +0,0 @@
1
- const e=require("./Bo9Kx3L_XQkGPBJ5.cjs");let t=require("@sheetxl/utils-react"),n=require("react");n=e.n(n,1);let r=require("@sheetxl/utils-mui"),i=require("react/jsx-runtime"),a=require("@mui/material"),o=require("@sheetxl/utils");var s=e=>e.replace(/\n\n+/g,`
2
- `).trim(),c=new Set([`Control`,`Shift`,`Alt`,`Meta`]),l=e=>{let t=e,n=new Set;for(let e of[`mod`,`alt`,`shift`])t.startsWith(`${e}+`)&&(n.add(e),t=t.slice(e.length+1));return{key:t,mods:n}},u=o.CommonUtils.getPlatform()===o.CommonUtils.OSType.MacOS||o.CommonUtils.getPlatform()===o.CommonUtils.OSType.IOS,d=[t.KeyModifiers.Ctrl,t.KeyModifiers.Alt,t.KeyModifiers.Shift,t.KeyModifiers.Meta],f=e=>{switch(e){case t.KeyModifiers.Ctrl:return u?`Cmd`:`Ctrl`;case t.KeyModifiers.Alt:return`Alt`;case t.KeyModifiers.Shift:return`Shift`;case t.KeyModifiers.Meta:return`Meta`;default:return e}},p=e=>{let t=new Set(e);return d.filter(e=>t.has(e))},m=e=>{let n=[];return e.ctrlKey&&n.push(t.KeyModifiers.Ctrl),e.altKey&&n.push(t.KeyModifiers.Alt),e.shiftKey&&n.push(t.KeyModifiers.Shift),e.metaKey&&n.push(t.KeyModifiers.Meta),n},h=({children:e})=>(0,i.jsx)(a.Box,{component:`kbd`,sx:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:`20px`,height:`20px`,paddingX:`5px`,boxSizing:`border-box`,fontFamily:`inherit`,fontSize:`0.7rem`,fontWeight:600,lineHeight:1,whiteSpace:`nowrap`,borderRadius:`5px`,color:e=>e.palette.text.secondary,backgroundColor:e=>(0,a.emphasize)(e.palette.background.paper,.07),border:e=>`solid 1px ${e.palette.divider}`,borderBottomWidth:`2px`},children:e}),g=()=>(0,i.jsx)(a.Box,{component:`span`,sx:{fontSize:`0.7rem`,color:e=>e.palette.text.disabled},children:`+`}),_=({labels:e,dangling:t=!1})=>(0,i.jsxs)(a.Box,{sx:{display:`flex`,alignItems:`center`,gap:`1px`},children:[e.map((e,t)=>(0,i.jsxs)(n.default.Fragment,{children:[t>0&&(0,i.jsx)(g,{}),(0,i.jsx)(h,{children:e})]},t)),t&&(0,i.jsx)(g,{})]}),v=({stroke:e})=>{if(!e?.key)return null;let n=p(e.modifiers??[]).map(f);return n.push(t.ReactUtils.toPrettyKeyCode(e.key)),(0,i.jsx)(_,{labels:n})};function y(e){let{commands:r,sx:d,...h}=e,[g,y]=(0,n.useState)(!1),[b,x]=(0,n.useState)(``),[S,C]=(0,n.useState)(null),[w,T]=(0,n.useState)(!1),[E,D]=(0,n.useState)(null),[O,k]=(0,n.useState)(null),[A,j]=(0,n.useState)(null),M=(0,n.useRef)(null),N=(0,n.useMemo)(()=>{let e=r.getAllCommands();g&&(e=e.filter(e=>e.command.getShortcut())),e=[...e].sort((e,t)=>{let n=e.command.getScope?.()??e.groupKey,r=t.command.getScope?.()??t.groupKey,i=n.localeCompare(r);return i===0?e.command.getLabel().localeCompare(t.command.getLabel()):i});let n=[],i=new Set;for(let r of e){let e=r.command,a=e.getScope?.()??r.groupKey,o={label:e.getLabel(),icon:e.getIcon(),scope:a,scopeLabel:e.getScopeLabel?.()??a,description:s(e.getDescription())},c=e.getShortcut(),l=Array.isArray(c)?c.length?c:[null]:[c??null];for(let e of l){let r=e?(0,t.keyStrokeToCanonical)(e):null,s=`${a}\0${o.label}\0${r??``}`;i.has(s)||(i.add(s),n.push({...o,id:s,shortcut:e,canonical:r}))}}return n},[g,r]),P=(0,n.useMemo)(()=>S?N.filter(e=>e.scope===S):N,[N,S]),[F,I]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=!1;return Promise.resolve().then(()=>require("./CPSc2VSYZeZ1B9mi.cjs")).then(t=>{e||I(new t.default(P,{threshold:.3,ignoreLocation:!0,keys:[`label`,`description`,`scope`,`scopeLabel`]}))}),()=>{e=!0}},[P]);let[L,R]=(0,n.useState)(N);(0,n.useEffect)(()=>{if(w)return O?void R(P.filter(e=>{if(!e.canonical)return!1;let t=l(e.canonical);if(!O.keys.has(t.key))return!1;for(let e of O.mods)if(!t.mods.has(e))return!1;return!0})):void R(P);F?o.TimerUtils.debounce(()=>{let e=b.trim();e.length===0?R(P):R(F.search(e).map(e=>e.item))},90)():R(P)},[w,O,F,b,P]);let z=(0,n.useMemo)(()=>{let e=new Map;for(let t of L){let n=e.get(t.scope);n||(n=[],e.set(t.scope,n)),n.push(t)}return Array.from(e,([e,t])=>({scope:e,scopeLabel:t[0].scopeLabel,rows:t}))},[L]),B=(0,n.useMemo)(()=>N.find(e=>e.scope===S)?.scopeLabel??S,[N,S]),V=w?!!E:b.length>0,H=V&&L.length===0;(0,n.useEffect)(()=>{M.current?.focus()},[w]);let U=(0,n.useCallback)(e=>{T(e),x(``),D(null),k(null),j(null)},[]),W=(0,n.useCallback)(e=>{if(e.key===`Tab`)return;if(e.which===t.KeyCodes.Escape)return E||A?(D(null),k(null),j(null)):U(!1),e.stopPropagation(),void e.preventDefault();if(e.preventDefault(),e.stopPropagation(),e.key===`Backspace`)return D(null),k(null),void j(null);let n=e.nativeEvent;if(c.has(e.key))return D(null),k(null),void j(m(n));j(null),D((e=>{let t=[];e.ctrlKey&&t.push(`ctrl`),e.altKey&&t.push(`alt`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`meta`);let n=e.code,r=e.key;return n&&(r=n.startsWith(`Key`)&&n.length>3?n.slice(3):n.startsWith(`Digit`)&&n.length>5?n.slice(5):n),{key:r,modifiers:t}})(n)),k((e=>{let n=[...(0,t.keyEventCanonicals)(e)].map(l);return{keys:new Set(n.map(e=>e.key)),mods:n[0]?.mods??new Set}})(n))},[E,A,U]),G=(0,n.useCallback)(e=>{if(E)return;let t=m(e.nativeEvent);j(t.length?t:null)},[E]),K=(0,n.useCallback)(e=>{C(t=>t===e?null:e)},[]),q=(0,n.useCallback)(()=>{w?(D(null),k(null),j(null)):x(``),M.current?.focus()},[w]),J=w?!!(E||A&&A.length>0):b.length>0,Y=(0,i.jsx)(a.Tooltip,{title:w?`Search by name (ESC)`:`Search by shortcut (${u?`Cmd`:`Ctrl`}+K)`,children:(0,i.jsx)(a.IconButton,{"aria-label":`toggle shortcut capture`,color:w?`primary`:`default`,onClick:()=>U(!w),sx:{flexShrink:0,border:e=>`solid 1px ${w?e.palette.primary.main:e.palette.divider}`,borderRadius:e=>`${e.shape.borderRadius}px`},children:(0,i.jsx)(t.DynamicIcon,{iconKey:`Keyboard`})})});return(0,i.jsxs)(a.Box,{style:{height:460,width:`100%`,display:`flex`,flexDirection:`column`},sx:[{fontFamily:e=>e.typography.fontFamily},...Array.isArray(d)?d:[d]],...h,children:[(0,i.jsxs)(a.Box,{sx:{display:`flex`,alignItems:`center`,gap:1,marginBottom:e=>e.spacing(1.5)},children:[(0,i.jsx)(a.TextField,{inputRef:M,slotProps:{input:{sx:{backgroundColor:e=>e.palette.action.hover},startAdornment:w&&(E||A&&A.length>0)?(0,i.jsx)(a.InputAdornment,{position:`start`,sx:{marginRight:`6px`},children:E?(0,i.jsx)(v,{stroke:E}):(0,i.jsx)(_,{labels:p(A).map(f),dangling:!0})}):void 0,endAdornment:J?(0,i.jsx)(a.InputAdornment,{position:`end`,children:(0,i.jsx)(a.IconButton,{"aria-label":w?`clear shortcut`:`clear search`,onClick:q,edge:`end`,size:`small`,children:(0,i.jsx)(t.DynamicIcon,{iconKey:`Close`})})}):void 0},htmlInput:{className:`input`,autoFocus:!0,spellCheck:!1,placeholder:w?E||A&&A.length>0?``:`Press a shortcut… (Esc to exit)`:`Type to search commands, scopes, or descriptions`,autoComplete:`off`,"aria-label":w?`Press a shortcut to find its command`:`Search commands`,sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(1),caretColor:e=>w?e.palette.primary.main:void 0}}},sx:{flex:`1 1 auto`,"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>H?`${e.palette.error.main} !important`:w?`${e.palette.primary.main} !important`:void 0}},value:w?``:b,onChange:e=>{w||x(e.target.value)},onKeyDown:w?W:e=>{if((e.ctrlKey||e.metaKey)&&(e.key===`k`||e.key===`K`))return U(!0),e.stopPropagation(),void e.preventDefault();e.which===t.KeyCodes.Escape&&b.length>0&&(x(``),e.stopPropagation(),e.preventDefault())},onKeyUp:w?G:void 0,onContextMenu:e=>e.stopPropagation()}),Y,(0,i.jsx)(a.FormControlLabel,{sx:{flexShrink:0,marginRight:0},control:(0,i.jsx)(a.Checkbox,{checked:g,onChange:()=>y(!g)}),label:`With key bindings`,labelPlacement:`start`})]}),S&&(0,i.jsx)(a.Box,{sx:{display:`flex`,marginBottom:1},children:(0,i.jsx)(a.Chip,{size:`small`,label:`Scope: ${B}`,onDelete:()=>C(null)})}),(0,i.jsx)(a.Box,{sx:{flex:`1 1 100%`,minHeight:0,borderRadius:e=>`${e.shape.borderRadius}px`,border:e=>`solid ${e.palette.divider} 1px`,overflow:`visible`},children:(0,i.jsx)(a.Box,{sx:{height:`100%`,overflow:`auto`},children:z.length===0?(0,i.jsx)(a.Box,{sx:{padding:3,textAlign:`center`,color:e=>H?e.palette.error.main:e.palette.text.secondary},children:V?`No matching shortcuts`:`No shortcuts`}):z.map(e=>(0,i.jsxs)(a.Box,{children:[(0,i.jsxs)(a.Box,{onClick:()=>K(e.scope),sx:{position:`sticky`,top:`-1px`,zIndex:2,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:1,paddingX:1.5,paddingTop:`5px`,paddingBottom:`4px`,cursor:`pointer`,userSelect:`none`,fontSize:`0.7rem`,fontWeight:600,letterSpacing:`0.04em`,textTransform:`uppercase`,backgroundColor:e=>(0,a.emphasize)(e.palette.background.paper,.04),boxShadow:e=>`0 -2px 0 0 ${(0,a.emphasize)(e.palette.background.paper,.04)}`,borderBottom:e=>`solid 1px ${e.palette.divider}`,color:t=>S===e.scope?t.palette.primary.main:t.palette.text.secondary,"&:hover":{color:e=>e.palette.text.primary,backgroundColor:e=>(0,a.emphasize)(e.palette.background.paper,.09)}},children:[(0,i.jsx)(`span`,{children:e.scopeLabel}),(0,i.jsx)(a.Typography,{component:`span`,sx:{fontSize:`inherit`,opacity:.7},children:e.rows.length})]}),e.rows.map(e=>{return(0,i.jsxs)(a.Box,{sx:{paddingX:1.5,paddingY:.75,borderBottom:e=>`solid 1px ${e.palette.divider}`,"&:hover":{backgroundColor:e=>e.palette.action.hover}},children:[(0,i.jsxs)(a.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,i.jsx)(a.Box,{sx:{flexShrink:0,display:`flex`,alignItems:`center`,width:`var(--icon-size, 20px)`,height:`var(--icon-size, 20px)`,color:e=>e.palette.text.icon??e.palette.action.active},children:(n=e.icon,n&&typeof n!=`string`?n:(0,i.jsx)(t.DynamicIcon,{iconKey:n}))}),(0,i.jsx)(a.Typography,{sx:{flex:`1 1 auto`,fontWeight:500},children:e.label}),e.shortcut&&(0,i.jsx)(a.Box,{sx:{flexShrink:0},children:(0,i.jsx)(v,{stroke:e.shortcut})})]}),e.description&&(0,i.jsx)(a.Typography,{component:`div`,sx:{marginTop:`2px`,marginLeft:`calc(var(--icon-size, 20px) + 8px)`,fontSize:`0.75rem`,whiteSpace:`pre-line`,color:e=>e.palette.text.secondary},children:e.description})]},e.id);var n})]},e.scope))})}),(0,i.jsx)(a.Box,{sx:{display:`flex`,flexShrink:0,paddingLeft:e=>e.spacing(1),paddingTop:e=>e.spacing(1),paddingRight:e=>e.spacing(1),userSelect:`none`,justifyContent:`flex-end`},children:(0,i.jsx)(a.Typography,{noWrap:!0,component:`div`,sx:{color:e=>H?e.palette.error.main:e.palette.text.secondary},children:`${L.length===0?`No`:L.length} shortcut${L.length===1?``:`s`}${V?` found`:``}`})})]})}exports.default=e=>{let{title:n=`Shortcut Keys`,commands:o,sx:s,...c}=e;return(0,i.jsx)(r.InternalWindow,{isModal:!0,onKeyDown:e=>{e.keyCode===t.KeyCodes.F1&&e.preventDefault()},sx:{width:`780px`,...s},title:n,autoFocusSel:`.input`,...c,children:(0,i.jsx)(a.DialogContent,{dividers:!0,children:(0,i.jsx)(y,{commands:o,sx:{marginBottom:`8px`}})})})};
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(o,s,c)=>(c=o==null?{}:e(i(o)),((e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c,l=r(i),u=0,d=l.length;u<d;u++)c=l[u],a.call(e,c)||c===o||t(e,c,{get:(e=>i[e]).bind(null,c),enumerable:!(s=n(i,c))||s.enumerable});return e})(!s&&o&&o.__esModule?c:t(c,`default`,{value:o,enumerable:!0}),o));Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});