@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.
- package/browser/esm/{Cd6n1XUgF0VItpkH.mjs → 5cbK03T_Oh3tNdR7.mjs} +7 -5
- package/browser/esm/{Bz5LiUe3SZ8g42Ia.mjs → 9eKCkvqpMQwqcXiw.mjs} +1 -1
- package/browser/esm/B1Yp_uy1vFHcJB3U.mjs +13 -0
- package/browser/esm/Biy7bhzzzPb5sfRN.mjs +152 -0
- package/browser/esm/Blaj2R5hYxtLAW__.mjs +117 -0
- package/browser/esm/{ChwS_ougBsogOEsP.mjs → ByeL_BZuJ2kl8gtf.mjs} +46 -47
- package/browser/esm/{BUGepznywvV0tUjW.mjs → C1Rp2hZrApo5MUc8.mjs} +2 -2
- package/browser/esm/{DMLXV4EKl1NCp_jk.mjs → CEvZe2cZK-voZTif.mjs} +5 -5
- package/browser/esm/{BZBJG2tDdD3-VujP.mjs → CIu1bjPJe_x31Oww.mjs} +195 -174
- package/browser/esm/COv-m-c2byCgvU3M.mjs +14861 -0
- package/browser/esm/CjznclrKqJRi7u9O.mjs +77 -0
- package/browser/esm/{Cj2pgCNqBCGl4rTX.mjs → CoSiOS-og0zFw4Ws.mjs} +587 -556
- package/browser/esm/{rU8xNPVQtDSnujM-.mjs → CtEFHbzYNvYjDYvi.mjs} +7 -7
- package/browser/esm/D6S8kVTzOjCn0-SK.mjs +627 -0
- package/browser/esm/{DNDrQKMTzKzNMjl-.mjs → D8al_cJ4U-NgzwoK.mjs} +1 -1
- package/browser/esm/DBtc4lku0uHVcqWn.mjs +71 -0
- package/browser/esm/{BoLxSRdEWt-Yg2RI.mjs → DHY19rkSiiRZxShC.mjs} +130 -103
- package/browser/esm/{zWTZ8BvT4hjgC2ua.mjs → DU3J8Gcf-WpBxNYg.mjs} +11 -10
- package/browser/esm/Die9NXVFveHvcCT-.mjs +4205 -0
- package/browser/esm/{CVfuCNRpODUw04IH.mjs → DmCQbW4zwkT_Rq88.mjs} +1 -1
- package/browser/esm/IQLeaAbtGTipUsOD.mjs +516 -0
- package/browser/esm/{3ydDykDMtDYbfVVn.mjs → X1Db3b_7b_7OuCk6.mjs} +178 -129
- package/browser/esm/fb126BNj3F8URR19.mjs +225 -0
- package/browser/esm/index.mjs +418 -135
- package/browser/esm/sFOAxZpxXo-qvDSp.mjs +293 -0
- package/browser/esm/sam1KGQZ59B_fADz.mjs +1941 -0
- package/browser/esm/xKiLJKiLxto8SayF.mjs +256 -0
- package/browser/esm/yZxC4qUENOlMhVUH.mjs +68 -0
- package/licenses/dependencies.txt +58 -311
- package/node/esm/B8SQfjKjzYHLxzZR.mjs +632 -0
- package/node/esm/{DM7K7-284z-PczVz.mjs → BYVLi0md4AYuDsB_.mjs} +1 -1
- package/node/esm/BYsG3KYVmxSe_CIQ.mjs +294 -0
- package/node/esm/BYwXhrEwkRAt9nJS.mjs +71 -0
- package/node/esm/B_jRGdwGFkudwmL-.mjs +68 -0
- package/node/esm/Bb1sLMqXWKjdve23.mjs +77 -0
- package/node/esm/{BwZcoHDBmLPIVOT5.mjs → BcwMb6CyVfvEwbHn.mjs} +69 -70
- package/node/esm/{BhqI3pQFkV8K_612.mjs → CKu1AtRgyltyEdEN.mjs} +1 -1
- package/node/esm/Cmt8Wv806N7NmE4Y.mjs +3344 -0
- package/node/esm/{DXZrzWee8K5FPOW1.mjs → D6oQL8knsPpgdXuk.mjs} +2 -2
- package/node/esm/{BA7VzUQ2sKRLTZ5c.mjs → D9rzScOA9pEYFrtz.mjs} +1 -1
- package/node/esm/DNSjK5DAH3M14Qbc.mjs +521 -0
- package/node/esm/{CUMKTjYv6VTkcWYi.mjs → DZzvTQxIKr9LbEsA.mjs} +1 -1
- package/node/esm/{Qpuqm6xBr_da38Ht.mjs → ETK6T6G0SIcFXDe5.mjs} +163 -135
- package/node/esm/ah3CUg4-VmNstGk_.mjs +256 -0
- package/node/esm/{CHi3AuWEwEPOg9IZ.mjs → ci8d-mF1H9wnYzix.mjs} +1 -1
- package/node/esm/cqzp431iNSLWictb.mjs +116 -0
- package/node/esm/index.mjs +14783 -6793
- package/package.json +15 -18
- package/resources/locales/de/groups.cmd.json +29 -16
- package/resources/locales/de/studio.cmd.json +18 -1
- package/resources/locales/de/ui.msg.json +350 -40
- package/resources/locales/en/groups.cmd.json +39 -17
- package/resources/locales/en/studio.cmd.json +18 -1
- package/resources/locales/en/ui.msg.json +306 -40
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +17 -1
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +14 -0
- package/types/src/anchorItems/AnchoredRangeField.d.ts +40 -0
- package/types/src/anchorItems/index.d.ts +1 -0
- package/types/src/border/BorderPopupButton.d.ts +6 -6
- package/types/src/border/BorderStylePopupButton.d.ts +3 -3
- package/types/src/border/BorderTemplateIcon.d.ts +24 -0
- package/types/src/border/index.d.ts +1 -0
- package/types/src/color/ColorPanel.d.ts +8 -2
- package/types/src/color/ColorPopupButton.d.ts +2 -1
- package/types/src/command/NumberFormatQuickButtons.d.ts +32 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +3 -3
- package/types/src/command/SheetZoomCommandButton.d.ts +4 -3
- package/types/src/comments/CommentCard.d.ts +41 -0
- package/types/src/comments/CommentsPlugin.d.ts +6 -0
- package/types/src/comments/CommentsTaskPane.d.ts +23 -0
- package/types/src/comments/index.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +4 -4
- package/types/src/conditionalFormat/IconPickerPopupButton.d.ts +2 -2
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +1 -1
- package/types/src/conditions/BetweenOption.d.ts +6 -1
- package/types/src/conditions/CombinatorOption.d.ts +7 -0
- package/types/src/conditions/ConditionEditor.d.ts +61 -4
- package/types/src/conditions/ConditionUtils.d.ts +65 -6
- package/types/src/conditions/ExpressionOption.d.ts +12 -6
- package/types/src/conditions/MembershipOption.d.ts +67 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +36 -1
- package/types/src/conditions/ScalarOption.d.ts +25 -6
- package/types/src/conditions/SelectorSelect.d.ts +16 -7
- package/types/src/conditions/index.d.ts +1 -1
- package/types/src/conditions/useFormulaOption.d.ts +54 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +7 -1
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -2
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +13 -2
- package/types/src/dataValidation/DataValidationIcon.d.ts +22 -0
- package/types/src/dataValidation/DataValidationTitle.d.ts +13 -0
- package/types/src/dialog/FillSeriesDialog.d.ts +16 -0
- package/types/src/dialog/OutlineSettingsDialog.d.ts +12 -0
- package/types/src/dialog/TableNewDialog.d.ts +1 -4
- package/types/src/dialog/_ShortcutSearch.d.ts +26 -0
- package/types/src/dialog/index.d.ts +0 -2
- package/types/src/externalLink/ExternalLinkCardBody.d.ts +9 -0
- package/types/src/externalLink/ExternalLinkChip.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkLocation.d.ts +18 -0
- package/types/src/externalLink/ExternalLinkSettingsTab.d.ts +18 -0
- package/types/src/externalLink/ExternalLinksPanel.d.ts +11 -0
- package/types/src/externalLink/ExternalLinksPlugin.d.ts +5 -0
- package/types/src/externalLink/ExternalLinksTaskPane.d.ts +19 -0
- package/types/src/externalLink/index.d.ts +8 -0
- package/types/src/fill/GradientEditor.d.ts +41 -0
- package/types/src/fill/GradientStopsBar.d.ts +43 -0
- package/types/src/fill/PatternPopupButton.d.ts +26 -0
- package/types/src/fill/PatternSwatch.d.ts +53 -0
- package/types/src/fill/index.d.ts +5 -0
- package/types/src/filter/ColumnMenu.d.ts +31 -1
- package/types/src/filter/index.d.ts +0 -1
- package/types/src/form/FormulaField.d.ts +35 -6
- package/types/src/form/InputField.d.ts +35 -5
- package/types/src/format/AlignmentPanel.d.ts +13 -0
- package/types/src/format/BorderPanel.d.ts +22 -0
- package/types/src/format/BorderPreview.d.ts +94 -0
- package/types/src/format/FillPanel.d.ts +65 -0
- package/types/src/format/FontPanel.d.ts +12 -0
- package/types/src/format/FormatCellPreview.d.ts +35 -0
- package/types/src/format/FormatPanelParts.d.ts +85 -0
- package/types/src/format/FormatPlugin.d.ts +11 -0
- package/types/src/format/FormatTaskPane.d.ts +39 -0
- package/types/src/format/LinePanel.d.ts +53 -0
- package/types/src/format/LinePreviews.d.ts +71 -0
- package/types/src/format/NumberFormatOption.d.ts +43 -0
- package/types/src/{numberFormat → format}/NumberFormatPanel.d.ts +20 -0
- package/types/src/format/index.d.ts +14 -0
- package/types/src/format/useFormatSelection.d.ts +93 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +11 -0
- package/types/src/formulaBar/MobileFormulaBar.d.ts +21 -0
- package/types/src/formulaBar/MobileInputToolbar.d.ts +37 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/formulaBar/useFormulaBarSession.d.ts +65 -0
- package/types/src/index.d.ts +7 -1
- package/types/src/itemsPanel/EditorCommit.d.ts +32 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +4 -1
- package/types/src/itemsPanel/ItemCard.d.ts +60 -8
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +68 -19
- package/types/src/itemsPanel/ItemsPanel.d.ts +9 -0
- package/types/src/itemsPanel/ItemsSearchField.d.ts +17 -0
- package/types/src/itemsPanel/index.d.ts +2 -0
- package/types/src/named/NamedDetailsPanel.d.ts +9 -2
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -2
- package/types/src/named/NamedEditorPanel.d.ts +1 -1
- package/types/src/named/NamedExpressionField.d.ts +32 -0
- package/types/src/named/NamedKindChip.d.ts +38 -0
- package/types/src/picture/PicturePlugin.d.ts +6 -0
- package/types/src/picture/index.d.ts +2 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +6 -0
- package/types/src/protectedRange/ProtectedRangeDraft.d.ts +22 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +0 -14
- package/types/src/protectedRange/index.d.ts +2 -1
- package/types/src/protection/ManageProtectionTaskPane.d.ts +29 -0
- package/types/src/protection/PasswordDialog.d.ts +32 -0
- package/types/src/protection/PasswordField.d.ts +35 -0
- package/types/src/protection/ProtectedCellsPanel.d.ts +20 -0
- package/types/src/protection/ProtectionPlugin.d.ts +11 -0
- package/types/src/protection/SheetProtectionPanel.d.ts +35 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +34 -15
- package/types/src/protection/WorkbookProtectionTab.d.ts +22 -0
- package/types/src/protection/index.d.ts +7 -1
- package/types/src/shape/InsertShapeCommandButton.d.ts +20 -0
- package/types/src/shape/ShapeFormatPanel.d.ts +11 -0
- package/types/src/shape/ShapePlugin.d.ts +6 -0
- package/types/src/shape/index.d.ts +3 -0
- package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +18 -0
- package/types/src/slicer/SlicerPlugin.d.ts +6 -0
- package/types/src/slicer/index.d.ts +3 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +6 -0
- package/types/src/studio/CommandsWrapper.d.ts +5 -0
- package/types/src/studio/EagerStudio.d.ts +14 -1
- package/types/src/studio/StudioCommandProvider.d.ts +10 -0
- package/types/src/studio/StudioCommands.d.ts +40 -4
- package/types/src/studio/StudioProps.d.ts +64 -2
- package/types/src/studio/StudioSplitPane.d.ts +1 -1
- package/types/src/studio/formulaBarPlacement.d.ts +35 -0
- package/types/src/studio/splitStudioProps.d.ts +7 -0
- package/types/src/studio/useStudioApp.d.ts +31 -18
- package/types/src/template/TemplateCommands.d.ts +29 -0
- package/types/src/template/TemplateDialog.d.ts +19 -0
- package/types/src/template/TemplatePanel.d.ts +50 -0
- package/types/src/template/TemplateSearchField.d.ts +29 -0
- package/types/src/template/WelcomeDialog.d.ts +29 -0
- package/types/src/template/categoryColor.d.ts +8 -0
- package/types/src/template/index.d.ts +3 -0
- package/types/src/template/useTemplateCatalog.d.ts +71 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +1 -1
- package/types/src/workbook/DefaultRenderers.d.ts +15 -1
- package/types/src/workbook/FillMenu.d.ts +21 -0
- package/types/src/workbook/OutlineButtons.d.ts +11 -0
- package/types/src/workbook/WorkbookElement.d.ts +1 -1
- package/types/src/workbook/index.d.ts +1 -0
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +0 -20
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +0 -1
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +0 -1
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +0 -2
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +0 -2
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
- package/browser/cjs/Bte6P3MhSjajJmmY.cjs +0 -7
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +0 -1
- package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +0 -1
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +0 -1
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +0 -1
- package/browser/cjs/CYxc8vnRi8dNpDPk.cjs +0 -1
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +0 -1
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +0 -1
- package/browser/cjs/Cm1APq2MraYNNhyI.cjs +0 -1
- package/browser/cjs/DO8V31Z1ewgMA1di.cjs +0 -5
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +0 -1
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +0 -1
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +0 -1
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +0 -1
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +0 -1
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +0 -1
- package/browser/cjs/index.cjs +0 -2
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +0 -1
- package/browser/cjs/z0rB4fK6X1M6PpVD.cjs +0 -11
- package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +0 -1
- package/browser/esm/BuY3uV47Bwbqpasq.mjs +0 -219
- package/browser/esm/CAs1MWvJTcRfJy26.mjs +0 -217
- package/browser/esm/CBU3LgLYmqtQjJbu.mjs +0 -1150
- package/browser/esm/CDU0rqpLNVtMLI-f.mjs +0 -52
- package/browser/esm/CVBub6pgTsJzCc5m.mjs +0 -5429
- package/browser/esm/C_XvSsQ9BVdHffCO.mjs +0 -47
- package/browser/esm/FT29q8yNwsEpVZjt.mjs +0 -9257
- package/browser/esm/Hb1rlHT4tE5hLcjM.mjs +0 -82
- package/browser/esm/UJOXCQv6KrG1gY3l.mjs +0 -105
- package/browser/esm/s46El7mT6oKLSnYB.mjs +0 -411
- package/node/esm/9FY82fj1R1c-AczW.mjs +0 -47
- package/node/esm/C-boHCnJditFzng3.mjs +0 -106
- package/node/esm/DxXM8qHi0Oz4Zovl.mjs +0 -4575
- package/node/esm/sQt2wWGTRLzqeJdG.mjs +0 -82
- package/node/esm/yCHAZKxJR7qY_ySy.mjs +0 -470
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +0 -32
- package/types/src/conditions/DateTimeOption.d.ts +0 -43
- package/types/src/conditions/InSetOption.d.ts +0 -37
- package/types/src/dialog/CommentsDialog.d.ts +0 -11
- package/types/src/dialog/NumberFormatDialog.d.ts +0 -12
- package/types/src/filter/FilterList.d.ts +0 -28
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +0 -12
- package/types/src/numberFormat/index.d.ts +0 -8
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +0 -3
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +0 -2
- package/types/src/protection/WorkbookProtectionDialog.d.ts +0 -23
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { t as e } from "./Biy7bhzzzPb5sfRN.mjs";
|
|
8
|
+
import { n as t } from "./fb126BNj3F8URR19.mjs";
|
|
9
9
|
import { useReferenceMode as n } from "@sheetxl/react";
|
|
10
10
|
import { useCallbackRef as r, useTranslator as i } from "@sheetxl/utils-react";
|
|
11
11
|
import { memo as a, useEffect as o, useId as ee, useMemo as s, useRef as c, useState as l } from "react";
|
|
@@ -157,7 +157,7 @@ var oe = ["Ok", "Cancel"], h = { paddingTop: (e) => e.spacing(1.5) }, g = "mailt
|
|
|
157
157
|
]
|
|
158
158
|
})]
|
|
159
159
|
}),
|
|
160
|
-
M === "email" ? f(u, { children: [d(
|
|
160
|
+
M === "email" ? f(u, { children: [d(e, {
|
|
161
161
|
sx: h,
|
|
162
162
|
label: O("hyperlink.emailAddress"),
|
|
163
163
|
defaultInput: O("hyperlink.emailPlaceholder"),
|
|
@@ -166,13 +166,13 @@ var oe = ["Ok", "Cancel"], h = { paddingTop: (e) => e.spacing(1.5) }, g = "mailt
|
|
|
166
166
|
onFocus: (e) => {
|
|
167
167
|
K || e.target?.select?.(), q(!0);
|
|
168
168
|
}
|
|
169
|
-
}), d(
|
|
169
|
+
}), d(e, {
|
|
170
170
|
label: O("hyperlink.subject"),
|
|
171
171
|
defaultInput: "",
|
|
172
172
|
value: R,
|
|
173
173
|
onChangeInput: (e) => z(e),
|
|
174
174
|
onFocus: () => q(!0)
|
|
175
|
-
})] }) : M === "document" ? d(
|
|
175
|
+
})] }) : M === "document" ? d(t, {
|
|
176
176
|
sx: h,
|
|
177
177
|
grammar: "reference",
|
|
178
178
|
apiRef: X,
|
|
@@ -187,7 +187,7 @@ var oe = ["Ok", "Cancel"], h = { paddingTop: (e) => e.spacing(1.5) }, g = "mailt
|
|
|
187
187
|
onFocus: (e) => {
|
|
188
188
|
K || e.target?.select?.(), q(!0);
|
|
189
189
|
}
|
|
190
|
-
}) : d(
|
|
190
|
+
}) : d(e, {
|
|
191
191
|
sx: h,
|
|
192
192
|
label: O("hyperlink.address"),
|
|
193
193
|
defaultInput: O("hyperlink.addressPlaceholder"),
|
|
@@ -0,0 +1,627 @@
|
|
|
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 { t as e } from "./5cbK03T_Oh3tNdR7.mjs";
|
|
8
|
+
import { Color as t, VERSION as n } from "@sheetxl/sdk";
|
|
9
|
+
import { useGridColorScheme as r } from "@sheetxl/react";
|
|
10
|
+
import { DynamicIcon as i, ReactUtils as a, useTranslator as o } from "@sheetxl/utils-react";
|
|
11
|
+
import { forwardRef as s, memo as c, useCallback as l, useEffect as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
12
|
+
import { ExhibitIconButton as h } from "@sheetxl/utils-mui";
|
|
13
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
import { Box as y, Button as b, ButtonBase as x, Chip as S, Divider as C, InputAdornment as w, ListItemIcon as T, ListItemText as E, Menu as D, MenuItem as O, Skeleton as k, TextField as A, Typography as j } from "@mui/material";
|
|
15
|
+
import { listResources as M } from "@sheetxl/utils";
|
|
16
|
+
var N = (e, n) => {
|
|
17
|
+
if (!e?.color) return null;
|
|
18
|
+
try {
|
|
19
|
+
let r = new t(e.color).toCSS(n.palette.mode === "dark");
|
|
20
|
+
return {
|
|
21
|
+
fill: r,
|
|
22
|
+
text: n.palette.getContrastText(r)
|
|
23
|
+
};
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}, P = "8 / 5", F = (e) => {
|
|
28
|
+
let { entry: t, category: n } = e, i = (r() === "dark" ? t.thumbnailDarkUrl : void 0) ?? t.thumbnailUrl;
|
|
29
|
+
return _(I, {
|
|
30
|
+
src: i,
|
|
31
|
+
category: n
|
|
32
|
+
}, i);
|
|
33
|
+
}, I = (e) => {
|
|
34
|
+
let { src: t, category: n } = e, [r, a] = m(t ? "loading" : "failed");
|
|
35
|
+
return v(y, {
|
|
36
|
+
className: "template-thumbnail",
|
|
37
|
+
sx: {
|
|
38
|
+
position: "relative",
|
|
39
|
+
width: "100%",
|
|
40
|
+
aspectRatio: P,
|
|
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: [r === "failed" ? _(i, {
|
|
51
|
+
iconKey: "FileNew",
|
|
52
|
+
style: {
|
|
53
|
+
fontSize: "2.5rem",
|
|
54
|
+
opacity: .4
|
|
55
|
+
}
|
|
56
|
+
}) : _("img", {
|
|
57
|
+
src: t,
|
|
58
|
+
alt: "",
|
|
59
|
+
loading: "lazy",
|
|
60
|
+
draggable: !1,
|
|
61
|
+
onLoad: () => a("loaded"),
|
|
62
|
+
onError: () => a("failed"),
|
|
63
|
+
style: {
|
|
64
|
+
width: "100%",
|
|
65
|
+
height: "100%",
|
|
66
|
+
objectFit: "cover",
|
|
67
|
+
objectPosition: "top left",
|
|
68
|
+
opacity: +(r === "loaded"),
|
|
69
|
+
transition: "opacity 150ms ease-out"
|
|
70
|
+
}
|
|
71
|
+
}), n?.color ? _(y, { sx: (e) => ({
|
|
72
|
+
position: "absolute",
|
|
73
|
+
top: 0,
|
|
74
|
+
left: 0,
|
|
75
|
+
right: 0,
|
|
76
|
+
height: "3px",
|
|
77
|
+
backgroundColor: N(n, e)?.fill
|
|
78
|
+
}) }) : null]
|
|
79
|
+
});
|
|
80
|
+
}, L = (e) => {
|
|
81
|
+
let { entry: t, category: n, onSelect: r } = e;
|
|
82
|
+
return v(x, {
|
|
83
|
+
className: "template-tile",
|
|
84
|
+
disableRipple: !0,
|
|
85
|
+
onClick: r,
|
|
86
|
+
"aria-label": n ? `${t.title}, ${n.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: [_(F, {
|
|
106
|
+
entry: t,
|
|
107
|
+
category: n
|
|
108
|
+
}), v(y, {
|
|
109
|
+
sx: { minWidth: 0 },
|
|
110
|
+
children: [_(j, {
|
|
111
|
+
variant: "subtitle2",
|
|
112
|
+
component: "div",
|
|
113
|
+
noWrap: !0,
|
|
114
|
+
children: t.title
|
|
115
|
+
}), n ? v(j, {
|
|
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: [n.color ? _(y, {
|
|
126
|
+
component: "span",
|
|
127
|
+
sx: (e) => ({
|
|
128
|
+
width: "8px",
|
|
129
|
+
height: "8px",
|
|
130
|
+
borderRadius: "50%",
|
|
131
|
+
flex: "none",
|
|
132
|
+
backgroundColor: N(n, e)?.fill
|
|
133
|
+
})
|
|
134
|
+
}) : null, _(y, {
|
|
135
|
+
component: "span",
|
|
136
|
+
sx: {
|
|
137
|
+
overflow: "hidden",
|
|
138
|
+
textOverflow: "ellipsis"
|
|
139
|
+
},
|
|
140
|
+
children: n.title
|
|
141
|
+
})]
|
|
142
|
+
}) : null]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
}, R = () => v(y, {
|
|
146
|
+
sx: {
|
|
147
|
+
padding: 1,
|
|
148
|
+
display: "flex",
|
|
149
|
+
flexDirection: "column",
|
|
150
|
+
gap: .75
|
|
151
|
+
},
|
|
152
|
+
children: [
|
|
153
|
+
_(k, {
|
|
154
|
+
variant: "rectangular",
|
|
155
|
+
sx: {
|
|
156
|
+
width: "100%",
|
|
157
|
+
height: "auto",
|
|
158
|
+
aspectRatio: P,
|
|
159
|
+
borderRadius: 1
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
162
|
+
_(k, {
|
|
163
|
+
variant: "text",
|
|
164
|
+
width: "60%"
|
|
165
|
+
}),
|
|
166
|
+
_(k, {
|
|
167
|
+
variant: "text",
|
|
168
|
+
width: "35%"
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
}), z = c(s((t, n) => {
|
|
172
|
+
let { catalog: r, onSelect: i, filter: s, groupBy: c, renderTile: l, tileMinWidth: h = 180, emptyLabel: g, visibleRows: x, sx: S = a.EmptyCssProperties, style: C, className: w, onKeyDown: T, ...E } = t, D = o(), O = p(null), [k, A] = m(0), M = p(null);
|
|
173
|
+
M.current = () => {
|
|
174
|
+
let e = O.current?.querySelector(".template-grid")?.firstElementChild, t = (e?.offsetHeight ? e : e?.firstElementChild)?.getBoundingClientRect().height;
|
|
175
|
+
t && A(t);
|
|
176
|
+
}, d(() => {
|
|
177
|
+
x && M.current?.();
|
|
178
|
+
}), u(() => {
|
|
179
|
+
let e = O.current;
|
|
180
|
+
if (!x || !e) return;
|
|
181
|
+
let t = new ResizeObserver(() => M.current?.());
|
|
182
|
+
return t.observe(e), () => t.disconnect();
|
|
183
|
+
}, [x]);
|
|
184
|
+
let N = f(() => new Map(r.categories.map((e) => [e.id, e])), [r.categories]), P = f(() => {
|
|
185
|
+
let e = s ? r.entries.filter(s) : r.entries;
|
|
186
|
+
if (!c) return [{
|
|
187
|
+
key: null,
|
|
188
|
+
entries: e
|
|
189
|
+
}];
|
|
190
|
+
let t = /* @__PURE__ */ new Map();
|
|
191
|
+
for (let e of r.categories) t.set(e.id, []);
|
|
192
|
+
for (let n of e) {
|
|
193
|
+
let e = c(n), r = t.get(e);
|
|
194
|
+
r || t.set(e, r = []), r.push(n);
|
|
195
|
+
}
|
|
196
|
+
return [...t].filter(([, e]) => e.length > 0).map(([e, t]) => ({
|
|
197
|
+
key: e,
|
|
198
|
+
title: N.get(e)?.title ?? e,
|
|
199
|
+
entries: t
|
|
200
|
+
}));
|
|
201
|
+
}, [
|
|
202
|
+
r.entries,
|
|
203
|
+
r.categories,
|
|
204
|
+
N,
|
|
205
|
+
s,
|
|
206
|
+
c
|
|
207
|
+
]), F = {
|
|
208
|
+
display: "grid",
|
|
209
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${h}px, 1fr))`,
|
|
210
|
+
gap: "8px"
|
|
211
|
+
}, I;
|
|
212
|
+
return I = r.status === "loading" ? _(y, {
|
|
213
|
+
className: "template-grid",
|
|
214
|
+
sx: F,
|
|
215
|
+
"aria-busy": "true",
|
|
216
|
+
"aria-label": D("template.loading"),
|
|
217
|
+
children: Array.from({ length: 6 }, (e, t) => _(R, {}, t))
|
|
218
|
+
}) : r.status === "error" ? v(y, {
|
|
219
|
+
sx: {
|
|
220
|
+
display: "flex",
|
|
221
|
+
flexDirection: "column",
|
|
222
|
+
alignItems: "center",
|
|
223
|
+
gap: 1,
|
|
224
|
+
padding: 4,
|
|
225
|
+
textAlign: "center"
|
|
226
|
+
},
|
|
227
|
+
children: [_(j, {
|
|
228
|
+
variant: "body2",
|
|
229
|
+
sx: { color: "text.secondary" },
|
|
230
|
+
children: D("template.loadFailed")
|
|
231
|
+
}), _(b, {
|
|
232
|
+
variant: "outlined",
|
|
233
|
+
size: "small",
|
|
234
|
+
onClick: r.retry,
|
|
235
|
+
children: D("template.retry")
|
|
236
|
+
})]
|
|
237
|
+
}) : P.every((e) => e.entries.length === 0) ? _(j, {
|
|
238
|
+
variant: "body2",
|
|
239
|
+
sx: {
|
|
240
|
+
color: "text.secondary",
|
|
241
|
+
padding: 4,
|
|
242
|
+
textAlign: "center"
|
|
243
|
+
},
|
|
244
|
+
children: g ?? D("template.empty")
|
|
245
|
+
}) : P.map((e) => v(y, {
|
|
246
|
+
role: "group",
|
|
247
|
+
"aria-label": e.title,
|
|
248
|
+
children: [e.title ? _(j, {
|
|
249
|
+
variant: "overline",
|
|
250
|
+
component: "div",
|
|
251
|
+
sx: {
|
|
252
|
+
color: "text.secondary",
|
|
253
|
+
paddingX: 1
|
|
254
|
+
},
|
|
255
|
+
children: e.title
|
|
256
|
+
}) : null, _(y, {
|
|
257
|
+
className: "template-grid",
|
|
258
|
+
sx: F,
|
|
259
|
+
children: e.entries.map((e) => {
|
|
260
|
+
let t = {
|
|
261
|
+
category: N.get(e.category),
|
|
262
|
+
onSelect: () => i?.(e)
|
|
263
|
+
};
|
|
264
|
+
return l ? _(y, {
|
|
265
|
+
sx: { display: "contents" },
|
|
266
|
+
children: l(e, t)
|
|
267
|
+
}, e.id) : _(L, {
|
|
268
|
+
entry: e,
|
|
269
|
+
...t
|
|
270
|
+
}, e.id);
|
|
271
|
+
})
|
|
272
|
+
})]
|
|
273
|
+
}, e.key ?? "")), _(y, {
|
|
274
|
+
ref: n,
|
|
275
|
+
className: e(w, "template-panel"),
|
|
276
|
+
sx: S,
|
|
277
|
+
style: x && k ? {
|
|
278
|
+
boxSizing: "content-box",
|
|
279
|
+
scrollbarGutter: "stable",
|
|
280
|
+
height: `${Math.ceil(x * k + 8 * (x - 1))}px`,
|
|
281
|
+
minHeight: `${Math.ceil(k)}px`,
|
|
282
|
+
...C
|
|
283
|
+
} : C,
|
|
284
|
+
...E,
|
|
285
|
+
children: _(y, {
|
|
286
|
+
ref: O,
|
|
287
|
+
onKeyDown: (e) => {
|
|
288
|
+
if (T?.(e), e.defaultPrevented) return;
|
|
289
|
+
let t = O.current;
|
|
290
|
+
if (!t) return;
|
|
291
|
+
let n = Array.from(t.querySelectorAll(".template-tile")), r = n.indexOf(document.activeElement);
|
|
292
|
+
if (r < 0) return;
|
|
293
|
+
let i = n[r].offsetTop, a = n.findIndex((e) => e.offsetTop === i && e.parentElement === n[r].parentElement), o = 0;
|
|
294
|
+
for (; n[a + o]?.offsetTop === i;) o++;
|
|
295
|
+
let s = r;
|
|
296
|
+
switch (e.key) {
|
|
297
|
+
case "ArrowRight":
|
|
298
|
+
s = r + 1;
|
|
299
|
+
break;
|
|
300
|
+
case "ArrowLeft":
|
|
301
|
+
s = r - 1;
|
|
302
|
+
break;
|
|
303
|
+
case "ArrowDown":
|
|
304
|
+
s = r + Math.max(1, o);
|
|
305
|
+
break;
|
|
306
|
+
case "ArrowUp":
|
|
307
|
+
s = r - Math.max(1, o);
|
|
308
|
+
break;
|
|
309
|
+
case "Home":
|
|
310
|
+
s = 0;
|
|
311
|
+
break;
|
|
312
|
+
case "End":
|
|
313
|
+
s = n.length - 1;
|
|
314
|
+
break;
|
|
315
|
+
default: return;
|
|
316
|
+
}
|
|
317
|
+
s = Math.max(0, Math.min(n.length - 1, s)), e.preventDefault(), n[s].focus();
|
|
318
|
+
},
|
|
319
|
+
children: I
|
|
320
|
+
})
|
|
321
|
+
});
|
|
322
|
+
}));
|
|
323
|
+
z.displayName = "TemplatePanel";
|
|
324
|
+
var B = (e, t, n) => f(() => {
|
|
325
|
+
if (!t.trim() && n.length === 0) return;
|
|
326
|
+
let r = new Map(e.map((e) => [e.id, e])), i = n.length > 0 ? new Set(n) : null;
|
|
327
|
+
return (e) => !(i && !i.has(e.category)) && ((e, t, n) => {
|
|
328
|
+
let r = t.trim().toLowerCase();
|
|
329
|
+
return !r || [
|
|
330
|
+
e.title,
|
|
331
|
+
e.description,
|
|
332
|
+
n?.title,
|
|
333
|
+
...e.tags ?? []
|
|
334
|
+
].some((e) => e?.toLowerCase().includes(r));
|
|
335
|
+
})(e, t, r.get(e.category));
|
|
336
|
+
}, [
|
|
337
|
+
e,
|
|
338
|
+
t,
|
|
339
|
+
n
|
|
340
|
+
]), V = [], H = (e) => {
|
|
341
|
+
let { category: t } = e;
|
|
342
|
+
return _(y, {
|
|
343
|
+
component: "span",
|
|
344
|
+
sx: (e) => ({
|
|
345
|
+
display: "inline-block",
|
|
346
|
+
width: "10px",
|
|
347
|
+
height: "10px",
|
|
348
|
+
borderRadius: "50%",
|
|
349
|
+
flex: "none",
|
|
350
|
+
backgroundColor: N(t, e)?.fill ?? e.palette.action.selected
|
|
351
|
+
})
|
|
352
|
+
});
|
|
353
|
+
}, U = (e) => {
|
|
354
|
+
let { category: t, onDelete: n } = e;
|
|
355
|
+
return _(S, {
|
|
356
|
+
size: "small",
|
|
357
|
+
label: t.title,
|
|
358
|
+
title: t.description,
|
|
359
|
+
onDelete: n,
|
|
360
|
+
sx: (e) => {
|
|
361
|
+
let n = N(t, e);
|
|
362
|
+
return {
|
|
363
|
+
marginY: .25,
|
|
364
|
+
marginRight: .5,
|
|
365
|
+
maxWidth: "160px",
|
|
366
|
+
...n ? {
|
|
367
|
+
backgroundColor: n.fill,
|
|
368
|
+
color: n.text,
|
|
369
|
+
"& .MuiChip-deleteIcon": {
|
|
370
|
+
color: n.text,
|
|
371
|
+
opacity: .7
|
|
372
|
+
},
|
|
373
|
+
"& .MuiChip-deleteIcon:hover": {
|
|
374
|
+
color: n.text,
|
|
375
|
+
opacity: 1
|
|
376
|
+
},
|
|
377
|
+
"&.Mui-focusVisible": {
|
|
378
|
+
backgroundColor: n.fill,
|
|
379
|
+
outline: `2px solid ${e.palette.primary.main}`,
|
|
380
|
+
outlineOffset: "1px"
|
|
381
|
+
}
|
|
382
|
+
} : void 0
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}, W = (e) => {
|
|
387
|
+
let { value: t, onChange: n, categories: r, categoryIds: a = V, onCategoryIdsChange: s, sx: c } = e, l = o(), u = p(null), [d, y] = m(null), b = !!s && (r?.length ?? 0) > 1, S = f(() => {
|
|
388
|
+
if (!b || a.length === 0) return [];
|
|
389
|
+
let e = new Map(r.map((e) => [e.id, e]));
|
|
390
|
+
return a.map((t) => e.get(t)).filter((e) => !!e);
|
|
391
|
+
}, [
|
|
392
|
+
b,
|
|
393
|
+
r,
|
|
394
|
+
a
|
|
395
|
+
]), k = (e) => {
|
|
396
|
+
s?.(e), u.current?.focus();
|
|
397
|
+
}, j = () => {
|
|
398
|
+
y(null), u.current?.focus();
|
|
399
|
+
}, M = _(i, { iconKey: "Find" }), N = _(w, {
|
|
400
|
+
position: "start",
|
|
401
|
+
children: M
|
|
402
|
+
});
|
|
403
|
+
if (b) {
|
|
404
|
+
let e = l("template.filterByCategory");
|
|
405
|
+
N = v(g, { children: [_(w, {
|
|
406
|
+
position: "start",
|
|
407
|
+
sx: { marginRight: .5 },
|
|
408
|
+
children: v(x, {
|
|
409
|
+
"aria-label": e,
|
|
410
|
+
title: e,
|
|
411
|
+
"aria-haspopup": "menu",
|
|
412
|
+
"aria-expanded": !!d,
|
|
413
|
+
onMouseDown: (e) => {
|
|
414
|
+
e.button === 0 && e.preventDefault();
|
|
415
|
+
},
|
|
416
|
+
onClick: (e) => y(e.currentTarget),
|
|
417
|
+
sx: {
|
|
418
|
+
display: "flex",
|
|
419
|
+
alignItems: "center",
|
|
420
|
+
marginLeft: -.75,
|
|
421
|
+
paddingX: .25,
|
|
422
|
+
paddingY: .25,
|
|
423
|
+
borderRadius: 1,
|
|
424
|
+
color: "inherit",
|
|
425
|
+
"&:hover, &.Mui-focusVisible": { backgroundColor: "action.hover" }
|
|
426
|
+
},
|
|
427
|
+
children: [M, _(i, {
|
|
428
|
+
iconKey: "ExpandMore",
|
|
429
|
+
style: {
|
|
430
|
+
fontSize: "1rem",
|
|
431
|
+
marginLeft: "-2px"
|
|
432
|
+
}
|
|
433
|
+
})]
|
|
434
|
+
})
|
|
435
|
+
}), S.map((e) => _(U, {
|
|
436
|
+
category: e,
|
|
437
|
+
onDelete: () => k(a.filter((t) => t !== e.id))
|
|
438
|
+
}, e.id))] });
|
|
439
|
+
}
|
|
440
|
+
let P = !!t || S.length > 0;
|
|
441
|
+
return v(g, { children: [_(A, {
|
|
442
|
+
size: "small",
|
|
443
|
+
value: t,
|
|
444
|
+
placeholder: S.length > 0 ? void 0 : l("template.search"),
|
|
445
|
+
inputRef: u,
|
|
446
|
+
onChange: (e) => n(e.target.value),
|
|
447
|
+
onKeyDown: (e) => {
|
|
448
|
+
if (e.key === "Escape" && P) e.stopPropagation(), t ? n("") : k([]);
|
|
449
|
+
else if (e.key === "Backspace" && S.length > 0) {
|
|
450
|
+
let t = u.current;
|
|
451
|
+
e.target === t && t.selectionStart === 0 && t.selectionEnd === 0 && (e.preventDefault(), k(a.slice(0, -1)));
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
sx: c,
|
|
455
|
+
slotProps: {
|
|
456
|
+
input: {
|
|
457
|
+
sx: {
|
|
458
|
+
backgroundColor: "background.paper",
|
|
459
|
+
flexWrap: "wrap",
|
|
460
|
+
paddingY: "6px",
|
|
461
|
+
paddingRight: P ? "40px" : void 0,
|
|
462
|
+
"& .MuiInputBase-input": {
|
|
463
|
+
flex: "1 1 60px",
|
|
464
|
+
minWidth: "60px",
|
|
465
|
+
width: 0,
|
|
466
|
+
height: "28px",
|
|
467
|
+
paddingY: 0
|
|
468
|
+
},
|
|
469
|
+
"& .MuiInputAdornment-positionStart": {
|
|
470
|
+
height: "28px",
|
|
471
|
+
maxHeight: "none"
|
|
472
|
+
},
|
|
473
|
+
"& .MuiInputAdornment-positionEnd": {
|
|
474
|
+
position: "absolute",
|
|
475
|
+
right: "8px",
|
|
476
|
+
top: "6px",
|
|
477
|
+
height: "28px",
|
|
478
|
+
maxHeight: "none",
|
|
479
|
+
marginLeft: 0
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
startAdornment: N,
|
|
483
|
+
endAdornment: P ? _(w, {
|
|
484
|
+
position: "end",
|
|
485
|
+
children: _(h, {
|
|
486
|
+
"aria-label": l("template.clearSearch"),
|
|
487
|
+
propsTooltip: { label: l("template.clearSearch") },
|
|
488
|
+
onMouseDown: (e) => {
|
|
489
|
+
e.button === 0 && e.preventDefault();
|
|
490
|
+
},
|
|
491
|
+
onClick: () => {
|
|
492
|
+
n(""), k([]);
|
|
493
|
+
},
|
|
494
|
+
icon: _(i, { iconKey: "Close" }),
|
|
495
|
+
size: "small"
|
|
496
|
+
})
|
|
497
|
+
}) : void 0
|
|
498
|
+
},
|
|
499
|
+
htmlInput: {
|
|
500
|
+
spellCheck: !1,
|
|
501
|
+
autoComplete: "off",
|
|
502
|
+
"aria-label": l("template.search")
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}), b ? v(D, {
|
|
506
|
+
anchorEl: d,
|
|
507
|
+
open: !!d,
|
|
508
|
+
onClose: j,
|
|
509
|
+
disableRestoreFocus: !0,
|
|
510
|
+
slotProps: { list: {
|
|
511
|
+
dense: !0,
|
|
512
|
+
"aria-label": l("dialog.template.categories")
|
|
513
|
+
} },
|
|
514
|
+
children: [r.map((e) => {
|
|
515
|
+
let t = a.includes(e.id);
|
|
516
|
+
return v(O, {
|
|
517
|
+
selected: t,
|
|
518
|
+
title: e.description,
|
|
519
|
+
onClick: () => {
|
|
520
|
+
s(t ? a.filter((t) => t !== e.id) : [...a, e.id]), j();
|
|
521
|
+
},
|
|
522
|
+
children: [
|
|
523
|
+
_(T, { children: _(H, { category: e }) }),
|
|
524
|
+
_(E, { children: e.title }),
|
|
525
|
+
t ? _(i, {
|
|
526
|
+
iconKey: "Check",
|
|
527
|
+
style: {
|
|
528
|
+
fontSize: "1rem",
|
|
529
|
+
marginLeft: "16px"
|
|
530
|
+
}
|
|
531
|
+
}) : null
|
|
532
|
+
]
|
|
533
|
+
}, e.id);
|
|
534
|
+
}), S.length > 0 ? [_(C, {}, "divider"), v(O, {
|
|
535
|
+
onClick: () => {
|
|
536
|
+
s([]), j();
|
|
537
|
+
},
|
|
538
|
+
children: [_(T, {}), _(E, { children: l("template.allCategories") })]
|
|
539
|
+
}, "all")] : null]
|
|
540
|
+
}) : null] });
|
|
541
|
+
}, G = n === "local" ? "beta" : /^\d+\.\d+\.\d+-([0-9A-Za-z-]+)/.exec(n)?.[1], K = `https://unpkg.com/@sheetxl/templates-workbook${G ? `@${G}` : ""}/dist`, q = "templates-workbook", J = (e) => e.replace(/\.[^/.]+$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), Y = (e, t) => {
|
|
542
|
+
let n = `${e}${e.endsWith("/") ? "" : "/"}${q}/${t}`;
|
|
543
|
+
return typeof document > "u" ? n : new URL(n, document.baseURI).href;
|
|
544
|
+
}, X = (e) => typeof e == "string" && e ? e : void 0, Z = /* @__PURE__ */ new Map(), Q = (e = K) => {
|
|
545
|
+
let t = Z.get(e);
|
|
546
|
+
return t || (t = (async () => {
|
|
547
|
+
let t = (await M("templates", q, e)).find((e) => e.meta?.schema !== void 0);
|
|
548
|
+
if (!t) throw Error(`No template catalog found at '${e}'.`);
|
|
549
|
+
return Math.floor(Number(t.meta?.schema)) === 1 ? ((e, t) => {
|
|
550
|
+
let n = Array.isArray(e.meta?.categories) ? e.meta.categories : [], r = [], i = /* @__PURE__ */ new Set();
|
|
551
|
+
for (let e of n) {
|
|
552
|
+
let t = X(e?.id);
|
|
553
|
+
t && !i.has(t) && (i.add(t), r.push({
|
|
554
|
+
id: t,
|
|
555
|
+
title: X(e.title) ?? J(t),
|
|
556
|
+
description: X(e.description),
|
|
557
|
+
icon: X(e.icon),
|
|
558
|
+
color: X(e.color)
|
|
559
|
+
}));
|
|
560
|
+
}
|
|
561
|
+
let a = [];
|
|
562
|
+
for (let n of e.entries) {
|
|
563
|
+
let e = n.path, o = e.split("/");
|
|
564
|
+
if (o.length !== 2 || !/\.(?:xlsx|sxl|csv)$/i.test(e)) continue;
|
|
565
|
+
let s = X(n.category) ?? o[0];
|
|
566
|
+
i.has(s) || (i.add(s), r.push({
|
|
567
|
+
id: s,
|
|
568
|
+
title: J(s)
|
|
569
|
+
}));
|
|
570
|
+
let c = X(n.thumbnail), l = X(n.thumbnailDark);
|
|
571
|
+
a.push({
|
|
572
|
+
id: e,
|
|
573
|
+
title: X(n.title) ?? J(o[1]),
|
|
574
|
+
category: s,
|
|
575
|
+
description: X(n.description),
|
|
576
|
+
tags: Array.isArray(n.tags) ? n.tags.filter((e) => typeof e == "string") : void 0,
|
|
577
|
+
thumbnailUrl: c ? Y(t, c) : void 0,
|
|
578
|
+
thumbnailDarkUrl: l ? Y(t, l) : void 0,
|
|
579
|
+
sourceUrl: Y(t, e)
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
return {
|
|
583
|
+
categories: r,
|
|
584
|
+
entries: a
|
|
585
|
+
};
|
|
586
|
+
})(t, e) : (console.warn(`Template catalog at '${e}' has schema ${t.meta?.schema}; expected 1.`), {
|
|
587
|
+
categories: [],
|
|
588
|
+
entries: []
|
|
589
|
+
});
|
|
590
|
+
})(), Z.set(e, t), t.catch(() => {
|
|
591
|
+
Z.delete(e);
|
|
592
|
+
})), t;
|
|
593
|
+
}, $ = (e = {}) => {
|
|
594
|
+
let { path: t = K } = e, [n, r] = m(0), [i, a] = m({
|
|
595
|
+
status: "loading",
|
|
596
|
+
categories: [],
|
|
597
|
+
entries: []
|
|
598
|
+
});
|
|
599
|
+
return u(() => {
|
|
600
|
+
let e = !1;
|
|
601
|
+
return a((e) => e.status === "loading" ? e : {
|
|
602
|
+
status: "loading",
|
|
603
|
+
categories: [],
|
|
604
|
+
entries: []
|
|
605
|
+
}), Q(t).then((t) => {
|
|
606
|
+
e || a({
|
|
607
|
+
status: "ready",
|
|
608
|
+
...t
|
|
609
|
+
});
|
|
610
|
+
}, (t) => {
|
|
611
|
+
e || a({
|
|
612
|
+
status: "error",
|
|
613
|
+
categories: [],
|
|
614
|
+
entries: [],
|
|
615
|
+
error: t
|
|
616
|
+
});
|
|
617
|
+
}), () => {
|
|
618
|
+
e = !0;
|
|
619
|
+
};
|
|
620
|
+
}, [t, n]), {
|
|
621
|
+
...i,
|
|
622
|
+
retry: l(() => {
|
|
623
|
+
r((e) => e + 1);
|
|
624
|
+
}, [])
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
export { z as a, B as i, $ as n, W 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.
|
|
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.
|