node-mac-recorder 2.5.4 → 2.5.6

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.5.4",
3
+ "version": "2.5.6",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -59,6 +59,9 @@ bool hideScreenRecordingPreview();
59
59
  if (self) {
60
60
  self.wantsLayer = YES;
61
61
  self.layer.backgroundColor = [[NSColor clearColor] CGColor];
62
+ // Ensure no borders or decorations
63
+ self.layer.borderWidth = 0.0;
64
+ self.layer.cornerRadius = 0.0;
62
65
  }
63
66
  return self;
64
67
  }
@@ -72,6 +75,7 @@ bool hideScreenRecordingPreview();
72
75
  [[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.25] setFill];
73
76
  NSRectFill(self.bounds);
74
77
 
78
+ // Ensure no borders or frames are drawn
75
79
  // Text will be handled by separate label above button
76
80
  }
77
81
 
@@ -89,6 +93,9 @@ bool hideScreenRecordingPreview();
89
93
  if (self) {
90
94
  self.wantsLayer = YES;
91
95
  self.layer.backgroundColor = [[NSColor clearColor] CGColor];
96
+ // Ensure no borders or decorations
97
+ self.layer.borderWidth = 0.0;
98
+ self.layer.cornerRadius = 0.0;
92
99
  }
93
100
  return self;
94
101
  }
@@ -141,6 +148,9 @@ bool hideScreenRecordingPreview();
141
148
  if (self) {
142
149
  self.wantsLayer = YES;
143
150
  self.layer.backgroundColor = [[NSColor clearColor] CGColor];
151
+ // Ensure no borders or decorations
152
+ self.layer.borderWidth = 0.0;
153
+ self.layer.cornerRadius = 0.0;
144
154
  }
145
155
  return self;
146
156
  }
@@ -151,6 +161,7 @@ bool hideScreenRecordingPreview();
151
161
  if (!self.screenInfo) return;
152
162
 
153
163
  // Background with transparency - purple tone (no border)
164
+ // Ensure no borders or frames are drawn
154
165
  [[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.3] setFill];
155
166
  NSRectFill(self.bounds);
156
167
 
@@ -510,7 +521,7 @@ void updateOverlay() {
510
521
  appIconView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 96, 96)];
511
522
  [appIconView setImageScaling:NSImageScaleProportionallyUpOrDown];
512
523
  [appIconView setWantsLayer:YES];
513
- [appIconView.layer setCornerRadius:16.0];
524
+ [appIconView.layer setCornerRadius:8.0];
514
525
  [appIconView.layer setMasksToBounds:YES];
515
526
  [appIconView.layer setBackgroundColor:[[NSColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.3] CGColor]]; // Debug background
516
527
  [g_overlayWindow.contentView addSubview:appIconView];
