@breakside/jskit 2022.26.0 → 2022.29.0

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.
Files changed (54) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSFileManager+HTML.js +29 -19
  7. package/Frameworks/Foundation.jsframework/JS/JSUserDefaults.js +2 -2
  8. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  9. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  10. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  11. package/Info.json +2 -2
  12. package/Node/io.breakside.jskit-bundle.js +2 -2
  13. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  14. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  15. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  16. package/Root/Frameworks/AuthKit/OAService.js +8 -0
  17. package/Root/Frameworks/AuthKit/Services.yaml +2 -0
  18. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  19. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  20. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  21. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  22. package/Root/Frameworks/DOM/Info.yaml +1 -1
  23. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  24. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  25. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  26. package/Root/Frameworks/Foundation/JSFileManager+HTML.js +29 -19
  27. package/Root/Frameworks/Foundation/JSUserDefaults.js +2 -2
  28. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  29. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  30. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  31. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  32. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  33. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  34. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  35. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  36. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  37. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  38. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  39. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  40. package/Root/Frameworks/UIKit/UIApplication.js +33 -15
  41. package/Root/Frameworks/UIKit/UICheckbox.js +15 -8
  42. package/Root/Frameworks/UIKit/UICollectionView.js +2 -2
  43. package/Root/Frameworks/UIKit/UIDisplayServer.js +51 -10
  44. package/Root/Frameworks/UIKit/UIKit.js +1 -0
  45. package/Root/Frameworks/UIKit/UILayer.js +3 -0
  46. package/Root/Frameworks/UIKit/UIListView.js +10 -6
  47. package/Root/Frameworks/UIKit/UIMenuView.js +77 -18
  48. package/Root/Frameworks/UIKit/UINavigationBar.js +45 -22
  49. package/Root/Frameworks/UIKit/UIScrollView.js +26 -6
  50. package/Root/Frameworks/UIKit/UIState.js +6 -4
  51. package/Root/Frameworks/UIKit/UITextField.js +8 -1
  52. package/Root/Frameworks/UIKit/UIView.js +11 -0
  53. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  54. package/package.json +1 -1
