@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
@@ -0,0 +1,632 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.10
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { Color as e, VERSION as t } from "@sheetxl/sdk";
8
+ import { useGridColorScheme as r } from "@sheetxl/react";
9
+ import { DynamicIcon as i, ReactUtils as n, useTranslator as o } from "@sheetxl/utils-react";
10
+ import { forwardRef as l, memo as s, useCallback as c, useEffect as d, useLayoutEffect as p, useMemo as u, useRef as m, useState as h } from "react";
11
+ import { ExhibitIconButton as g } from "@sheetxl/utils-mui";
12
+ import { Fragment as f, jsx as x, jsxs as y } from "react/jsx-runtime";
13
+ import { Box as b, Button as v, ButtonBase as w, Chip as k, Divider as C, InputAdornment as M, ListItemIcon as $, ListItemText as A, Menu as R, MenuItem as D, Skeleton as S, TextField as I, Typography as E } from "@mui/material";
14
+ import { listResources as z } from "@sheetxl/utils";
15
+ import L from "clsx";
16
+ var N = (t, r) => {
17
+ if (!t?.color) return null;
18
+ try {
19
+ const i = new e(t.color).toCSS("dark" === r.palette.mode);
20
+ return {
21
+ fill: i,
22
+ text: r.palette.getContrastText(i)
23
+ };
24
+ } catch {
25
+ return null;
26
+ }
27
+ }, T = "8 / 5", U = (e) => {
28
+ const { entry: t, category: i } = e, n = ("dark" === r() ? t.thumbnailDarkUrl : void 0) ?? t.thumbnailUrl;
29
+ return x(K, {
30
+ src: n,
31
+ category: i
32
+ }, n);
33
+ }, K = (e) => {
34
+ const { src: t, category: r } = e, [n, o] = h(t ? "loading" : "failed");
35
+ return y(b, {
36
+ className: "template-thumbnail",
37
+ sx: {
38
+ position: "relative",
39
+ width: "100%",
40
+ aspectRatio: T,
41
+ overflow: "hidden",
42
+ borderRadius: 1,
43
+ border: (e) => `1px solid ${e.palette.divider}`,
44
+ background: (e) => e.palette.background.paper,
45
+ transition: "border-color 150ms, box-shadow 150ms",
46
+ display: "flex",
47
+ alignItems: "center",
48
+ justifyContent: "center"
49
+ },
50
+ children: ["failed" === n ? x(i, {
51
+ iconKey: "FileNew",
52
+ style: {
53
+ fontSize: "2.5rem",
54
+ opacity: .4
55
+ }
56
+ }) : x("img", {
57
+ src: t,
58
+ alt: "",
59
+ loading: "lazy",
60
+ draggable: !1,
61
+ onLoad: () => o("loaded"),
62
+ onError: () => o("failed"),
63
+ style: {
64
+ width: "100%",
65
+ height: "100%",
66
+ objectFit: "cover",
67
+ objectPosition: "top left",
68
+ opacity: "loaded" === n ? 1 : 0,
69
+ transition: "opacity 150ms ease-out"
70
+ }
71
+ }), r?.color ? x(b, { sx: (e) => ({
72
+ position: "absolute",
73
+ top: 0,
74
+ left: 0,
75
+ right: 0,
76
+ height: "3px",
77
+ backgroundColor: N(r, e)?.fill
78
+ }) }) : null]
79
+ });
80
+ }, W = (e) => {
81
+ const { entry: t, category: r, onSelect: i } = e;
82
+ return y(w, {
83
+ className: "template-tile",
84
+ disableRipple: !0,
85
+ onClick: i,
86
+ "aria-label": r ? `${t.title}, ${r.title}` : t.title,
87
+ title: t.description,
88
+ sx: {
89
+ display: "flex",
90
+ flexDirection: "column",
91
+ alignItems: "stretch",
92
+ textAlign: "left",
93
+ gap: .75,
94
+ padding: 1,
95
+ borderRadius: 1,
96
+ "&:hover .template-thumbnail, &.Mui-focusVisible .template-thumbnail": {
97
+ borderColor: (e) => e.palette.primary.main,
98
+ boxShadow: 3
99
+ },
100
+ "&.Mui-focusVisible": {
101
+ outline: (e) => `2px solid ${e.palette.primary.main}`,
102
+ outlineOffset: "-2px"
103
+ }
104
+ },
105
+ children: [x(U, {
106
+ entry: t,
107
+ category: r
108
+ }), y(b, {
109
+ sx: { minWidth: 0 },
110
+ children: [x(E, {
111
+ variant: "subtitle2",
112
+ component: "div",
113
+ noWrap: !0,
114
+ children: t.title
115
+ }), r ? y(E, {
116
+ variant: "caption",
117
+ component: "div",
118
+ noWrap: !0,
119
+ sx: {
120
+ color: "text.secondary",
121
+ display: "flex",
122
+ alignItems: "center",
123
+ gap: .75
124
+ },
125
+ children: [r.color ? x(b, {
126
+ component: "span",
127
+ sx: (e) => ({
128
+ width: "8px",
129
+ height: "8px",
130
+ borderRadius: "50%",
131
+ flex: "none",
132
+ backgroundColor: N(r, e)?.fill
133
+ })
134
+ }) : null, x(b, {
135
+ component: "span",
136
+ sx: {
137
+ overflow: "hidden",
138
+ textOverflow: "ellipsis"
139
+ },
140
+ children: r.title
141
+ })]
142
+ }) : null]
143
+ })]
144
+ });
145
+ }, P = () => y(b, {
146
+ sx: {
147
+ padding: 1,
148
+ display: "flex",
149
+ flexDirection: "column",
150
+ gap: .75
151
+ },
152
+ children: [
153
+ x(S, {
154
+ variant: "rectangular",
155
+ sx: {
156
+ width: "100%",
157
+ height: "auto",
158
+ aspectRatio: T,
159
+ borderRadius: 1
160
+ }
161
+ }),
162
+ x(S, {
163
+ variant: "text",
164
+ width: "60%"
165
+ }),
166
+ x(S, {
167
+ variant: "text",
168
+ width: "35%"
169
+ })
170
+ ]
171
+ }), F = s(l((e, t) => {
172
+ const { catalog: r, onSelect: i, filter: a, groupBy: l, renderTile: s, tileMinWidth: c = 180, emptyLabel: g, visibleRows: f, sx: w = n.EmptyCssProperties, style: k, className: C, onKeyDown: M, ...$ } = e, A = o(), R = m(null), [D, S] = h(0), I = m(null);
173
+ I.current = () => {
174
+ const e = R.current?.querySelector(".template-grid")?.firstElementChild, t = (e?.offsetHeight ? e : e?.firstElementChild)?.getBoundingClientRect().height;
175
+ t && S(t);
176
+ }, p(() => {
177
+ f && I.current?.();
178
+ }), d(() => {
179
+ const e = R.current;
180
+ if (!f || !e) return;
181
+ const t = new ResizeObserver(() => I.current?.());
182
+ return t.observe(e), () => t.disconnect();
183
+ }, [f]);
184
+ const z = u(() => new Map(r.categories.map((e) => [e.id, e])), [r.categories]), N = u(() => {
185
+ const e = a ? r.entries.filter(a) : r.entries;
186
+ if (!l) return [{
187
+ key: null,
188
+ entries: e
189
+ }];
190
+ const t = /* @__PURE__ */ new Map();
191
+ for (const e of r.categories) t.set(e.id, []);
192
+ for (const r of e) {
193
+ const e = l(r);
194
+ let i = t.get(e);
195
+ i || t.set(e, i = []), i.push(r);
196
+ }
197
+ return [...t].filter(([, e]) => e.length > 0).map(([e, t]) => ({
198
+ key: e,
199
+ title: z.get(e)?.title ?? e,
200
+ entries: t
201
+ }));
202
+ }, [
203
+ r.entries,
204
+ r.categories,
205
+ z,
206
+ a,
207
+ l
208
+ ]), T = {
209
+ display: "grid",
210
+ gridTemplateColumns: `repeat(auto-fill, minmax(${c}px, 1fr))`,
211
+ gap: "8px"
212
+ };
213
+ let U;
214
+ return U = "loading" === r.status ? x(b, {
215
+ className: "template-grid",
216
+ sx: T,
217
+ "aria-busy": "true",
218
+ "aria-label": A("template.loading"),
219
+ children: Array.from({ length: 6 }, (e, t) => x(P, {}, t))
220
+ }) : "error" === r.status ? y(b, {
221
+ sx: {
222
+ display: "flex",
223
+ flexDirection: "column",
224
+ alignItems: "center",
225
+ gap: 1,
226
+ padding: 4,
227
+ textAlign: "center"
228
+ },
229
+ children: [x(E, {
230
+ variant: "body2",
231
+ sx: { color: "text.secondary" },
232
+ children: A("template.loadFailed")
233
+ }), x(v, {
234
+ variant: "outlined",
235
+ size: "small",
236
+ onClick: r.retry,
237
+ children: A("template.retry")
238
+ })]
239
+ }) : N.every((e) => 0 === e.entries.length) ? x(E, {
240
+ variant: "body2",
241
+ sx: {
242
+ color: "text.secondary",
243
+ padding: 4,
244
+ textAlign: "center"
245
+ },
246
+ children: g ?? A("template.empty")
247
+ }) : N.map((e) => y(b, {
248
+ role: "group",
249
+ "aria-label": e.title,
250
+ children: [e.title ? x(E, {
251
+ variant: "overline",
252
+ component: "div",
253
+ sx: {
254
+ color: "text.secondary",
255
+ paddingX: 1
256
+ },
257
+ children: e.title
258
+ }) : null, x(b, {
259
+ className: "template-grid",
260
+ sx: T,
261
+ children: e.entries.map((e) => {
262
+ const t = {
263
+ category: z.get(e.category),
264
+ onSelect: () => i?.(e)
265
+ };
266
+ return s ? x(b, {
267
+ sx: { display: "contents" },
268
+ children: s(e, t)
269
+ }, e.id) : x(W, {
270
+ entry: e,
271
+ ...t
272
+ }, e.id);
273
+ })
274
+ })]
275
+ }, e.key ?? "")), x(b, {
276
+ ref: t,
277
+ className: L(C, "template-panel"),
278
+ sx: w,
279
+ style: f && D ? {
280
+ boxSizing: "content-box",
281
+ scrollbarGutter: "stable",
282
+ height: `${Math.ceil(f * D + 8 * (f - 1))}px`,
283
+ minHeight: `${Math.ceil(D)}px`,
284
+ ...k
285
+ } : k,
286
+ ...$,
287
+ children: x(b, {
288
+ ref: R,
289
+ onKeyDown: (e) => {
290
+ if (M?.(e), e.defaultPrevented) return;
291
+ const t = R.current;
292
+ if (!t) return;
293
+ const r = Array.from(t.querySelectorAll(".template-tile")), i = r.indexOf(document.activeElement);
294
+ if (i < 0) return;
295
+ const n = r[i].offsetTop, o = r.findIndex((e) => e.offsetTop === n && e.parentElement === r[i].parentElement);
296
+ let a = 0;
297
+ for (; r[o + a]?.offsetTop === n;) a++;
298
+ let l = i;
299
+ switch (e.key) {
300
+ case "ArrowRight":
301
+ l = i + 1;
302
+ break;
303
+ case "ArrowLeft":
304
+ l = i - 1;
305
+ break;
306
+ case "ArrowDown":
307
+ l = i + Math.max(1, a);
308
+ break;
309
+ case "ArrowUp":
310
+ l = i - Math.max(1, a);
311
+ break;
312
+ case "Home":
313
+ l = 0;
314
+ break;
315
+ case "End":
316
+ l = r.length - 1;
317
+ break;
318
+ default: return;
319
+ }
320
+ l = Math.max(0, Math.min(r.length - 1, l)), e.preventDefault(), r[l].focus();
321
+ },
322
+ children: U
323
+ })
324
+ });
325
+ }));
326
+ F.displayName = "TemplatePanel";
327
+ var B = (e, t, r) => u(() => {
328
+ if (!t.trim() && 0 === r.length) return;
329
+ const i = new Map(e.map((e) => [e.id, e])), n = r.length > 0 ? new Set(r) : null;
330
+ return (e) => !(n && !n.has(e.category)) && ((e, t, r) => {
331
+ const i = t.trim().toLowerCase();
332
+ return !i || [
333
+ e.title,
334
+ e.description,
335
+ r?.title,
336
+ ...e.tags ?? []
337
+ ].some((e) => e?.toLowerCase().includes(i));
338
+ })(e, t, i.get(e.category));
339
+ }, [
340
+ e,
341
+ t,
342
+ r
343
+ ]), H = [], O = (e) => {
344
+ const { category: t } = e;
345
+ return x(b, {
346
+ component: "span",
347
+ sx: (e) => ({
348
+ display: "inline-block",
349
+ width: "10px",
350
+ height: "10px",
351
+ borderRadius: "50%",
352
+ flex: "none",
353
+ backgroundColor: N(t, e)?.fill ?? e.palette.action.selected
354
+ })
355
+ });
356
+ }, j = (e) => {
357
+ const { category: t, onDelete: r } = e;
358
+ return x(k, {
359
+ size: "small",
360
+ label: t.title,
361
+ title: t.description,
362
+ onDelete: r,
363
+ sx: (e) => {
364
+ const r = N(t, e);
365
+ return {
366
+ marginY: .25,
367
+ marginRight: .5,
368
+ maxWidth: "160px",
369
+ ...r ? {
370
+ backgroundColor: r.fill,
371
+ color: r.text,
372
+ "& .MuiChip-deleteIcon": {
373
+ color: r.text,
374
+ opacity: .7
375
+ },
376
+ "& .MuiChip-deleteIcon:hover": {
377
+ color: r.text,
378
+ opacity: 1
379
+ },
380
+ "&.Mui-focusVisible": {
381
+ backgroundColor: r.fill,
382
+ outline: `2px solid ${e.palette.primary.main}`,
383
+ outlineOffset: "1px"
384
+ }
385
+ } : void 0
386
+ };
387
+ }
388
+ });
389
+ }, V = (e) => {
390
+ const { value: t, onChange: r, categories: n, categoryIds: a = H, onCategoryIdsChange: l, sx: s } = e, c = o(), d = m(null), [p, b] = h(null), v = !!l && (n?.length ?? 0) > 1, k = u(() => {
391
+ if (!v || 0 === a.length) return [];
392
+ const e = new Map(n.map((e) => [e.id, e]));
393
+ return a.map((t) => e.get(t)).filter((e) => !!e);
394
+ }, [
395
+ v,
396
+ n,
397
+ a
398
+ ]), S = (e) => {
399
+ l?.(e), d.current?.focus();
400
+ }, E = () => {
401
+ b(null), d.current?.focus();
402
+ }, z = x(i, { iconKey: "Find" });
403
+ let L = x(M, {
404
+ position: "start",
405
+ children: z
406
+ });
407
+ if (v) {
408
+ const e = c("template.filterByCategory");
409
+ L = y(f, { children: [x(M, {
410
+ position: "start",
411
+ sx: { marginRight: .5 },
412
+ children: y(w, {
413
+ "aria-label": e,
414
+ title: e,
415
+ "aria-haspopup": "menu",
416
+ "aria-expanded": !!p,
417
+ onMouseDown: (e) => {
418
+ 0 === e.button && e.preventDefault();
419
+ },
420
+ onClick: (e) => b(e.currentTarget),
421
+ sx: {
422
+ display: "flex",
423
+ alignItems: "center",
424
+ marginLeft: -.75,
425
+ paddingX: .25,
426
+ paddingY: .25,
427
+ borderRadius: 1,
428
+ color: "inherit",
429
+ "&:hover, &.Mui-focusVisible": { backgroundColor: "action.hover" }
430
+ },
431
+ children: [z, x(i, {
432
+ iconKey: "ExpandMore",
433
+ style: {
434
+ fontSize: "1rem",
435
+ marginLeft: "-2px"
436
+ }
437
+ })]
438
+ })
439
+ }), k.map((e) => x(j, {
440
+ category: e,
441
+ onDelete: () => S(a.filter((t) => t !== e.id))
442
+ }, e.id))] });
443
+ }
444
+ const N = !!t || k.length > 0;
445
+ return y(f, { children: [x(I, {
446
+ size: "small",
447
+ value: t,
448
+ placeholder: k.length > 0 ? void 0 : c("template.search"),
449
+ inputRef: d,
450
+ onChange: (e) => r(e.target.value),
451
+ onKeyDown: (e) => {
452
+ if ("Escape" === e.key && N) e.stopPropagation(), t ? r("") : S([]);
453
+ else if ("Backspace" === e.key && k.length > 0) {
454
+ const t = d.current;
455
+ e.target === t && 0 === t.selectionStart && 0 === t.selectionEnd && (e.preventDefault(), S(a.slice(0, -1)));
456
+ }
457
+ },
458
+ sx: s,
459
+ slotProps: {
460
+ input: {
461
+ sx: {
462
+ backgroundColor: "background.paper",
463
+ flexWrap: "wrap",
464
+ paddingY: "6px",
465
+ paddingRight: N ? "40px" : void 0,
466
+ "& .MuiInputBase-input": {
467
+ flex: "1 1 60px",
468
+ minWidth: "60px",
469
+ width: 0,
470
+ height: "28px",
471
+ paddingY: 0
472
+ },
473
+ "& .MuiInputAdornment-positionStart": {
474
+ height: "28px",
475
+ maxHeight: "none"
476
+ },
477
+ "& .MuiInputAdornment-positionEnd": {
478
+ position: "absolute",
479
+ right: "8px",
480
+ top: "6px",
481
+ height: "28px",
482
+ maxHeight: "none",
483
+ marginLeft: 0
484
+ }
485
+ },
486
+ startAdornment: L,
487
+ endAdornment: N ? x(M, {
488
+ position: "end",
489
+ children: x(g, {
490
+ "aria-label": c("template.clearSearch"),
491
+ propsTooltip: { label: c("template.clearSearch") },
492
+ onMouseDown: (e) => {
493
+ 0 === e.button && e.preventDefault();
494
+ },
495
+ onClick: () => {
496
+ r(""), S([]);
497
+ },
498
+ icon: x(i, { iconKey: "Close" }),
499
+ size: "small"
500
+ })
501
+ }) : void 0
502
+ },
503
+ htmlInput: {
504
+ spellCheck: !1,
505
+ autoComplete: "off",
506
+ "aria-label": c("template.search")
507
+ }
508
+ }
509
+ }), v ? y(R, {
510
+ anchorEl: p,
511
+ open: !!p,
512
+ onClose: E,
513
+ disableRestoreFocus: !0,
514
+ slotProps: { list: {
515
+ dense: !0,
516
+ "aria-label": c("dialog.template.categories")
517
+ } },
518
+ children: [n.map((e) => {
519
+ const t = a.includes(e.id);
520
+ return y(D, {
521
+ selected: t,
522
+ title: e.description,
523
+ onClick: () => {
524
+ l(t ? a.filter((t) => t !== e.id) : [...a, e.id]), E();
525
+ },
526
+ children: [
527
+ x($, { children: x(O, { category: e }) }),
528
+ x(A, { children: e.title }),
529
+ t ? x(i, {
530
+ iconKey: "Check",
531
+ style: {
532
+ fontSize: "1rem",
533
+ marginLeft: "16px"
534
+ }
535
+ }) : null
536
+ ]
537
+ }, e.id);
538
+ }), k.length > 0 ? [x(C, {}, "divider"), y(D, {
539
+ onClick: () => {
540
+ l([]), E();
541
+ },
542
+ children: [x($, {}), x(A, { children: c("template.allCategories") })]
543
+ }, "all")] : null]
544
+ }) : null] });
545
+ }, Y = "local" === t ? "beta" : /^\d+\.\d+\.\d+-([0-9A-Za-z-]+)/.exec(t)?.[1], q = `https://unpkg.com/@sheetxl/templates-workbook${Y ? `@${Y}` : ""}/dist`, X = "templates-workbook", Z = (e) => e.replace(/\.[^/.]+$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), G = (e, t) => {
546
+ const r = `${e}${e.endsWith("/") ? "" : "/"}${X}/${t}`;
547
+ return "undefined" == typeof document ? r : new URL(r, document.baseURI).href;
548
+ }, _ = (e) => "string" == typeof e && e ? e : void 0, J = /* @__PURE__ */ new Map(), Q = (e = q) => {
549
+ let t = J.get(e);
550
+ return t || (t = (async () => {
551
+ const t = (await z("templates", X, e)).find((e) => void 0 !== e.meta?.schema);
552
+ if (!t) throw new Error(`No template catalog found at '${e}'.`);
553
+ return 1 !== Math.floor(Number(t.meta?.schema)) ? (console.warn(`Template catalog at '${e}' has schema ${t.meta?.schema}; expected 1.`), {
554
+ categories: [],
555
+ entries: []
556
+ }) : ((e, t) => {
557
+ const r = Array.isArray(e.meta?.categories) ? e.meta.categories : [], i = [], n = /* @__PURE__ */ new Set();
558
+ for (const e of r) {
559
+ const t = _(e?.id);
560
+ t && !n.has(t) && (n.add(t), i.push({
561
+ id: t,
562
+ title: _(e.title) ?? Z(t),
563
+ description: _(e.description),
564
+ icon: _(e.icon),
565
+ color: _(e.color)
566
+ }));
567
+ }
568
+ const o = [];
569
+ for (const r of e.entries) {
570
+ const e = r.path, a = e.split("/");
571
+ if (2 !== a.length || !/\.(?:xlsx|sxl|csv)$/i.test(e)) continue;
572
+ const l = _(r.category) ?? a[0];
573
+ n.has(l) || (n.add(l), i.push({
574
+ id: l,
575
+ title: Z(l)
576
+ }));
577
+ const s = _(r.thumbnail), c = _(r.thumbnailDark);
578
+ o.push({
579
+ id: e,
580
+ title: _(r.title) ?? Z(a[1]),
581
+ category: l,
582
+ description: _(r.description),
583
+ tags: Array.isArray(r.tags) ? r.tags.filter((e) => "string" == typeof e) : void 0,
584
+ thumbnailUrl: s ? G(t, s) : void 0,
585
+ thumbnailDarkUrl: c ? G(t, c) : void 0,
586
+ sourceUrl: G(t, e)
587
+ });
588
+ }
589
+ return {
590
+ categories: i,
591
+ entries: o
592
+ };
593
+ })(t, e);
594
+ })(), J.set(e, t), t.catch(() => {
595
+ J.delete(e);
596
+ })), t;
597
+ }, ee = (e = {}) => {
598
+ const { path: t = q } = e, [r, i] = h(0), [n, o] = h({
599
+ status: "loading",
600
+ categories: [],
601
+ entries: []
602
+ });
603
+ d(() => {
604
+ let e = !1;
605
+ return o((e) => "loading" === e.status ? e : {
606
+ status: "loading",
607
+ categories: [],
608
+ entries: []
609
+ }), Q(t).then((t) => {
610
+ e || o({
611
+ status: "ready",
612
+ ...t
613
+ });
614
+ }, (t) => {
615
+ e || o({
616
+ status: "error",
617
+ categories: [],
618
+ entries: [],
619
+ error: t
620
+ });
621
+ }), () => {
622
+ e = !0;
623
+ };
624
+ }, [t, r]);
625
+ return {
626
+ ...n,
627
+ retry: c(() => {
628
+ i((e) => e + 1);
629
+ }, [])
630
+ };
631
+ };
632
+ export { F as a, B as i, ee as n, V as r, Q as t };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.1
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.10
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.