node-mac-recorder 2.17.6 → 2.17.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.17.6",
3
+ "version": "2.17.8",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -112,7 +112,7 @@ NSString* getCursorType() {
112
112
  [elementRole isEqualToString:@"AXTooltip"]) {
113
113
  cursorType = @"help";
114
114
  }
115
- // RESIZE CURSORS
115
+ // RESIZE CURSORS - sadece AXSplitter için
116
116
  else if ([elementRole isEqualToString:@"AXSplitter"]) {
117
117
  // Get splitter orientation to determine resize direction
118
118
  CFStringRef orientation = NULL;
@@ -120,32 +120,23 @@ NSString* getCursorType() {
120
120
  if (error == kAXErrorSuccess && orientation) {
121
121
  NSString *orientationStr = (__bridge_transfer NSString*)orientation;
122
122
  if ([orientationStr isEqualToString:@"AXHorizontalOrientation"]) {
123
- cursorType = @"row-resize"; // vertical splitter -> row resize
123
+ cursorType = @"ns-resize"; // Yatay splitter -> dikey hareket (north-south)
124
+ } else if ([orientationStr isEqualToString:@"AXVerticalOrientation"]) {
125
+ cursorType = @"col-resize"; // Dikey splitter -> yatay hareket (east-west)
124
126
  } else {
125
- cursorType = @"col-resize"; // horizontal splitter -> col resize
127
+ cursorType = @"default"; // Bilinmeyen orientation
126
128
  }
127
129
  } else {
128
- cursorType = @"col-resize"; // default
130
+ cursorType = @"default"; // Orientation alınamazsa default
129
131
  }
130
132
  }
131
- // SCROLL CURSORS
133
+ // SCROLL CURSORS - hep default olsun, all-scroll görünmesin
132
134
  else if ([elementRole isEqualToString:@"AXScrollBar"]) {
133
- // Check orientation for scroll direction
134
- CFStringRef orientation = NULL;
135
- error = AXUIElementCopyAttributeValue(elementAtPosition, CFSTR("AXOrientation"), (CFTypeRef*)&orientation);
136
- if (error == kAXErrorSuccess && orientation) {
137
- NSString *orientationStr = (__bridge_transfer NSString*)orientation;
138
- if ([orientationStr isEqualToString:@"AXVerticalOrientation"]) {
139
- cursorType = @"ns-resize"; // vertical scrollbar
140
- } else {
141
- cursorType = @"col-resize"; // horizontal scrollbar
142
- }
143
- } else {
144
- cursorType = @"all-scroll";
145
- }
135
+ cursorType = @"default"; // ScrollBar'lar için de default
146
136
  }
137
+ // AXScrollArea - hep default
147
138
  else if ([elementRole isEqualToString:@"AXScrollArea"]) {
148
- cursorType = @"all-scroll";
139
+ cursorType = @"default"; // ScrollArea her zaman default
149
140
  }
150
141
  // CROSSHAIR CURSORS (drawing/selection tools)
151
142
  else if ([elementRole isEqualToString:@"AXCanvas"] ||
@@ -166,50 +157,88 @@ NSString* getCursorType() {
166
157
  cursorType = @"not-allowed";
167
158
  }
168
159
  }
169
- // WINDOW BORDER RESIZE
160
+ // WINDOW BORDER RESIZE - sadece pencere kenarlarında
170
161
  else if ([elementRole isEqualToString:@"AXWindow"]) {
171
- // Check mouse position relative to window bounds for resize detection
172
- CFTypeRef position = NULL;
173
- CFTypeRef size = NULL;
174
- error = AXUIElementCopyAttributeValue(elementAtPosition, kAXPositionAttribute, &position);
175
- AXError sizeError = AXUIElementCopyAttributeValue(elementAtPosition, kAXSizeAttribute, &size);
176
-
177
- if (error == kAXErrorSuccess && sizeError == kAXErrorSuccess && position && size) {
178
- CGPoint windowPos;
179
- CGSize windowSize;
180
- AXValueGetValue((AXValueRef)position, kAXValueTypeCGPoint, &windowPos);
181
- AXValueGetValue((AXValueRef)size, kAXValueTypeCGSize, &windowSize);
182
-
183
- CGFloat x = cursorPos.x - windowPos.x;
184
- CGFloat y = cursorPos.y - windowPos.y;
185
- CGFloat w = windowSize.width;
186
- CGFloat h = windowSize.height;
187
- CGFloat edge = 5.0; // 5px edge detection
188
-
189
- // Corner resize detection
190
- if ((x <= edge && y <= edge) || (x >= w-edge && y >= h-edge)) {
191
- cursorType = @"nwse-resize"; // Top-left or bottom-right corner
192
- }
193
- else if ((x >= w-edge && y <= edge) || (x <= edge && y >= h-edge)) {
194
- cursorType = @"nesw-resize"; // Top-right or bottom-left corner
195
- }
196
- // Edge resize detection
197
- else if (x <= edge || x >= w-edge) {
198
- cursorType = @"col-resize"; // Left or right edge
199
- }
200
- else if (y <= edge || y >= h-edge) {
201
- cursorType = @"row-resize"; // Top or bottom edge
202
- }
203
- else {
162
+ // Check window attributes to see if it's resizable
163
+ CFBooleanRef resizable = NULL;
164
+ AXError resizableError = AXUIElementCopyAttributeValue(elementAtPosition, CFSTR("AXResizeButton"), (CFTypeRef*)&resizable);
165
+
166
+ // Sadece resize edilebilir pencereler için cursor değişimi
167
+ if (resizableError == kAXErrorSuccess || true) { // AXResizeButton bulunamazsa da devam et
168
+ CFTypeRef position = NULL;
169
+ CFTypeRef size = NULL;
170
+ error = AXUIElementCopyAttributeValue(elementAtPosition, kAXPositionAttribute, &position);
171
+ AXError sizeError = AXUIElementCopyAttributeValue(elementAtPosition, kAXSizeAttribute, &size);
172
+
173
+ if (error == kAXErrorSuccess && sizeError == kAXErrorSuccess && position && size) {
174
+ CGPoint windowPos;
175
+ CGSize windowSize;
176
+ AXValueGetValue((AXValueRef)position, kAXValueTypeCGPoint, &windowPos);
177
+ AXValueGetValue((AXValueRef)size, kAXValueTypeCGSize, &windowSize);
178
+
179
+ CGFloat x = cursorPos.x - windowPos.x;
180
+ CGFloat y = cursorPos.y - windowPos.y;
181
+ CGFloat w = windowSize.width;
182
+ CGFloat h = windowSize.height;
183
+ CGFloat edge = 3.0; // Daha küçük edge detection (3px)
184
+
185
+ // Sadece çok kenar köşelerde resize cursor'ı göster
186
+ BOOL isOnBorder = NO;
187
+
188
+ // Corner resize detection - çok dar alanda, doğru açılar
189
+ if (x <= edge && y <= edge) {
190
+ cursorType = @"nwse-resize"; // Sol üst köşe - northwest-southeast
191
+ isOnBorder = YES;
192
+ }
193
+ else if (x >= w-edge && y <= edge) {
194
+ cursorType = @"nesw-resize"; // Sağ üst köşe - northeast-southwest
195
+ isOnBorder = YES;
196
+ }
197
+ else if (x <= edge && y >= h-edge) {
198
+ cursorType = @"nesw-resize"; // Sol alt köşe - southwest-northeast
199
+ isOnBorder = YES;
200
+ }
201
+ else if (x >= w-edge && y >= h-edge) {
202
+ cursorType = @"nwse-resize"; // Sağ alt köşe - southeast-northwest
203
+ isOnBorder = YES;
204
+ }
205
+ // Edge resize detection - sadece çok kenarlarda
206
+ else if (x <= edge && y > edge && y < h-edge) {
207
+ cursorType = @"col-resize"; // Sol kenar - column resize (yatay)
208
+ isOnBorder = YES;
209
+ }
210
+ else if (x >= w-edge && y > edge && y < h-edge) {
211
+ cursorType = @"col-resize"; // Sağ kenar - column resize (yatay)
212
+ isOnBorder = YES;
213
+ }
214
+ else if (y <= edge && x > edge && x < w-edge) {
215
+ cursorType = @"ns-resize"; // Üst kenar - north-south resize (dikey)
216
+ isOnBorder = YES;
217
+ }
218
+ else if (y >= h-edge && x > edge && x < w-edge) {
219
+ cursorType = @"ns-resize"; // Alt kenar - north-south resize (dikey)
220
+ isOnBorder = YES;
221
+ }
222
+
223
+ // Eğer border'da değilse default
224
+ if (!isOnBorder) {
225
+ cursorType = @"default";
226
+ }
227
+
228
+ if (position) CFRelease(position);
229
+ if (size) CFRelease(size);
230
+ } else {
204
231
  cursorType = @"default";
205
232
  }
206
-
207
- if (position) CFRelease(position);
208
- if (size) CFRelease(size);
209
233
  } else {
210
234
  cursorType = @"default";
211
235
  }
212
236
  }
237
+ // HER DURUM İÇİN DEFAULT FALLBACK
238
+ else {
239
+ // Bilinmeyen elementler için her zaman default
240
+ cursorType = @"default";
241
+ }
213
242
 
214
243
  // Check subroles for additional context
215
244
  CFStringRef subrole = NULL;
@@ -218,14 +247,14 @@ NSString* getCursorType() {
218
247
  NSString *elementSubrole = (__bridge_transfer NSString*)subrole;
219
248
  NSLog(@"🎯 ELEMENT SUBROLE: %@", elementSubrole);
220
249
 
221
- // Special button subroles
250
+ // Subrole override'ları - sadece çok spesifik durumlar için
222
251
  if ([elementSubrole isEqualToString:@"AXCloseButton"] ||
223
252
  [elementSubrole isEqualToString:@"AXMinimizeButton"] ||
224
253
  [elementSubrole isEqualToString:@"AXZoomButton"] ||
225
254
  [elementSubrole isEqualToString:@"AXToolbarButton"]) {
226
255
  cursorType = @"pointer";
227
256
  }
228
- // Copy/alias subroles
257
+ // Copy/alias subroles - sadece bu durumlar için override
229
258
  else if ([elementSubrole isEqualToString:@"AXFileDrop"] ||
230
259
  [elementSubrole isEqualToString:@"AXDropTarget"]) {
231
260
  cursorType = @"copy";
@@ -235,18 +264,19 @@ NSString* getCursorType() {
235
264
  [elementSubrole isEqualToString:@"AXShortcut"]) {
236
265
  cursorType = @"alias";
237
266
  }
238
- // Grabbing state (being dragged)
267
+ // Grabbing state (being dragged) - sadece gerçek drag sırasında
239
268
  else if ([elementSubrole isEqualToString:@"AXDragging"] ||
240
269
  [elementSubrole isEqualToString:@"AXMoving"]) {
241
270
  cursorType = @"grabbing";
242
271
  }
243
- // Zoom controls
272
+ // Zoom controls - sadece spesifik zoom butonları için
244
273
  else if ([elementSubrole isEqualToString:@"AXZoomIn"]) {
245
274
  cursorType = @"zoom-in";
246
275
  }
247
276
  else if ([elementSubrole isEqualToString:@"AXZoomOut"]) {
248
277
  cursorType = @"zoom-out";
249
278
  }
279
+ // Subrole'dan bir şey bulamazsa role-based cursor'ı koruyoruz
250
280
  }
251
281
  }
252
282
 
@@ -257,6 +287,11 @@ NSString* getCursorType() {
257
287
  CFRelease(systemWide);
258
288
  }
259
289
 
290
+ // Son güvence - eğer cursorType hala nil veya geçersizse default'a çevir
291
+ if (!cursorType || [cursorType length] == 0) {
292
+ cursorType = @"default";
293
+ }
294
+
260
295
  NSLog(@"🎯 FINAL CURSOR TYPE: %@", cursorType);
261
296
  return cursorType;
262
297