@@ -566,30 +577,20 @@ void updateOverlay() {
566
577
  NSLog(@"🎯 Positioning app icon at: (%.0f, %.0f) for window size: (%.0f, %.0f)",
567
578
  iconCenter.x, iconCenter.y, (float)width, (float)height);
568
579
 
569
- // Add smooth floating animation after positioning
570
- [appIconView.layer removeAnimationForKey:@"floatAnimation"];
580
+ // Add fast horizontal floating animation after positioning
581
+ [appIconView.layer removeAnimationForKey:@"floatAnimationX"];
571
582
  [appIconView.layer removeAnimationForKey:@"floatAnimationY"];
572
583
 
573
- // Horizontal float animation
584
+ // Faster horizontal float animation only
574
585
  CABasicAnimation *floatAnimationX = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
575
- floatAnimationX.fromValue = @(-5.0);
576
- floatAnimationX.toValue = @(5.0);
577
- floatAnimationX.duration = 3.5;
586
+ floatAnimationX.fromValue = @(-4.0);
587
+ floatAnimationX.toValue = @(4.0);
588
+ floatAnimationX.duration = 2.5; // Faster animation
578
589
  floatAnimationX.repeatCount = HUGE_VALF;
579
590
  floatAnimationX.autoreverses = YES;
580
591
  floatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
581
592
  [appIconView.layer addAnimation:floatAnimationX forKey:@"floatAnimationX"];
582
593
 
583
- // Subtle vertical float animation (slightly offset timing)
584
- CABasicAnimation *floatAnimationY = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
585
- floatAnimationY.fromValue = @(-2.0);
586
- floatAnimationY.toValue = @(2.0);
587
- floatAnimationY.duration = 4.5;
588
- floatAnimationY.repeatCount = HUGE_VALF;
589
- floatAnimationY.autoreverses = YES;
590
- floatAnimationY.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
591
- [appIconView.layer addAnimation:floatAnimationY forKey:@"floatAnimationY"];
592
-
593
594
  // Position info label at overlay center, above button
594
595
  NSPoint labelCenter = NSMakePoint(
595
596
  (width - [infoLabel frame].size.width) / 2, // Center horizontally
@@ -722,6 +723,12 @@ bool showRecordingPreview(NSDictionary *windowInfo) {
722
723
  [g_recordingPreviewWindow setAlphaValue:1.0];
723
724
  [g_recordingPreviewWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
724
725
 
726
+ // Remove any default window decorations and borders
727
+ [g_recordingPreviewWindow setTitlebarAppearsTransparent:YES];
728
+ [g_recordingPreviewWindow setTitleVisibility:NSWindowTitleHidden];
729
+ [g_recordingPreviewWindow setMovable:NO];
730
+ [g_recordingPreviewWindow setMovableByWindowBackground:NO];
731
+
725
732
  // Create preview view
726
733
  g_recordingPreviewView = [[RecordingPreviewView alloc] initWithFrame:screenFrame];
727
734
  [(RecordingPreviewView *)g_recordingPreviewView setRecordingWindowInfo:windowInfo];
@@ -829,6 +836,12 @@ bool startScreenSelection() {
829
836
  [overlayWindow setAlphaValue:1.0];
830
837
  [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
831
838
 
839
+ // Remove any default window decorations and borders
840
+ [overlayWindow setTitlebarAppearsTransparent:YES];
841
+ [overlayWindow setTitleVisibility:NSWindowTitleHidden];
842
+ [overlayWindow setMovable:NO];
843
+ [overlayWindow setMovableByWindowBackground:NO];
844
+
832
845
  // Create overlay view
833
846
  ScreenSelectorOverlayView *overlayView = [[ScreenSelectorOverlayView alloc] initWithFrame:screenFrame];
834
847
  [overlayView setScreenInfo:screenInfo];
@@ -838,16 +851,22 @@ bool startScreenSelection() {
838
851
  NSButton *selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
839
852
  [selectButton setTitle:@"Start Record"];
840
853
  [selectButton setButtonType:NSButtonTypeMomentaryPushIn];
841
- [selectButton setBezelStyle:NSBezelStyleRegularSquare];
854
+ [selectButton setBordered:NO];
842
855
  [selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
843
856
  [selectButton setTag:i]; // Set screen index as tag
844
857
 
845
858
  // Modern button styling with purple tone
846
859
  [selectButton setWantsLayer:YES];
847
860
  [selectButton.layer setBackgroundColor:[[NSColor colorWithRed:0.55 green:0.3 blue:0.75 alpha:0.95] CGColor]];
848
- [selectButton.layer setCornerRadius:14.0];
861
+ [selectButton.layer setCornerRadius:8.0];
849
862
  [selectButton.layer setBorderWidth:0.0];
850
863
 
864
+ // Remove all button borders and decorations
865
+ [selectButton.layer setShadowOpacity:0.0];
866
+ [selectButton.layer setShadowRadius:0.0];
867
+ [selectButton.layer setShadowOffset:NSMakeSize(0, 0)];
868
+ [selectButton.layer setMasksToBounds:YES];
869
+
851
870
  // Clean white text - normal weight
852
871
  [selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
853
872
  [selectButton setTitle:@"Start Record"];
@@ -867,19 +886,29 @@ bool startScreenSelection() {
867
886
  [selectButton setTarget:g_delegate];
868
887
  [selectButton setAction:@selector(screenSelectButtonClicked:)];
869
888
 
889
+ // Remove focus ring and other default button behaviors
890
+ [selectButton setFocusRingType:NSFocusRingTypeNone];
891
+ [selectButton setShowsBorderOnlyWhileMouseInside:NO];
892
+
870
893
  // Create cancel button for screen selection
871
894
  NSButton *screenCancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 120, 40)];
872
895
  [screenCancelButton setTitle:@"Cancel"];
873
896
  [screenCancelButton setButtonType:NSButtonTypeMomentaryPushIn];
874
- [screenCancelButton setBezelStyle:NSBezelStyleRegularSquare];
897
+ [screenCancelButton setBordered:NO];
875
898
  [screenCancelButton setFont:[NSFont systemFontOfSize:14 weight:NSFontWeightMedium]];
876
899
 
877
900
  // Modern cancel button styling - darker gray, clean
878
901
  [screenCancelButton setWantsLayer:YES];
879
902
  [screenCancelButton.layer setBackgroundColor:[[NSColor colorWithRed:0.35 green:0.35 blue:0.4 alpha:0.9] CGColor]];
880
- [screenCancelButton.layer setCornerRadius:12.0];
903
+ [screenCancelButton.layer setCornerRadius:8.0];
881
904
  [screenCancelButton.layer setBorderWidth:0.0];
882
905
 
906
+ // Remove all button borders and decorations
907
+ [screenCancelButton.layer setShadowOpacity:0.0];
908
+ [screenCancelButton.layer setShadowRadius:0.0];
909
+ [screenCancelButton.layer setShadowOffset:NSMakeSize(0, 0)];
910
+ [screenCancelButton.layer setMasksToBounds:YES];
911
+
883
912
  // Clean white text for cancel button
884
913
  [screenCancelButton setFont:[NSFont systemFontOfSize:15 weight:NSFontWeightRegular]];
885
914
  NSMutableAttributedString *screenCancelTitleString = [[NSMutableAttributedString alloc]
@@ -892,6 +921,10 @@ bool startScreenSelection() {
892
921
  [screenCancelButton setTarget:g_delegate];
893
922
  [screenCancelButton setAction:@selector(cancelButtonClicked:)];
894
923
 
924
+ // Remove focus ring and other default button behaviors
925
+ [screenCancelButton setFocusRingType:NSFocusRingTypeNone];
926
+ [screenCancelButton setShowsBorderOnlyWhileMouseInside:NO];
927
+
895
928
  // Create info label for screen
896
929
  NSTextField *screenInfoLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, screenFrame.size.width - 40, 60)];
897
930
  [screenInfoLabel setEditable:NO];
@@ -906,7 +939,7 @@ bool startScreenSelection() {
906
939
  NSImageView *screenIconView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 96, 96)];
907
940
  [screenIconView setImageScaling:NSImageScaleProportionallyUpOrDown];
908
941
  [screenIconView setWantsLayer:YES];
909
- [screenIconView.layer setCornerRadius:16.0];
942
+ [screenIconView.layer setCornerRadius:8.0];
910
943
  [screenIconView.layer setMasksToBounds:YES];
911
944
 
912
945
  // Set display icon
@@ -933,26 +966,16 @@ bool startScreenSelection() {
933
966
  );
934
967
  [screenIconView setFrameOrigin:iconCenter];
935
968
 
936
- // Add smooth floating animation to screen icon
969
+ // Add fast horizontal floating animation to screen icon
937
970
  CABasicAnimation *screenFloatAnimationX = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
938
- screenFloatAnimationX.fromValue = @(-5.0);
939
- screenFloatAnimationX.toValue = @(5.0);
940
- screenFloatAnimationX.duration = 4.0; // Slightly different duration for variety
971
+ screenFloatAnimationX.fromValue = @(-4.0);
972
+ screenFloatAnimationX.toValue = @(4.0);
973
+ screenFloatAnimationX.duration = 2.8; // Slightly different timing for variety
941
974
  screenFloatAnimationX.repeatCount = HUGE_VALF;
942
975
  screenFloatAnimationX.autoreverses = YES;
943
976
  screenFloatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
944
977
  [screenIconView.layer addAnimation:screenFloatAnimationX forKey:@"floatAnimationX"];
945
978
 
946
- // Subtle vertical float for screen icon
947
- CABasicAnimation *screenFloatAnimationY = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
948
- screenFloatAnimationY.fromValue = @(-2.0);
949
- screenFloatAnimationY.toValue = @(2.0);
950
- screenFloatAnimationY.duration = 5.0; // Different timing than window icons
951
- screenFloatAnimationY.repeatCount = HUGE_VALF;
952
- screenFloatAnimationY.autoreverses = YES;
953
- screenFloatAnimationY.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
954
- [screenIconView.layer addAnimation:screenFloatAnimationY forKey:@"floatAnimationY"];
955
-
956
979
  // Position info label at screen center, above button
957
980
  NSPoint labelCenter = NSMakePoint(
958
981
  (screenFrame.size.width - [screenInfoLabel frame].size.width) / 2, // Center horizontally
@@ -1062,6 +1085,12 @@ bool showScreenRecordingPreview(NSDictionary *screenInfo) {
1062
1085
  [overlayWindow setAlphaValue:1.0];
1063
1086
  [overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
1064
1087
 
1088
+ // Remove any default window decorations and borders
1089
+ [overlayWindow setTitlebarAppearsTransparent:YES];
1090
+ [overlayWindow setTitleVisibility:NSWindowTitleHidden];
1091
+ [overlayWindow setMovable:NO];
1092
+ [overlayWindow setMovableByWindowBackground:NO];
1093
+
1065
1094
  [overlayWindow orderFront:nil];
1066
1095
  [overlayWindow makeKeyAndOrderFront:nil];
1067
1096
 
@@ -1119,23 +1148,39 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1119
1148
  [g_overlayWindow setAlphaValue:1.0];
1120
1149
  [g_overlayWindow setCollectionBehavior:NSWindowCollectionBehaviorStationary | NSWindowCollectionBehaviorCanJoinAllSpaces];
1121
1150
 
1151
+ // Remove any default window decorations and borders
1152
+ [g_overlayWindow setTitlebarAppearsTransparent:YES];
1153
+ [g_overlayWindow setTitleVisibility:NSWindowTitleHidden];
1154
+ [g_overlayWindow setMovable:NO];
1155
+ [g_overlayWindow setMovableByWindowBackground:NO];
1156
+
1122
1157
  // Create overlay view
1123
1158
  g_overlayView = [[WindowSelectorOverlayView alloc] initWithFrame:initialFrame];
1124
1159
  [g_overlayWindow setContentView:g_overlayView];
1125
1160
 
1161
+ // Additional window styling to ensure no borders or decorations
1162
+ [g_overlayWindow setMovable:NO];
1163
+ [g_overlayWindow setMovableByWindowBackground:NO];
1164
+
1126
1165
  // Create select button with purple theme
1127
1166
  g_selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
1128
1167
  [g_selectButton setTitle:@"Start Record"];
1129
1168
  [g_selectButton setButtonType:NSButtonTypeMomentaryPushIn];
1130
- [g_selectButton setBezelStyle:NSBezelStyleRegularSquare];
1169
+ [g_selectButton setBordered:NO];
1131
1170
  [g_selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
1132
1171
 
1133
1172
  // Modern button styling with purple tone
1134
1173
  [g_selectButton setWantsLayer:YES];
1135
1174
  [g_selectButton.layer setBackgroundColor:[[NSColor colorWithRed:0.55 green:0.3 blue:0.75 alpha:0.95] CGColor]];
1136
- [g_selectButton.layer setCornerRadius:14.0];
1175
+ [g_selectButton.layer setCornerRadius:8.0];
1137
1176
  [g_selectButton.layer setBorderWidth:0.0];
1138
1177
 
1178
+ // Remove all button borders and decorations
1179
+ [g_selectButton.layer setShadowOpacity:0.0];
1180
+ [g_selectButton.layer setShadowRadius:0.0];
1181
+ [g_selectButton.layer setShadowOffset:NSMakeSize(0, 0)];
1182
+ [g_selectButton.layer setMasksToBounds:YES];
1183
+
1139
1184
  // Clean white text - normal weight
1140
1185
  NSMutableAttributedString *titleString = [[NSMutableAttributedString alloc]
1141
1186
  initWithString:[g_selectButton title]];
@@ -1149,6 +1194,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1149
1194
  [g_selectButton setTarget:g_delegate];
1150
1195
  [g_selectButton setAction:@selector(selectButtonClicked:)];
1151
1196
 
1197
+ // Remove focus ring and other default button behaviors
1198
+ [g_selectButton setFocusRingType:NSFocusRingTypeNone];
1199
+ [g_selectButton setShowsBorderOnlyWhileMouseInside:NO];
1200
+
1152
1201
  // Add select button directly to window (not view) for proper layering
1153
1202
  [g_overlayWindow.contentView addSubview:g_selectButton];
1154
1203
 
@@ -1156,15 +1205,21 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1156
1205
  NSButton *cancelButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 120, 40)];
1157
1206
  [cancelButton setTitle:@"Cancel"];
1158
1207
  [cancelButton setButtonType:NSButtonTypeMomentaryPushIn];
1159
- [cancelButton setBezelStyle:NSBezelStyleRegularSquare];
1208
+ [cancelButton setBordered:NO];
1160
1209
  [cancelButton setFont:[NSFont systemFontOfSize:14 weight:NSFontWeightRegular]];
1161
1210
 
1162
1211
  // Modern cancel button styling - darker gray, clean
1163
1212
  [cancelButton setWantsLayer:YES];
1164
1213
  [cancelButton.layer setBackgroundColor:[[NSColor colorWithRed:0.35 green:0.35 blue:0.4 alpha:0.9] CGColor]];
1165
- [cancelButton.layer setCornerRadius:12.0];
1214
+ [cancelButton.layer setCornerRadius:8.0];
1166
1215
  [cancelButton.layer setBorderWidth:0.0];
1167
1216
 
1217
+ // Remove all button borders and decorations
1218
+ [cancelButton.layer setShadowOpacity:0.0];
1219
+ [cancelButton.layer setShadowRadius:0.0];
1220
+ [cancelButton.layer setShadowOffset:NSMakeSize(0, 0)];
1221
+ [cancelButton.layer setMasksToBounds:YES];
1222
+
1168
1223
  // Clean white text for cancel button
1169
1224
  NSMutableAttributedString *cancelTitleString = [[NSMutableAttributedString alloc]
1170
1225
  initWithString:[cancelButton title]];
@@ -1176,6 +1231,10 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
1176
1231
  [cancelButton setTarget:g_delegate];
1177
1232
  [cancelButton setAction:@selector(cancelButtonClicked:)];
1178
1233
 
1234
+ // Remove focus ring and other default button behaviors
1235
+ [cancelButton setFocusRingType:NSFocusRingTypeNone];
1236
+ [cancelButton setShowsBorderOnlyWhileMouseInside:NO];
1237
+
1179
1238
  // Add cancel button to window
1180
1239
  [g_overlayWindow.contentView addSubview:cancelButton];
1181
1240