@breakside/jskit 2021.42.0 → 2021.46.1

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 (86) 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/Deflate.js +2 -3
  7. package/Frameworks/Foundation.jsframework/JS/Error+JS.js +10 -0
  8. package/Frameworks/Foundation.jsframework/JS/JSClass.js +8 -5
  9. package/Frameworks/Foundation.jsframework/JS/JSColor.js +15 -0
  10. package/Frameworks/Foundation.jsframework/JS/JSDate.js +6 -0
  11. package/Frameworks/Foundation.jsframework/JS/JSDateFormatter.js +2 -2
  12. package/Frameworks/Foundation.jsframework/JS/JSImage.js +1 -0
  13. package/Frameworks/Foundation.jsframework/JS/JSTimeZone.js +6 -2
  14. package/Frameworks/Foundation.jsframework/JS/JSURLResponse.js +60 -1
  15. package/Frameworks/Foundation.jsframework/JS/Zlib.js +2 -3
  16. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  17. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  18. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  19. package/Info.json +2 -2
  20. package/Node/HTMLBuilder.js +2 -1
  21. package/Node/JavascriptCompilation.js +1 -1
  22. package/Node/io.breakside.jskit-bundle.js +2 -2
  23. package/Root/Frameworks/APIKit/APIError.js +2 -3
  24. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  25. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  26. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  27. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  28. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  29. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  30. package/Root/Frameworks/DBKit/DBObjectDatabase.js +6 -5
  31. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  32. package/Root/Frameworks/DOM/Info.yaml +1 -1
  33. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  34. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  35. package/Root/Frameworks/Foundation/Deflate.js +2 -3
  36. package/Root/Frameworks/Foundation/Error+JS.js +10 -0
  37. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  38. package/Root/Frameworks/Foundation/JSClass.js +8 -5
  39. package/Root/Frameworks/Foundation/JSColor.js +15 -0
  40. package/Root/Frameworks/Foundation/JSDate.js +6 -0
  41. package/Root/Frameworks/Foundation/JSDateFormatter.js +2 -2
  42. package/Root/Frameworks/Foundation/JSImage.js +1 -0
  43. package/Root/Frameworks/Foundation/JSTimeZone.js +6 -2
  44. package/Root/Frameworks/Foundation/JSURLResponse.js +60 -1
  45. package/Root/Frameworks/Foundation/Zlib.js +2 -3
  46. package/Root/Frameworks/ImageKit/IKDecoderPNG.js +1 -3
  47. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  48. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  49. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  50. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  51. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  52. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  53. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  54. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  55. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  56. package/Root/Frameworks/ServerKit/SKFileJobQueue.js +3 -1
  57. package/Root/Frameworks/ServerKit/SKHTTPError.js +2 -3
  58. package/Root/Frameworks/ServerKit/SKHTTPRequest.js +7 -0
  59. package/Root/Frameworks/ServerKit/SKHTTPResponder.js +9 -2
  60. package/Root/Frameworks/ServerKit/SKUserAgent.js +130 -0
  61. package/Root/Frameworks/ServerKit/SKValidatingObject.js +1 -3
  62. package/Root/Frameworks/ServerKit/ServerKit.js +1 -0
  63. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  64. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  65. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  66. package/Root/Frameworks/UIKit/UIAnimation.js +4 -0
  67. package/Root/Frameworks/UIKit/UIContainerView.js +1 -1
  68. package/Root/Frameworks/UIKit/UIContainerViewController.js +3 -35
  69. package/Root/Frameworks/UIKit/UIHTMLDisplayServerCanvasContext.js +6 -1
  70. package/Root/Frameworks/UIKit/UIImageLayer.js +12 -14
  71. package/Root/Frameworks/UIKit/UILayer.js +20 -0
  72. package/Root/Frameworks/UIKit/UIListView.js +52 -12
  73. package/Root/Frameworks/UIKit/UIListViewHeaderFooterView.js +34 -0
  74. package/Root/Frameworks/UIKit/UINavigationBar.js +4 -2
  75. package/Root/Frameworks/UIKit/UINavigationBarItem.js +11 -0
  76. package/Root/Frameworks/UIKit/UINavigationController.js +2 -2
  77. package/Root/Frameworks/UIKit/UISplitViewController.js +9 -87
  78. package/Root/Frameworks/UIKit/UITabView.js +2 -2
  79. package/Root/Frameworks/UIKit/UITabViewController.js +6 -5
  80. package/Root/Frameworks/UIKit/UITextLayer.js +11 -10
  81. package/Root/Frameworks/UIKit/UIView.js +16 -0
  82. package/Root/Frameworks/UIKit/UIViewController.js +36 -0
  83. package/Root/Frameworks/UIKit/UIWindow.js +37 -3
  84. package/Root/Frameworks/UIKit/UIWindowServer.js +2 -2
  85. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  86. package/package.json +1 -1
