@goodandready/dsh-cron 0.3.48 → 0.3.49

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/lib/client.css CHANGED
@@ -140,6 +140,8 @@
140
140
  }
141
141
 
142
142
  .dsh-cron-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); overflow-y: auto; padding: 24px 48px 32px; z-index: 100; box-sizing: border-box; }
143
+ .dsh-cron-shell-overlay { position: fixed; inset: 0; z-index: 9999; overflow: auto; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); box-sizing: border-box; }
144
+ .dsh-cron-shell-overlay-inner { max-width: 1100px; margin: 0 auto; padding: 16px; box-sizing: border-box; }
143
145
  .dsh-cron-container { max-width: 960px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 8px 0 32px; box-sizing: border-box; }
144
146
 
145
147
  .dsh-cron-top-bar { display: flex; align-items: center; gap: 12px; }
package/lib/client.js CHANGED
@@ -771,7 +771,7 @@ const [isOpen, setIsOpen] = React.useState(toggle && typeof toggle.isOpen === 'f
771
771
  React.useEffect(() => {if (!toggle || typeof toggle.subscribe !== 'function') return;
772
772
  return toggle.subscribe((val) => setIsOpen(val));
773
773
  }, [toggle]);
774
- if (!isOpen) return null;
774
+ if (!isOpen && props.pinned !== true) return null;
775
775
  const [tab, setTab] = React.useState('all');
776
776
  const [query, setQuery] = React.useState('');
777
777
  const [filterType, setFilterType] = React.useState('');
@@ -2699,6 +2699,7 @@ if (state.root !== undefined && state.root.isConnected) state.root.remove();
2699
2699
  state.root = undefined;
2700
2700
  };
2701
2701
  }
