@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.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSFileManager+HTML.js +29 -19
- package/Frameworks/Foundation.jsframework/JS/JSUserDefaults.js +2 -2
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/OAService.js +8 -0
- package/Root/Frameworks/AuthKit/Services.yaml +2 -0
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSFileManager+HTML.js +29 -19
- package/Root/Frameworks/Foundation/JSUserDefaults.js +2 -2
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIApplication.js +33 -15
- package/Root/Frameworks/UIKit/UICheckbox.js +15 -8
- package/Root/Frameworks/UIKit/UICollectionView.js +2 -2
- package/Root/Frameworks/UIKit/UIDisplayServer.js +51 -10
- package/Root/Frameworks/UIKit/UIKit.js +1 -0
- package/Root/Frameworks/UIKit/UILayer.js +3 -0
- package/Root/Frameworks/UIKit/UIListView.js +10 -6
- package/Root/Frameworks/UIKit/UIMenuView.js +77 -18
- package/Root/Frameworks/UIKit/UINavigationBar.js +45 -22
- package/Root/Frameworks/UIKit/UIScrollView.js +26 -6
- package/Root/Frameworks/UIKit/UIState.js +6 -4
- package/Root/Frameworks/UIKit/UITextField.js +8 -1
- package/Root/Frameworks/UIKit/UIView.js +11 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- 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 (
|
|
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 (
|
|
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
|
-
|
|
173
|
+
startsWithState: function(state){
|
|
174
174
|
if (state === null || state === undefined){
|
|
175
175
|
return false;
|
|
176
176
|
}
|
|
177
|
-
|
|
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 =
|
|
182
|
-
if (
|
|
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
|
-
|
|
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
|
|