@trops/dash-core 0.1.632 → 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 CHANGED
@@ -1127,7 +1127,17 @@ var ElectronDashboardApi = /*#__PURE__*/function () {
1127
1127
  this.events = apiEvents;
1128
1128
  }
1129
1129
  }
1130
+ /**
1131
+ * The Bot Factory IPC namespace (window.mainApi.bots), consumed by
1132
+ * Settings → Bots (BotsSection). Exposed as a pass-through so the settings UI
1133
+ * can reach `dashApi.bots.*` the same way it reaches other domains.
1134
+ */
1130
1135
  return _createClass(ElectronDashboardApi, [{
1136
+ key: "bots",
1137
+ get: function get() {
1138
+ return this.api ? this.api.bots : undefined;
1139
+ }
1140
+ }, {
1131
1141
  key: "chooseFile",
1132
1142
  value: function chooseFile() {
1133
1143
  var _this = this;
@@ -38654,14 +38664,17 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
38654
38664
  }
38655
38665
  return /*#__PURE__*/jsxs("div", {
38656
38666
  className: "flex flex-col gap-4 p-6 flex-1 min-h-0 overflow-hidden",
38657
- children: [/*#__PURE__*/jsx(InputText, {
38658
- value: wizardName,
38659
- onChange: function onChange(val) {
38660
- return setWizardName(val);
38661
- },
38662
- placeholder: "Theme name..."
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
+ })
38663
38676
  }), showMethodPicker && /*#__PURE__*/jsxs("div", {
38664
- className: "flex flex-col gap-2",
38677
+ className: "flex flex-col gap-2 shrink-0",
38665
38678
  children: [/*#__PURE__*/jsx("span", {
38666
38679
  className: "text-sm font-semibold opacity-50",
38667
38680
  children: "Generation Method"
@@ -38701,33 +38714,39 @@ var ThemeQuickCreate = function ThemeQuickCreate(_ref11) {
38701
38714
  }
38702
38715
  })]
38703
38716
  })]
38704
- }), wizardMethod === "presets" && /*#__PURE__*/jsx(PresetGallery, {
38705
- onSelect: function onSelect(preset) {
38706
- return setWizardTheme(preset);
38707
- },
38708
- selectedPresetId: wizardTheme === null || wizardTheme === void 0 ? void 0 : wizardTheme.name,
38709
- inline: true
38710
- }), wizardMethod === "random" && /*#__PURE__*/jsx(RandomPreview, {
38711
- onCommit: function onCommit(theme) {
38712
- return setWizardTheme(theme);
38713
- }
38714
- }), wizardMethod === "color" && /*#__PURE__*/jsx(ColorHarmonyPicker, {
38715
- onGenerate: function onGenerate(theme) {
38716
- return setWizardTheme(theme);
38717
- },
38718
- inline: true
38719
- }), wizardMethod === "from-url" && onExtract && /*#__PURE__*/jsx(ThemeFromUrlPane, {
38720
- onExtract: onExtract,
38721
- onMapToTheme: onMapToTheme,
38722
- onGenerate: function onGenerate(theme) {
38723
- return setWizardTheme(theme);
38724
- },
38725
- inline: true
38726
- }), /*#__PURE__*/jsx(Button2, {
38727
- title: "Create Theme",
38728
- onClick: onComplete,
38729
- disabled: !canCreate,
38730
- block: true
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
+ })
38731
38750
  })]
38732
38751
  });
38733
38752
  };
@@ -39588,6 +39607,10 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
39588
39607
  _useState10 = _slicedToArray(_useState1, 2),
39589
39608
  isChoosingMode = _useState10[0],
39590
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);
39591
39614
  var _useState11 = useState(false),
39592
39615
  _useState12 = _slicedToArray(_useState11, 2),
39593
39616
  isSearching = _useState12[0],
@@ -39624,6 +39647,7 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
39624
39647
  setIsChoosingMode(false);
39625
39648
  setIsSearching(false);
39626
39649
  setSelectedMethod(null);
39650
+ startInCreateHandledRef.current = false;
39627
39651
  } else {
39628
39652
  if (themeKeySelected === null && themes) {
39629
39653
  var themeKeyTemp = settings && "theme" in settings ? settings["theme"] in themes ? settings["theme"] : Object.keys(themes)[0] : Object.keys(themes)[0];
@@ -39638,7 +39662,8 @@ var ThemeManagerModal = function ThemeManagerModal(_ref) {
39638
39662
  return rawThemes[themeKeyTemp];
39639
39663
  });
39640
39664
  }
39641
- if (startInCreate && !isChoosingMode && !isCreating) {
39665
+ if (startInCreate && !startInCreateHandledRef.current && !isChoosingMode && !isCreating) {
39666
+ startInCreateHandledRef.current = true;
39642
39667
  setIsChoosingMode(true);
39643
39668
  setIsCreating(false);
39644
39669
  setIsSearching(false);