2702
+ let shellOverlayActive = false;
2702
2703
  function mountCronScreen(ctx, toggle) {if (typeof document === 'undefined') return () => {};
2703
2704
  let root;
2704
2705
  let container;
@@ -2712,11 +2713,9 @@ container = undefined;
2712
2713
  const ensure = () => {if (!toggle.isOpen()) {teardownPanel();
2713
2714
  return;
2714
2715
  }
2715
- const layoutService = optionalService(ctx, 'layout');
2716
- if (layoutService && typeof layoutService.panelInfo?.getSnapshot === 'function') {if (layoutService.panelInfo.getSnapshot()?.activePanelId === 'dsh-cron') {teardownPanel();
2716
+ if (shellOverlayActive) {teardownPanel();
2717
2717
  return;
2718
2718
  }
2719
- }
2720
2719
  if (container !== undefined && container.isConnected) return;
2721
2720
  const column = document.querySelector(COLUMN_SELECTOR);
2722
2721
  if (column === null) return;
@@ -2739,7 +2738,8 @@ teardownPanel();
2739
2738
  };
2740
2739
  const onOtherActivate = (event) => {if (event.detail !== PANEL && toggle.isOpen()) toggle.set(false);
2741
2740
  };
2742
- const onOutsideClick = (event) => {if (!toggle.isOpen()) return;
2741
+ const onOutsideClick = (event) => {if (shellOverlayActive) return;
2742
+ if (!toggle.isOpen()) return;
2743
2743
  if (!shouldDismissPanel(event.target)) return;
2744
2744
  toggle.set(false);
2745
2745
  };
@@ -2793,11 +2793,11 @@ const cardSlot = cardOk ? 'settings.plugin.item' : undefined;
2793
2793
  const chipSlot = chipOk ? 'conversation.session.header.utilities' : undefined;
2794
2794
  function CronNavIcon(props) {
2795
2795
  const size = (props && props.size) || 16;
2796
- return _h('span', {className: 'dsh-cron-nav-icon','data-dsh-cron-entry': '','data-dsh-plugin': 'dsh-cron',style: { width: size, height: size },dangerouslySetInnerHTML: { __html: ICON_TIMER }
2796
+ return _h('span', {className: 'dsh-cron-nav-icon','data-dsh-cron-entry': '','data-dsh-plugin': 'dsh-cron',style: { width: size, height: size },onClick: () => toggle.set(true),dangerouslySetInnerHTML: { __html: ICON_TIMER }
2797
2797
  });
2798
2798
  }
2799
2799
  const navOk = registerIntoMount(ctx, 'sidebar.panellist', {name: 'sidebar.panellist',id: 'dsh-cron',order: 12,label: () => translate('sidebar.label'),locale: NS,}, CronNavIcon);
2800
- function CronMainPage(props) {
2800
+ function CronMainPage(props) {if (shellOverlayActive) return null;
2801
2801
  return _h(ErrorBoundary, null, _h(CronScreen, {...props,ctx: props.ctx || ctx,toggle: props.toggle || toggle,t: translate,onClose: () => {
2802
2802
  const layoutService = optionalService(ctx, 'layout');
2803
2803
  if (layoutService && typeof layoutService.selectPanel === 'function') {layoutService.selectPanel(null);
@@ -2807,6 +2807,32 @@ toggle.set(false);
2807
2807
  }));
2808
2808
  }
2809
2809
  const mainOk = registerIntoMount(ctx, 'main', {name: 'main',key: 'dsh-cron',locale: NS,inject: () => ({ ctx, toggle }),}, CronMainPage);
2810
+ function CronShellOverlay() {
2811
+ const [open, setOpen] = React.useState(toggle.isOpen());
2812
+ React.useEffect(() => {shellOverlayActive = true;
2813
+ const off = toggle.subscribe(setOpen);
2814
+ setOpen(toggle.isOpen());
2815
+ return () => {shellOverlayActive = false;
2816
+ off();
2817
+ };
2818
+ }, []);
2819
+ if (!open) return null;
2820
+ return _h('div', {className: 'dsh-cron-shell-overlay','data-dsh-plugin': 'dsh-cron',[VIEW_ATTR]: '',}, _h('div', { className: 'dsh-cron-shell-overlay-inner' },_h(ErrorBoundary, null, _h(CronScreen, {ctx,toggle,pinned: true,t: translate,onClose: () => {
2821
+ const layoutService = optionalService(ctx, 'layout');
2822
+ if (layoutService && typeof layoutService.selectPanel === 'function') {layoutService.selectPanel(null);
2823
+ }
2824
+ toggle.set(false);
2825
+ },}))));
2826
+ }
2827
+ const isDesktopShell = (() => {try {if (typeof location === 'undefined') return false;
2828
+ if (location.protocol === 'dsh-app:') return true;
2829
+ return String(location.host || '').toLowerCase() === 'app';
2830
+ } catch (err) {
2831
+ return false;
2832
+ }
2833
+ })();
2834
+ if (isDesktopShell) {registerIntoMount(ctx, 'shell.overlay', {name: 'shell.overlay',id: PLUGIN_ID,order: 900,locale: NS,inject: () => ({ ctx, toggle }),}, CronShellOverlay);
2835
+ }
2810
2836
  const layout = optionalService(ctx, 'layout');
2811
2837
  if (layout && typeof layout.selectPanel === 'function') {toggle.subscribe((isOpen) => {if (isOpen) {layout.selectPanel('dsh-cron');
2812
2838
  } else if (layout.panelInfo && typeof layout.panelInfo.getSnapshot === 'function') {if (layout.panelInfo.getSnapshot()?.activePanelId === 'dsh-cron') {layout.selectPanel(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-cron",
3
- "version": "0.3.48",
3
+ "version": "0.3.49",
4
4
  "packageManager": "pnpm@10.33.2",
5
5
  "description": "Background automation runner for DSH: isolated agent runs, script/HTTP/SSH/Docker runtimes, cost guard, notifications, heartbeats.",
6
6
  "type": "module",