@breakside/jskit 2022.9.0 → 2022.22.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 (71) 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/JS/FNTFontDescriptor.js +9 -6
  5. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  6. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  7. package/Frameworks/Foundation.jsframework/JS/JSEnvironment.js +5 -0
  8. package/Frameworks/Foundation.jsframework/JS/JSHTMLHTTPClient.js +9 -1
  9. package/Frameworks/Foundation.jsframework/JS/JSImage.js +11 -4
  10. package/Frameworks/Foundation.jsframework/JS/JSSynchronizer.js +1 -0
  11. package/Frameworks/Foundation.jsframework/JS/JSURLResponse.js +10 -0
  12. package/Frameworks/Foundation.jsframework/JS/JSUserDefaults.js +14 -1
  13. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  14. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  15. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  16. package/Info.json +2 -2
  17. package/Node/io.breakside.jskit-bundle.js +2 -2
  18. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  19. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  20. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  21. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  22. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  23. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  24. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  25. package/Root/Frameworks/DOM/Info.yaml +1 -1
  26. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  27. package/Root/Frameworks/FontKit/FNTFontDescriptor.js +9 -6
  28. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  29. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  30. package/Root/Frameworks/Foundation/JSEnvironment.js +5 -0
  31. package/Root/Frameworks/Foundation/JSHTMLHTTPClient.js +9 -1
  32. package/Root/Frameworks/Foundation/JSImage.js +11 -4
  33. package/Root/Frameworks/Foundation/JSSynchronizer.js +1 -0
  34. package/Root/Frameworks/Foundation/JSURLResponse.js +10 -0
  35. package/Root/Frameworks/Foundation/JSUserDefaults.js +14 -1
  36. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  37. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  38. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  39. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  40. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  41. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  42. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  43. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  44. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  45. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  46. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  47. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  48. package/Root/Frameworks/UIKit/UIApplication.js +15 -1
  49. package/Root/Frameworks/UIKit/UICollectionReusableView.js +1 -1
  50. package/Root/Frameworks/UIKit/UICollectionView.js +99 -13
  51. package/Root/Frameworks/UIKit/UICollectionViewCell.js +11 -1
  52. package/Root/Frameworks/UIKit/UICollectionViewLayout.js +1 -1
  53. package/Root/Frameworks/UIKit/UIColorPanel.js +4 -1
  54. package/Root/Frameworks/UIKit/UIDraggingSession.js +7 -0
  55. package/Root/Frameworks/UIKit/UIHTMLTextField.js +3 -1
  56. package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +13 -1
  57. package/Root/Frameworks/UIKit/UIMenu.js +12 -5
  58. package/Root/Frameworks/UIKit/UIMenuItem.js +6 -0
  59. package/Root/Frameworks/UIKit/UIMenuView.js +12 -1
  60. package/Root/Frameworks/UIKit/UIPressGestureRecognizer.js +13 -2
  61. package/Root/Frameworks/UIKit/UIScrollView.js +15 -12
  62. package/Root/Frameworks/UIKit/UISegmentedControl.js +15 -0
  63. package/Root/Frameworks/UIKit/UISlider.js +9 -0
  64. package/Root/Frameworks/UIKit/UIStackView.js +16 -0
  65. package/Root/Frameworks/UIKit/UITabView.js +5 -6
  66. package/Root/Frameworks/UIKit/UITextField.js +2 -0
  67. package/Root/Frameworks/UIKit/UIView.js +1 -1
  68. package/Root/Frameworks/UIKit/UIWindow.js +32 -1
  69. package/Root/Frameworks/UIKit/UIWindowServer.js +3 -0
  70. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  71. package/package.json +1 -1
