@agenticmail/enterprise 0.5.246 → 0.5.248

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.
@@ -1,14 +1,21 @@
1
- import { h, useState } from './utils.js';
1
+ import { h, useState, useEffect, useCallback } from './utils.js';
2
2
  import { I } from './icons.js';
3
- import { Modal } from './modal.js';
4
3
 
5
4
  export function HelpButton(props) {
6
5
  var _open = useState(false);
7
6
  var isOpen = _open[0]; var setOpen = _open[1];
8
7
 
8
+ // Close on Escape key
9
+ useEffect(function() {
10
+ if (!isOpen) return;
11
+ function onKey(e) { if (e.key === 'Escape') setOpen(false); }
12
+ document.addEventListener('keydown', onKey);
13
+ return function() { document.removeEventListener('keydown', onKey); };
14
+ }, [isOpen]);
15
+
9
16
  return h('span', { style: { display: 'inline-flex', alignItems: 'center' } },
10
17
  h('button', {
11
- onClick: function(e) { e.stopPropagation(); setOpen(true); },
18
+ onClick: function(e) { e.stopPropagation(); e.preventDefault(); setOpen(!isOpen); },
12
19
  title: 'Learn more about ' + (props.label || 'this section'),
13
20
  style: {
14
21
  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
@@ -22,18 +29,35 @@ export function HelpButton(props) {
22
29
  onMouseLeave: function(e) { e.currentTarget.style.borderColor = 'var(--text-muted, #6b7280)'; e.currentTarget.style.color = 'var(--text-muted, #6b7280)'; }
23
30
  }, '?'),
24
31
  isOpen && h('div', {
25
- style: { position: 'fixed', inset: 0, background: 'var(--bg-modal, rgba(0,0,0,0.7))', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 200, animation: 'fadeIn 150ms ease' },
26
- onClick: function(e) { if (e.target === e.currentTarget) setOpen(false); }
32
+ id: 'help-overlay',
33
+ onMouseDown: function(e) { if (e.target.id === 'help-overlay') setOpen(false); },
34
+ style: {
35
+ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, zIndex: 200,
36
+ background: 'rgba(0,0,0,0.5)',
37
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
38
+ }
27
39
  },
28
- h('div', { className: 'modal', style: { zIndex: 201 } },
29
- h('div', { className: 'modal-header' },
30
- h('h2', null, props.label || 'Help'),
31
- h('button', { className: 'btn btn-ghost btn-icon', onClick: function() { setOpen(false); } }, I.x())
40
+ h('div', {
41
+ style: {
42
+ background: 'var(--bg-card, #181b28)', border: '1px solid var(--border)',
43
+ borderRadius: 'var(--radius-xl, 14px)', width: 520, maxWidth: '92vw', maxHeight: '80vh',
44
+ overflow: 'hidden', boxShadow: '0 25px 50px rgba(0,0,0,0.4)',
45
+ }
46
+ },
47
+ h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '14px 20px', borderBottom: '1px solid var(--border)' } },
48
+ h('h3', { style: { fontSize: 15, fontWeight: 700, margin: 0 } }, props.label || 'Help'),
49
+ h('button', {
50
+ onMouseDown: function(e) { e.stopPropagation(); setOpen(false); },
51
+ style: {
52
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
53
+ width: 28, height: 28, borderRadius: 6, border: 'none',
54
+ background: 'var(--bg-tertiary)', color: 'var(--text-secondary)',
55
+ cursor: 'pointer', fontSize: 14,
56
+ }
57
+ }, I.x())
32
58
  ),
33
- h('div', { className: 'modal-body' },
34
- h('div', { style: { fontSize: 14, lineHeight: 1.7, color: 'var(--text-secondary, #9ca3af)', padding: '4px 0' } },
35
- props.children
36
- )
59
+ h('div', { style: { padding: '16px 20px', overflowY: 'auto', maxHeight: 'calc(80vh - 60px)', fontSize: 14, lineHeight: 1.7, color: 'var(--text-secondary, #9ca3af)' } },
60
+ props.children
37
61
  )
38
62
  )
39
63
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/enterprise",
3
- "version": "0.5.246",
3
+ "version": "0.5.248",
4
4
  "description": "AgenticMail Enterprise — cloud-hosted AI agent identity, email, auth & compliance for organizations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,14 +1,21 @@
1
- import { h, useState } from './utils.js';
1
+ import { h, useState, useEffect, useCallback } from './utils.js';
2
2
  import { I } from './icons.js';
3
- import { Modal } from './modal.js';
4
3
 
5
4
  export function HelpButton(props) {
6
5
  var _open = useState(false);
7
6
  var isOpen = _open[0]; var setOpen = _open[1];
8
7
 
8
+ // Close on Escape key
9
+ useEffect(function() {
10
+ if (!isOpen) return;
11
+ function onKey(e) { if (e.key === 'Escape') setOpen(false); }
12
+ document.addEventListener('keydown', onKey);
13
+ return function() { document.removeEventListener('keydown', onKey); };
14
+ }, [isOpen]);
15
+
9
16
  return h('span', { style: { display: 'inline-flex', alignItems: 'center' } },
10
17
  h('button', {
11
- onClick: function(e) { e.stopPropagation(); setOpen(true); },
18
+ onClick: function(e) { e.stopPropagation(); e.preventDefault(); setOpen(!isOpen); },
12
19
  title: 'Learn more about ' + (props.label || 'this section'),
13
20
  style: {
14
21
  display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
@@ -22,18 +29,35 @@ export function HelpButton(props) {
22
29
  onMouseLeave: function(e) { e.currentTarget.style.borderColor = 'var(--text-muted, #6b7280)'; e.currentTarget.style.color = 'var(--text-muted, #6b7280)'; }
23
30
  }, '?'),
24
31
  isOpen && h('div', {
25
- style: { position: 'fixed', inset: 0, background: 'var(--bg-modal, rgba(0,0,0,0.7))', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 200, animation: 'fadeIn 150ms ease' },
26
- onClick: function(e) { if (e.target === e.currentTarget) setOpen(false); }
32
+ id: 'help-overlay',
33
+ onMouseDown: function(e) { if (e.target.id === 'help-overlay') setOpen(false); },
34
+ style: {
35
+ position: 'fixed', top: 0, left: 0, right: 0, bottom: 0, zIndex: 200,
36
+ background: 'rgba(0,0,0,0.5)',
37
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
38
+ }
27
39
  },
28
- h('div', { className: 'modal', style: { zIndex: 201 } },
29
- h('div', { className: 'modal-header' },
30
- h('h2', null, props.label || 'Help'),
31
- h('button', { className: 'btn btn-ghost btn-icon', onClick: function() { setOpen(false); } }, I.x())
40
+ h('div', {
41
+ style: {
42
+ background: 'var(--bg-card, #181b28)', border: '1px solid var(--border)',
43
+ borderRadius: 'var(--radius-xl, 14px)', width: 520, maxWidth: '92vw', maxHeight: '80vh',
44
+ overflow: 'hidden', boxShadow: '0 25px 50px rgba(0,0,0,0.4)',
45
+ }
46
+ },
47
+ h('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '14px 20px', borderBottom: '1px solid var(--border)' } },
48
+ h('h3', { style: { fontSize: 15, fontWeight: 700, margin: 0 } }, props.label || 'Help'),
49
+ h('button', {
50
+ onMouseDown: function(e) { e.stopPropagation(); setOpen(false); },
51
+ style: {
52
+ display: 'flex', alignItems: 'center', justifyContent: 'center',
53
+ width: 28, height: 28, borderRadius: 6, border: 'none',
54
+ background: 'var(--bg-tertiary)', color: 'var(--text-secondary)',
55
+ cursor: 'pointer', fontSize: 14,
56
+ }
57
+ }, I.x())
32
58
  ),
33
- h('div', { className: 'modal-body' },
34
- h('div', { style: { fontSize: 14, lineHeight: 1.7, color: 'var(--text-secondary, #9ca3af)', padding: '4px 0' } },
35
- props.children
36
- )
59
+ h('div', { style: { padding: '16px 20px', overflowY: 'auto', maxHeight: 'calc(80vh - 60px)', fontSize: 14, lineHeight: 1.7, color: 'var(--text-secondary, #9ca3af)' } },
60
+ props.children
37
61
  )
38
62
  )
39
63
  )