@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.js
CHANGED
|
@@ -38682,14 +38682,17 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38682
38682
|
}
|
|
38683
38683
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38684
38684
|
className: "flex flex-col gap-4 p-6 flex-1 min-h-0 overflow-hidden",
|
|
38685
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
38686
|
-
|
|
38687
|
-
|
|
38688
|
-
|
|
38689
|
-
|
|
38690
|
-
|
|
38685
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38686
|
+
className: "shrink-0",
|
|
38687
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
38688
|
+
value: wizardName,
|
|
38689
|
+
onChange: function onChange(val) {
|
|
38690
|
+
return setWizardName(val);
|
|
38691
|
+
},
|
|
38692
|
+
placeholder: "Theme name..."
|
|
38693
|
+
})
|
|
38691
38694
|
}), showMethodPicker && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38692
|
-
className: "flex flex-col gap-2",
|
|
38695
|
+
className: "flex flex-col gap-2 shrink-0",
|
|
38693
38696
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38694
38697
|
className: "text-sm font-semibold opacity-50",
|
|
38695
38698
|
children: "Generation Method"
|
|
@@ -38729,33 +38732,39 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
|
|
|
38729
38732
|
}
|
|
38730
38733
|
})]
|
|
38731
38734
|
})]
|
|
38732
|
-
}),
|
|
38733
|
-
|
|
38734
|
-
|
|
38735
|
-
|
|
38736
|
-
|
|
38737
|
-
|
|
38738
|
-
|
|
38739
|
-
|
|
38740
|
-
|
|
38741
|
-
|
|
38742
|
-
|
|
38743
|
-
|
|
38744
|
-
|
|
38745
|
-
|
|
38746
|
-
|
|
38747
|
-
|
|
38748
|
-
|
|
38749
|
-
|
|
38750
|
-
|
|
38751
|
-
|
|
38752
|
-
|
|
38753
|
-
|
|
38754
|
-
|
|
38755
|
-
|
|
38756
|
-
|
|
38757
|
-
|
|
38758
|
-
|
|
38735
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38736
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
38737
|
+
children: [wizardMethod === "presets" && /*#__PURE__*/jsxRuntime.jsx(PresetGallery, {
|
|
38738
|
+
onSelect: function onSelect(preset) {
|
|
38739
|
+
return setWizardTheme(preset);
|
|
38740
|
+
},
|
|
38741
|
+
selectedPresetId: wizardTheme === null || wizardTheme === void 0 ? void 0 : wizardTheme.name,
|
|
38742
|
+
inline: true
|
|
38743
|
+
}), wizardMethod === "random" && /*#__PURE__*/jsxRuntime.jsx(RandomPreview, {
|
|
38744
|
+
onCommit: function onCommit(theme) {
|
|
38745
|
+
return setWizardTheme(theme);
|
|
38746
|
+
}
|
|
38747
|
+
}), wizardMethod === "color" && /*#__PURE__*/jsxRuntime.jsx(ColorHarmonyPicker, {
|
|
38748
|
+
onGenerate: function onGenerate(theme) {
|
|
38749
|
+
return setWizardTheme(theme);
|
|
38750
|
+
},
|
|
38751
|
+
inline: true
|
|
38752
|
+
}), wizardMethod === "from-url" && onExtract && /*#__PURE__*/jsxRuntime.jsx(DashReact.ThemeFromUrlPane, {
|
|
38753
|
+
onExtract: onExtract,
|
|
38754
|
+
onMapToTheme: onMapToTheme,
|
|
38755
|
+
onGenerate: function onGenerate(theme) {
|
|
38756
|
+
return setWizardTheme(theme);
|
|
38757
|
+
},
|
|
38758
|
+
inline: true
|
|
38759
|
+
})]
|
|
38760
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38761
|
+
className: "shrink-0",
|
|
38762
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
38763
|
+
title: "Create Theme",
|
|
38764
|
+
onClick: onComplete,
|
|
38765
|
+
disabled: !canCreate,
|
|
38766
|
+
block: true
|
|
38767
|
+
})
|
|
38759
38768
|
})]
|
|
38760
38769
|
});
|
|
38761
38770
|
};
|
|
@@ -39616,6 +39625,10 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
39616
39625
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
39617
39626
|
isChoosingMode = _useState10[0],
|
|
39618
39627
|
setIsChoosingMode = _useState10[1];
|
|
39628
|
+
// `startInCreate` should auto-open the chooser ONCE per modal open. Without
|
|
39629
|
+
// this guard the effect re-fires after a theme is created (themes change →
|
|
39630
|
+
// isCreating flips false) and bounces the user back to the chooser.
|
|
39631
|
+
var startInCreateHandledRef = React.useRef(false);
|
|
39619
39632
|
var _useState11 = React.useState(false),
|
|
39620
39633
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
39621
39634
|
isSearching = _useState12[0],
|
|
@@ -39652,6 +39665,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
39652
39665
|
setIsChoosingMode(false);
|
|
39653
39666
|
setIsSearching(false);
|
|
39654
39667
|
setSelectedMethod(null);
|
|
39668
|
+
startInCreateHandledRef.current = false;
|
|
39655
39669
|
} else {
|
|
39656
39670
|
if (themeKeySelected === null && themes) {
|
|
39657
39671
|
var themeKeyTemp = settings && "theme" in settings ? settings["theme"] in themes ? settings["theme"] : Object.keys(themes)[0] : Object.keys(themes)[0];
|
|
@@ -39666,7 +39680,8 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
|
|
|
39666
39680
|
return rawThemes[themeKeyTemp];
|
|
39667
39681
|
});
|
|
39668
39682
|
}
|
|
39669
|
-
if (startInCreate && !isChoosingMode && !isCreating) {
|
|
39683
|
+
if (startInCreate && !startInCreateHandledRef.current && !isChoosingMode && !isCreating) {
|
|
39684
|
+
startInCreateHandledRef.current = true;
|
|
39670
39685
|
setIsChoosingMode(true);
|
|
39671
39686
|
setIsCreating(false);
|
|
39672
39687
|
setIsSearching(false);
|