@@ -29,6 +29,7 @@ JSClass("UISlider", UIControl, {
29
29
  minimumValue: JSDynamicProperty("_minimumValue", 0),
30
30
  maximumValue: JSDynamicProperty("_maximumValue", 1),
31
31
  value: JSDynamicProperty("_value", 0),
32
+ integerValue: JSDynamicProperty(),
32
33
 
33
34
  setMinimumValue: function(minimumValue){
34
35
  this._minimumValue = minimumValue;
@@ -53,6 +54,14 @@ JSClass("UISlider", UIControl, {
53
54
  this.setNeedsLayout();
54
55
  },
55
56
 
57
+ getIntegerValue: function(){
58
+ return Math.round(this._value);
59
+ },
60
+
61
+ setIntegerValue: function(value){
62
+ this.value = value;
63
+ },
64
+
56
65
  minimumPoint: JSReadOnlyProperty(),
57
66
  maximumPoint: JSReadOnlyProperty(),
58
67
 
@@ -215,6 +215,22 @@ JSClass("UIStackView", UIView, {
215
215
 
216
216
  subviewsDidChange: function(){
217
217
  this.setNeedsLayout();
218
+ },
219
+
220
+ getFirstBaselineOffsetFromTop: function(){
221
+ var top = this._contentInsets.top;
222
+ if (this._arrangedSubviews.length > 0){
223
+ top += this._arrangedSubviews[0].firstBaselineOffsetFromTop;
224
+ }
225
+ return top;
226
+ },
227
+
228
+ getLastBaselineOffsetFromBottom: function(){
229
+ var bottom = this._contentInsets.bottom;
230
+ if (this._arrangedSubviews.length > 0){
231
+ bottom += this._arrangedSubviews[this._arrangedSubviews.length - 1].lastBaselineOffsetFromBottom;
232
+ }
233
+ return bottom;
218
234
  }
219
235
 
220
236
  });
@@ -59,16 +59,14 @@ JSClass("UITabView", UIView, {
59
59
  if (spec.containsKey('delegate')){
60
60
  this.delegate = spec.valueForKey("delegate");
61
61
  }
62
+ if (spec.containsKey("font")){
63
+ this.font = spec.valueForKey("font", JSFont);
64
+ }
62
65
  if (spec.containsKey('items')){
63
- var items = [];
64
66
  var specItems = spec.valueForKey('items');
65
67
  for (var i = 0, l = specItems.length; i < l; ++i){
66
- items.push(specItems.valueForKey(i, UITabViewItem));
68
+ this.insertItemAtIndex(specItems.valueForKey(i, UITabViewItem), i);
67
69
  }
68
- this.items = items;
69
- }
70
- if (spec.containsKey("font")){
71
- this.font = spec.valueForKey("font", JSFont);
72
70
  }
73
71
  },
74
72
 
@@ -1067,6 +1065,7 @@ JSClass("UITabViewTablessStyler", UITabViewStyler, {
1067
1065
  showContentViewInTabView: function(contentView, tabView){
1068
1066
  tabView.addSubview(contentView);
1069
1067
  tabView.stylerProperties.contentView = contentView;
1068
+ this.layoutTabView(tabView);
1070
1069
  },
1071
1070
 
1072
1071
  removeContentViewFromTabView: function(contentView, tabView){
@@ -159,6 +159,7 @@ JSClass("UITextField", UIControl, {
159
159
  }else{
160
160
  this._textLayer.text = text;
161
161
  }
162
+ this.setNeedsLayout();
162
163
  this._updateIsEmpty(!this._textLayer.hasText());
163
164
  },
164
165
 
@@ -172,6 +173,7 @@ JSClass("UITextField", UIControl, {
172
173
  return;
173
174
  }
174
175
  this._textLayer.attributedText = attributedText;
176
+ this.setNeedsLayout();
175
177
  this._updateIsEmpty(!this._textLayer.hasText());
176
178
  },
177
179
 
@@ -517,7 +517,7 @@ JSClass('UIView', UIResponder, {
517
517
  },
518
518
 
519
519
  sizeToFit: function(){
520
- this.layer.sizeToFit();
520
+ this.sizeToFitSize(JSSize(Number.MAX_VALUE, Number.MAX_VALUE));
521
521
  },
522
522
 
523
523
  sizeToFitSize: function(maxSize){
@@ -896,7 +896,17 @@ JSClass('UIWindow', UIView, {
896
896
  },
897
897
 
898
898
  _sendTouchEvent: function(event){
899
- if (this._modal !== null){
899
+ var modal = this._modal;
900
+ while (modal !== null && modal._modal !== null){
901
+ modal = modal._modal;
902
+ }
903
+ if (modal !== null){
904
+ if (event.type == UIEvent.Type.touchesBegan){
905
+ if (modal._isOpen){
906
+ modal.makeKeyAndOrderFront();
907
+ modal.indicateModalStatus();
908
+ }
909
+ }
900
910
  return;
901
911
  }
902
912
  var i, l;
@@ -1148,7 +1158,18 @@ JSClass("UIWindowStyler", JSObject, {
1148
1158
  window.layer.addSublayer(window.stylerProperties.focusRingLayer);
1149
1159
  },
1150
1160
 
1161
+ _isUpdatingFocusRing: false,
1162
+
1151
1163
  updateFocusRingInWindow: function(window, animated){
1164
+ if (this._isUpdatingFocusRing){
1165
+ return;
1166
+ }
1167
+ this._isUpdatingFocusRing = true;
1168
+ this._updateFocusRingInWindow(window, animated);
1169
+ this._isUpdatingFocusRing = false;
1170
+ },
1171
+
1172
+ _updateFocusRingInWindow: function(window, animated){
1152
1173
  var responder = window.firstResponder;
1153
1174
  var focusRingLayer = window.stylerProperties.focusRingLayer;
1154
1175
  if (!window.isKeyWindow || responder === null || !responder.isKindOfClass(UIView)){
@@ -1156,6 +1177,16 @@ JSClass("UIWindowStyler", JSObject, {
1156
1177
  return;
1157
1178
  }
1158
1179
  var view = responder;
1180
+ var views = [];
1181
+ while (view !== window){
1182
+ views.push(view);
1183
+ view = view.superview;
1184
+ }
1185
+ view = responder;
1186
+ var i;
1187
+ for (i = views.length - 1; i >= 0; --i){
1188
+ views[i].layoutIfNeeded();
1189
+ }
1159
1190
  var path = view.focusRingPath;
1160
1191
  if (path === null){
1161
1192
  focusRingLayer.hidden = true;
@@ -747,6 +747,9 @@ JSClass("UIWindowServer", JSObject, {
747
747
  return false;
748
748
  }
749
749
  var window = view.window;
750
+ if (window === null){
751
+ return false;
752
+ }
750
753
  if (window.shouldReceiveTrackingInBack){
751
754
  return true;
752
755
  }
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2022.9.0
3
+ JSBundleVersion: 2022.22.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.9.0",
12
+ "version": "2022.22.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"