@trops/dash-core 0.1.633 → 0.1.634
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/dist/index.esm.js +50 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +50 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -38664,14 +38664,17 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38664
38664
|
}
|
|
38665
38665
|
return /*#__PURE__*/jsxs("div", {
|
|
38666
38666
|
className: "flex flex-col gap-4 p-6 flex-1 min-h-0 overflow-hidden",
|
|
38667
|
-
children: [/*#__PURE__*/jsx(
|
|
38668
|
-
|
|
38669
|
-
|
|
38670
|
-
|
|
38671
|
-
|
|
38672
|
-
|
|
38667
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
38668
|
+
className: "shrink-0",
|
|
38669
|
+
children: /*#__PURE__*/jsx(InputText, {
|
|
38670
|
+
value: wizardName,
|
|
38671
|
+
onChange: function onChange(val) {
|
|
38672
|
+
return setWizardName(val);
|
|
38673
|
+
},
|
|
38674
|
+
placeholder: "Theme name..."
|
|
38675
|
+
})
|
|
38673
38676
|
}), showMethodPicker && /*#__PURE__*/jsxs("div", {
|
|
38674
|
-
className: "flex flex-col gap-2",
|
|
38677
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
38675
38678
|
children: [/*#__PURE__*/jsx("span", {
|
|
38676
38679
|
className: "text-sm font-semibold opacity-50",
|
|
38677
38680
|
children: "Generation Method"
|
|
@@ -38711,33 +38714,39 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38711
38714
|
}
|
|
38712
38715
|
})]
|
|
38713
38716
|
})]
|
|
38714
|
-
}),
|
|
38715
|
-
|
|
38716
|
-
|
|
38717
|
-
|
|
38718
|
-
|
|
38719
|
-
|
|
38720
|
-
|
|
38721
|
-
|
|
38722
|
-
|
|
38723
|
-
|
|
38724
|
-
|
|
38725
|
-
|
|
38726
|
-
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
38730
|
-
|
|
38731
|
-
|
|
38732
|
-
|
|
38733
|
-
|
|
38734
|
-
|
|
38735
|
-
|
|
38736
|
-
|
|
38737
|
-
|
|
38738
|
-
|
|
38739
|
-
|
|
38740
|
-
|
|
38717
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
38718
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
38719
|
+
children: [wizardMethod === "presets" && /*#__PURE__*/jsx(PresetGallery, {
|
|
38720
|
+
onSelect: function onSelect(preset) {
|
|
38721
|
+
return setWizardTheme(preset);
|
|
38722
|
+
},
|
|
38723
|
+
selectedPresetId: wizardTheme === null || wizardTheme === void 0 ? void 0 : wizardTheme.name,
|
|
38724
|
+
inline: true
|
|
38725
|
+
}), wizardMethod === "random" && /*#__PURE__*/jsx(RandomPreview, {
|
|
38726
|
+
onCommit: function onCommit(theme) {
|
|
38727
|
+
return setWizardTheme(theme);
|
|
38728
|
+
}
|
|
38729
|
+
}), wizardMethod === "color" && /*#__PURE__*/jsx(ColorHarmonyPicker, {
|
|
38730
|
+
onGenerate: function onGenerate(theme) {
|
|
38731
|
+
return setWizardTheme(theme);
|
|
38732
|
+
},
|
|
38733
|
+
inline: true
|
|
38734
|
+
}), wizardMethod === "from-url" && onExtract && /*#__PURE__*/jsx(ThemeFromUrlPane, {
|
|
38735
|
+
onExtract: onExtract,
|
|
38736
|
+
onMapToTheme: onMapToTheme,
|
|
38737
|
+
onGenerate: function onGenerate(theme) {
|
|
38738
|
+
return setWizardTheme(theme);
|
|
38739
|
+
},
|
|
38740
|
+
inline: true
|
|
38741
|
+
})]
|
|
38742
|
+
}), /*#__PURE__*/jsx("div", {
|
|
38743
|
+
className: "shrink-0",
|
|
38744
|
+
children: /*#__PURE__*/jsx(Button2, {
|
|
38745
|
+
title: "Create Theme",
|
|
38746
|
+
onClick: onComplete,
|
|
38747
|
+
disabled: !canCreate,
|
|
38748
|
+
block: true
|
|
38749
|
+
})
|
|
38741
38750
|
})]
|
|
38742
38751
|
});
|
|
38743
38752
|
};
|
|
@@ -39598,6 +39607,10 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
39598
39607
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
39599
39608
|
isChoosingMode = _useState10[0],
|
|
39600
39609
|
setIsChoosingMode = _useState10[1];
|
|
39610
|
+
// `startInCreate` should auto-open the chooser ONCE per modal open. Without
|
|
39611
|
+
// this guard the effect re-fires after a theme is created (themes change →
|
|
39612
|
+
// isCreating flips false) and bounces the user back to the chooser.
|
|
39613
|
+
var startInCreateHandledRef = useRef(false);
|
|
39601
39614
|
var _useState11 = useState(false),
|
|
39602
39615
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
39603
39616
|
isSearching = _useState12[0],
|
|
@@ -39634,6 +39647,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
39634
39647
|
setIsChoosingMode(false);
|
|
39635
39648
|
setIsSearching(false);
|
|
39636
39649
|
setSelectedMethod(null);
|
|
39650
|
+
startInCreateHandledRef.current = false;
|
|
39637
39651
|
} else {
|
|
39638
39652
|
if (themeKeySelected === null && themes) {
|
|
39639
39653
|
var themeKeyTemp = settings && "theme" in settings ? settings["theme"] in themes ? settings["theme"] : Object.keys(themes)[0] : Object.keys(themes)[0];
|
|
@@ -39648,7 +39662,8 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
39648
39662
|
return rawThemes[themeKeyTemp];
|
|
39649
39663
|
});
|
|
39650
39664
|
}
|
|
39651
|
-
if (startInCreate && !isChoosingMode && !isCreating) {
|
|
39665
|
+
if (startInCreate && !startInCreateHandledRef.current && !isChoosingMode && !isCreating) {
|
|
39666
|
+
startInCreateHandledRef.current = true;
|
|
39652
39667
|
setIsChoosingMode(true);
|
|
39653
39668
|
setIsCreating(false);
|
|
39654
39669
|
setIsSearching(false);
|