@@ -281,16 +281,12 @@ JSClass('UIScrollView', UIView, {
281
281
  offset = JSPoint(offset);
282
282
  offset.x = Math.round(offset.x);
283
283
  offset.y = Math.round(offset.y);
284
- if (!this.scrollsHorizontally){
285
- offset.x = this._contentOffset.x;
286
- }else if (offset.x < this._minContentOffset.x){
284
+ if (offset.x < this._minContentOffset.x){
287
285
  offset.x = this._minContentOffset.x;
288
286
  }else if (offset.x > this._maxContentOffset.x){
289
287
  offset.x = this._maxContentOffset.x;
290
288
  }
291
- if (!this.scrollsVertically){
292
- offset.y = this._contentOffset.y;
293
- }else if (offset.y < this._minContentOffset.y){
289
+ if (offset.y < this._minContentOffset.y){
294
290
  offset.y = this._minContentOffset.y;
295
291
  }else if (offset.y > this._maxContentOffset.y){
296
292
  offset.y = this._maxContentOffset.y;
@@ -515,6 +511,12 @@ JSClass('UIScrollView', UIView, {
515
511
  }else{
516
512
  var d = JSPoint(event.scrollingDelta);
517
513
  var abs = JSPoint(Math.abs(d.x), Math.abs(d.y));
514
+ if (!this._scrollsVertically){
515
+ d.y = 0;
516
+ }
517
+ if (!this._scrollsHorizontally){
518
+ d.x = 0;
519
+ }
518
520
  if (abs.x > 2 * abs.y){
519
521
  d.y = 0;
520
522
  }else if (abs.y > 2 * abs.x){
@@ -581,10 +583,16 @@ JSClass('UIScrollView', UIView, {
581
583
  },
582
584
 
583
585
  touchesBegan: function(touches, event){
586
+ if (!this._scrollsVertically && !this._scrollsHorizontally){
587
+ return UIScrollView.$super.touchesBegan.call(this, touches, event);
588
+ }
584
589
  this._beginTrackingTouches(touches, event);
585
590
  },
586
591
 
587
592
  touchesMoved: function(touches, event){
593
+ if (!this._scrollsVertically && !this._scrollsHorizontally){
594
+ return UIScrollView.$super.touchesMoved.call(this, touches, event);
595
+ }
588
596
  if (this._touchTracking === null){
589
597
  this._beginTrackingTouches(touches, event);
590
598
  }
@@ -594,6 +602,12 @@ JSClass('UIScrollView', UIView, {
594
602
  }
595
603
  var location = touch.locationInView(this);
596
604
  var delta = location.subtracting(this._touchTracking.startingLocation);
605
+ if (!this._scrollsVertically){
606
+ delta.y = 0;
607
+ }
608
+ if (!this._scrollsHorizontally){
609
+ delta.x = 0;
610
+ }
597
611
  var offset = this._touchTracking.contentOffset.subtracting(delta);
598
612
  delta = location.subtracting(this._touchTracking.location);
599
613
  var dt = event.timestamp - this._touchTracking.timestamp;
@@ -606,6 +620,9 @@ JSClass('UIScrollView', UIView, {
606
620
  },
607
621
 
608
622
  touchesEnded: function(touches, event){
623
+ if (!this._scrollsVertically && !this._scrollsHorizontally){
624
+ return UIScrollView.$super.touchesEnded.call(this, touches, event);
625
+ }
609
626
  var dt = event.timestamp - this._touchTracking.timestamp;
610
627
  if (dt < 0.05){
611
628
  this._beginCoasting(this._touchTracking.velocity);
@@ -614,6 +631,9 @@ JSClass('UIScrollView', UIView, {
614
631
  },
615
632
 
616
633
  touchesCanceled: function(touches, event){
634
+ if (!this._scrollsVertically && !this._scrollsHorizontally){
635
+ return UIScrollView.$super.touchesCanceled.call(this, touches, event);
636
+ }
617
637
  this._endTrackingTouches();
618
638
  },
619
639
 
@@ -170,16 +170,18 @@ JSClass("UIState", JSObject, {
170
170
  return this._path === other._path;
171
171
  },
172
172
 
173
- beginsWithState: function(state){
173
+ startsWithState: function(state){
174
174
  if (state === null || state === undefined){
175
175
  return false;
176
176
  }
177
- if (this._pathComponents.length < state._pathComponents.length){
177
+ var a = this.pathComponents;
178
+ var b = state.pathComponents;
179
+ if (a.length < b.length){
178
180
  return false;
179
181
  }
180
182
  var i, l;
181
- for (i = 0, l = state._pathComponents.length; i < l; ++i){
182
- if (this._pathComponents[i] != state._pathComponents[i]){
183
+ for (i = 0, l = b.length; i < l; ++i){
184
+ if (a[i] != b[i]){
183
185
  return false;
184
186
  }
185
187
  }
@@ -713,7 +713,14 @@ JSClass("UITextField", UIControl, {
713
713
  size = JSSize(this._placeholderLabel.bounds.size);
714
714
  }else{
715
715
  if (this._multiline){
716
- this._textLayer.sizeToFitSize(maxSize);
716
+ var maxTextSize = JSSize(maxSize);
717
+ if (maxTextSize.width < Number.MAX_VALUE){
718
+ maxTextSize.width -= this._textInsets.width;
719
+ }
720
+ if (maxTextSize.height < Number.MAX_VALUE){
721
+ maxTextSize.height -= this._textInsets.height;
722
+ }
723
+ this._textLayer.sizeToFitSize(maxTextSize);
717
724
  }
718
725
  this._textLayer.layoutIfNeeded();
719
726
  size = JSSize(this._textLayer.bounds.size);
@@ -323,6 +323,17 @@ JSClass('UIView', UIResponder, {
323
323
  return null;
324
324
  },
325
325
 
326
+ isDescendantOfView: function(view){
327
+ if (view === null || view === undefined){
328
+ return false;
329
+ }
330
+ var superview = this.superview;
331
+ while (superview !== null && superview !== view){
332
+ superview = superview.superview;
333
+ }
334
+ return superview !== null && superview === view;
335
+ },
336
+
326
337
  // -------------------------------------------------------------------------
327
338
  // MARK: - Window
328
339
 
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2022.26.0
3
+ JSBundleVersion: 2022.29.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2022.26.0",
12
+ "version": "2022.29.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"