flock-core 0.5.0b53__py3-none-any.whl → 0.5.0b55__py3-none-any.whl

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.

Potentially problematic release.


This version of flock-core might be problematic. Click here for more details.

@@ -20,6 +20,28 @@ const ModuleWindow: React.FC<ModuleWindowProps> = memo(({ instanceId }) => {
20
20
  removeModule(instanceId);
21
21
  }, [instanceId, removeModule]);
22
22
 
23
+ const handleMaximize = useCallback(() => {
24
+ if (!instance) return;
25
+
26
+ if (instance.maximized) {
27
+ // Restore to previous size/position
28
+ updateModule(instanceId, {
29
+ maximized: false,
30
+ position: instance.preMaximizePosition || instance.position,
31
+ size: instance.preMaximizeSize || instance.size,
32
+ });
33
+ } else {
34
+ // Maximize to full viewport
35
+ updateModule(instanceId, {
36
+ maximized: true,
37
+ preMaximizePosition: instance.position,
38
+ preMaximizeSize: instance.size,
39
+ position: { x: 0, y: 0 },
40
+ size: { width: window.innerWidth, height: window.innerHeight },
41
+ });
42
+ }
43
+ }, [instanceId, instance, updateModule]);
44
+
23
45
  // Don't render if instance doesn't exist or is not visible
24
46
  if (!instance || !instance.visible) return null;
25
47
 
@@ -37,6 +59,8 @@ const ModuleWindow: React.FC<ModuleWindowProps> = memo(({ instanceId }) => {
37
59
  <Rnd
38
60
  position={position}
39
61
  size={size}
62
+ disableDragging={instance.maximized}
63
+ enableResizing={!instance.maximized}
40
64
  onDragStop={(_e, d) => {
41
65
  updateModule(instanceId, {
42
66
  position: { x: d.x, y: d.y },
@@ -86,7 +110,7 @@ const ModuleWindow: React.FC<ModuleWindowProps> = memo(({ instanceId }) => {
86
110
  padding: 'var(--space-component-md) var(--space-component-lg)',
87
111
  background: 'rgba(42, 42, 50, 0.5)',
88
112
  borderBottom: 'var(--border-width-1) solid var(--color-border-subtle)',
89
- cursor: 'move',
113
+ cursor: instance.maximized ? 'default' : 'move',
90
114
  userSelect: 'none',
91
115
  }}
92
116
  >
@@ -105,34 +129,78 @@ const ModuleWindow: React.FC<ModuleWindowProps> = memo(({ instanceId }) => {
105
129
  {moduleDefinition.name}
106
130
  </span>
107
131
  </div>
108
- <button
109
- onClick={handleClose}
110
- aria-label="Close window"
111
- style={{
112
- background: 'transparent',
113
- border: 'none',
114
- color: 'var(--color-text-secondary)',
115
- fontSize: 'var(--font-size-h3)',
116
- cursor: 'pointer',
117
- padding: 'var(--spacing-1) var(--spacing-2)',
118
- lineHeight: 1,
119
- borderRadius: 'var(--radius-md)',
120
- transition: 'var(--transition-colors)',
121
- display: 'flex',
122
- alignItems: 'center',
123
- justifyContent: 'center',
124
- }}
125
- onMouseEnter={(e) => {
126
- e.currentTarget.style.color = 'var(--color-error)';
127
- e.currentTarget.style.background = 'var(--color-error-bg)';
128
- }}
129
- onMouseLeave={(e) => {
130
- e.currentTarget.style.color = 'var(--color-text-secondary)';
131
- e.currentTarget.style.background = 'transparent';
132
- }}
133
- >
134
- ×
135
- </button>
132
+ <div style={{ display: 'flex', alignItems: 'center', gap: 'var(--gap-xs)' }}>
133
+ {/* Maximize/Restore button */}
134
+ <button
135
+ onClick={handleMaximize}
136
+ aria-label={instance.maximized ? 'Restore window' : 'Maximize window'}
137
+ title={instance.maximized ? 'Restore' : 'Maximize'}
138
+ style={{
139
+ background: 'transparent',
140
+ border: 'none',
141
+ color: 'var(--color-text-secondary)',
142
+ fontSize: '16px',
143
+ cursor: 'pointer',
144
+ padding: 'var(--spacing-1) var(--spacing-2)',
145
+ lineHeight: 1,
146
+ borderRadius: 'var(--radius-md)',
147
+ transition: 'var(--transition-colors)',
148
+ display: 'flex',
149
+ alignItems: 'center',
150
+ justifyContent: 'center',
151
+ }}
152
+ onMouseEnter={(e) => {
153
+ e.currentTarget.style.color = 'var(--color-text-primary)';
154
+ e.currentTarget.style.background = 'var(--color-bg-elevated)';
155
+ }}
156
+ onMouseLeave={(e) => {
157
+ e.currentTarget.style.color = 'var(--color-text-secondary)';
158
+ e.currentTarget.style.background = 'transparent';
159
+ }}
160
+ >
161
+ {instance.maximized ? (
162
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" strokeWidth="1.5">
163
+ <rect x="4" y="4" width="6" height="6" />
164
+ <path d="M2 2h4v4M12 12H8V8" />
165
+ </svg>
166
+ ) : (
167
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" strokeWidth="1.5">
168
+ <rect x="2" y="2" width="10" height="10" />
169
+ </svg>
170
+ )}
171
+ </button>
172
+
173
+ {/* Close button */}
174
+ <button
175
+ onClick={handleClose}
176
+ aria-label="Close window"
177
+ title="Close"
178
+ style={{
179
+ background: 'transparent',
180
+ border: 'none',
181
+ color: 'var(--color-text-secondary)',
182
+ fontSize: 'var(--font-size-h3)',
183
+ cursor: 'pointer',
184
+ padding: 'var(--spacing-1) var(--spacing-2)',
185
+ lineHeight: 1,
186
+ borderRadius: 'var(--radius-md)',
187
+ transition: 'var(--transition-colors)',
188
+ display: 'flex',
189
+ alignItems: 'center',
190
+ justifyContent: 'center',
191
+ }}
192
+ onMouseEnter={(e) => {
193
+ e.currentTarget.style.color = 'var(--color-error)';
194
+ e.currentTarget.style.background = 'var(--color-error-bg)';
195
+ }}
196
+ onMouseLeave={(e) => {
197
+ e.currentTarget.style.color = 'var(--color-text-secondary)';
198
+ e.currentTarget.style.background = 'transparent';
199
+ }}
200
+ >
201
+ ×
202
+ </button>
203
+ </div>
136
204
  </div>
137
205
 
138
206
  {/* Module Content */}