@@ -211,10 +211,16 @@ JSClass('UIView', UIResponder, {
211
211
  subviews: null,
212
212
 
213
213
  addSubview: function(subview){
214
+ if (!(subview instanceof UIView)){
215
+ throw new TypeError("addSubview() given view is not a UIView");
216
+ }
214
217
  return this._insertSubviewAtIndex(subview, this.subviews.length, this.layer.sublayers.length);
215
218
  },
216
219
 
217
220
  insertSubviewAtIndex: function(subview, index){
221
+ if (!(subview instanceof UIView)){
222
+ throw new TypeError("insertSubviewAtIndex() given view is not a UIView");
223
+ }
218
224
  var layerIndex;
219
225
  if (index < this.subviews.length){
220
226
  layerIndex = this.subviews[index].layer.sublayerIndex;
@@ -225,6 +231,9 @@ JSClass('UIView', UIResponder, {
225
231
  },
226
232
 
227
233
  insertSubviewBelowSibling: function(subview, sibling){
234
+ if (!(subview instanceof UIView)){
235
+ throw new TypeError("insertSubviewBelowSibling() given view is not a UIView");
236
+ }
228
237
  if (sibling.superview !== this){
229
238
  throw Error('Cannot insert subview [%s] in view [%s] because sibling view [%s] is not a valid subview.');
230
239
  }
@@ -232,6 +241,9 @@ JSClass('UIView', UIResponder, {
232
241
  },
233
242
 
234
243
  insertSubviewAboveSibling: function(subview, sibling){
244
+ if (!(subview instanceof UIView)){
245
+ throw new TypeError("insertSubviewAboveSibling() given view is not a UIView");
246
+ }
235
247
  if (sibling.superview !== this){
236
248
  throw Error('Cannot insert subview [%s] in view [%s] because sibling view [%s] is not a valid subview.');
237
249
  }
@@ -239,6 +251,9 @@ JSClass('UIView', UIResponder, {
239
251
  },
240
252
 
241
253
  removeSubview: function(subview){
254
+ if (!(subview instanceof UIView)){
255
+ throw new TypeError("removeSubview() given subview is not a UIView");
256
+ }
242
257
  if (subview.superview === this){
243
258
  this.layer.removeSublayer(subview.layer);
244
259
  for (var i = subview.subviewIndex + 1, l = this.subviews.length; i < l; ++i){
@@ -464,6 +479,7 @@ JSClass('UIView', UIResponder, {
464
479
  // MARK: - Layout
465
480
 
466
481
  frame: UIViewLayerProperty(),
482
+ untransformedFrame: UIViewLayerProperty(),
467
483
  bounds: UIViewLayerProperty(),
468
484
  position: UIViewLayerProperty(),
469
485
  anchorPoint: UIViewLayerProperty(),
@@ -192,6 +192,42 @@ JSClass("UIViewController", UIResponder, {
192
192
  didMoveToParentViewController: function(parentViewController){
193
193
  },
194
194
 
195
+ replaceChildViewController: function(previousChildViewController, childViewController, animator){
196
+ if (this.isViewLoaded && this.isViewVisible){
197
+ var animated = animator !== undefined && animator !== null;
198
+ if (previousChildViewController !== null){
199
+ previousChildViewController.viewWillDisappear(animated);
200
+ previousChildViewController.removeFromParentViewController();
201
+ }
202
+ if (childViewController !== null){
203
+ // trigger childViewController.viewDidLoad by accessing .view
204
+ var view = childViewController.view;
205
+ this.addChildViewController(childViewController);
206
+ childViewController.viewWillAppear(animated);
207
+ }
208
+ var completion = function(){
209
+ if (previousChildViewController !== null){
210
+ previousChildViewController.viewDidDisappear(animated);
211
+ }
212
+ if (childViewController !== null){
213
+ childViewController.viewDidAppear(animated);
214
+ }
215
+ };
216
+ if (animated){
217
+ animator.addCompletion(completion, this);
218
+ }else{
219
+ this.view.layer._displayServer.schedule(completion, this);
220
+ }
221
+ }else{
222
+ if (previousChildViewController !== null){
223
+ previousChildViewController.removeFromParentViewController();
224
+ }
225
+ if (childViewController !== null){
226
+ this.addChildViewController(childViewController);
227
+ }
228
+ }
229
+ },
230
+
195
231
  // -------------------------------------------------------------------------
196
232
  // MARK: - Responder
197
233
 
@@ -1431,7 +1431,7 @@ JSClass("UIWindowTitlelessStyler", UIWindowStyler, {
1431
1431
  closeButtonImages: null,
1432
1432
 
1433
1433
  init: function(){
1434
- UIWindowDefaultStyler.$super.init.call(this);
1434
+ UIWindowTitlelessStyler.$super.init.call(this);
1435
1435
  this.shadowColor = JSColor.windowShadow;
1436
1436
  this.backgroundColor = JSColor.window;
1437
1437
  this.closeButtonImages = {
@@ -1443,8 +1443,42 @@ JSClass("UIWindowTitlelessStyler", UIWindowStyler, {
1443
1443
  this.toolbarTitleColor = JSColor.toolbarTitle;
1444
1444
  },
1445
1445
 
1446
+ initWithSpec: function(spec){
1447
+ UIWindowTitlelessStyler.$super.initWithSpec.call(this, spec);
1448
+ if (spec.containsKey("backgroundColor")){
1449
+ this.backgroundColor = spec.valueForKey("backgroundColor", JSColor);
1450
+ }else{
1451
+ this.backgroundColor = JSColor.window;
1452
+ }
1453
+ if (spec.containsKey("shadowColor")){
1454
+ this.shadowColor = spec.valueForKey("shadowColor", JSColor);
1455
+ }else{
1456
+ this.shadowColor = JSColor.windowShadow;
1457
+ }
1458
+ if (spec.containsKey("shadowRadius")){
1459
+ this.shadowRadius = spec.valueForKey("shadowRadius");
1460
+ }
1461
+ if (spec.containsKey("inactiveShadowRadius")){
1462
+ this.inactiveShadowRadius = spec.valueForKey("inactiveShadowRadius");
1463
+ }
1464
+ if (spec.containsKey("cornerRadius")){
1465
+ this.cornerRadius = spec.valueForKey("cornerRadius");
1466
+ }
1467
+ if (spec.containsKey("toolbarTitleColor")){
1468
+ this.toolbarTitleColor = spec.valueForKey("toolbarTitleColor", JSColor);
1469
+ }else{
1470
+ this.toolbarTitleColor = JSColor.toolbarTitle;
1471
+ }
1472
+ this.closeButtonImages = {
1473
+ inactive: images.closeInactive,
1474
+ normal: images.closeNormal,
1475
+ over: images.closeOver,
1476
+ active: images.closeActive
1477
+ };
1478
+ },
1479
+
1446
1480
  initializeWindow: function(window){
1447
- UIWindowDefaultStyler.$super.initializeWindow.call(this, window);
1481
+ UIWindowTitlelessStyler.$super.initializeWindow.call(this, window);
1448
1482
  var closeButton = UIButton.initWithStyler(UIButton.Styler.custom);
1449
1483
  closeButton.setImageForState(this.closeButtonImages.normal, UIControl.State.normal);
1450
1484
  closeButton.setImageForState(this.closeButtonImages.over, UIControl.State.over);
@@ -1468,7 +1502,7 @@ JSClass("UIWindowTitlelessStyler", UIWindowStyler, {
1468
1502
  },
1469
1503
 
1470
1504
  layoutWindow: function(window){
1471
- UIWindowDefaultStyler.$super.layoutWindow.call(this, window);
1505
+ UIWindowTitlelessStyler.$super.layoutWindow.call(this, window);
1472
1506
  var controlsView = window.stylerProperties.controlsView;
1473
1507
  var closeButton = window.stylerProperties.closeButton;
1474
1508
  var toolbar = window.stylerProperties.toolbar;
@@ -580,7 +580,7 @@ JSClass("UIWindowServer", JSObject, {
580
580
  }
581
581
 
582
582
  if (ignore){
583
- logger.warn("Ignoring mouse event: %d".sprintf(type));
583
+ logger.info("Ignoring mouse event: %d".sprintf(type));
584
584
  return;
585
585
  }
586
586
 
@@ -904,7 +904,7 @@ JSClass("UIWindowServer", JSObject, {
904
904
  // Create or update the active touch event
905
905
  if (this.activeTouchEvent === null){
906
906
  if (type != UIEvent.Type.touchesBegan){
907
- logger.warn("Ignoring touch event: %d", type);
907
+ logger.info("Ignoring touch event: %d", type);
908
908
  return;
909
909
  }
910
910
  this.activeTouchEvent = UIEvent.initTouchEventWithType(type, timestamp);
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2021.42.0
3
+ JSBundleVersion: 2021.46.1
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": "2021.42.0",
12
+ "version": "2021.46.1",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"