@breakside/jskit 2023.13.0 → 2023.14.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 (51) 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/io.breakside.JSKit.Foundation-bundle.js +2 -2
  7. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  8. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  9. package/Info.json +2 -2
  10. package/Node/io.breakside.jskit-bundle.js +2 -2
  11. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  12. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  13. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  14. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  15. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  16. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  17. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  18. package/Root/Frameworks/DOM/Info.yaml +1 -1
  19. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  20. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  21. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  22. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  23. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  24. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  25. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  26. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  27. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  28. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  29. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  30. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  31. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  32. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  33. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  34. package/Root/Frameworks/UIKit/UICollectionView.js +1 -0
  35. package/Root/Frameworks/UIKit/UIHTMLContentEditableTextInputManager.js +164 -151
  36. package/Root/Frameworks/UIKit/UIHTMLTextField.js +2 -1
  37. package/Root/Frameworks/UIKit/UIHTMLTextLine.js +45 -25
  38. package/Root/Frameworks/UIKit/UIHTMLTextRun.js +7 -2
  39. package/Root/Frameworks/UIKit/UIHTMLTextTypesetter.js +9 -3
  40. package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +1 -0
  41. package/Root/Frameworks/UIKit/UIListView.js +1 -0
  42. package/Root/Frameworks/UIKit/UITextEditor.js +31 -8
  43. package/Root/Frameworks/UIKit/UITextField.js +1 -0
  44. package/Root/Frameworks/UIKit/UITokenField.js +1 -1
  45. package/Root/Frameworks/UIKit/UIToolbar.js +17 -9
  46. package/Root/Frameworks/UIKit/UIWindow.js +21 -7
  47. package/Root/Frameworks/UIKit/UIWindowServer.js +1 -1
  48. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  49. package/Root/Templates/html/${PROJECT_NAME}/conf/debug/nginx.conf +2 -0
  50. package/Root/Templates/html/${PROJECT_NAME}/conf/release/nginx.conf +2 -0
  51. package/package.json +1 -1
@@ -600,6 +600,7 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
600
600
  touchend: function(e){
601
601
  e.preventDefault();
602
602
  this._createTouchEventFromDOMEvent(e, UIEvent.Type.touchesEnded);
603
+ this.textInputManager._ensureCorrectFocus();
603
604
  },
604
605
 
605
606
  touchcancel: function(e){
@@ -1717,6 +1717,7 @@ JSClass("UIListView", UIScrollView, {
1717
1717
 
1718
1718
  windowDidChangeKeyStatus: function(){
1719
1719
  this._updateVisibleCellStyles();
1720
+ UIListView.$super.windowDidChangeKeyStatus.call(this);
1720
1721
  },
1721
1722
 
1722
1723
  keyDown: function(event){
@@ -436,6 +436,28 @@ JSClass("UITextEditor", JSObject, {
436
436
  this._toggleBooleanAttribute("underline", "Underline");
437
437
  },
438
438
 
439
+ strike: function(sender){
440
+ this._toggleBooleanAttribute("strike", "Strike");
441
+ },
442
+
443
+ setAttribute: function(name, value, undoName){
444
+ this.undoManager.beginUndoGrouping();
445
+ var i, l;
446
+ var selection;
447
+ var selections = this._selectionsCopy();
448
+ for (i = 0, l = selections.length; i < l; ++i){
449
+ selection = selections[i];
450
+ this._setAttributeValueForSelection(name, value, selection);
451
+ }
452
+ this._setSelectionsAllowingUndo(selections);
453
+ this.undoManager.endUndoGrouping();
454
+ this.undoManager.setActionName(undoName);
455
+ },
456
+
457
+ removeAttribute: function(name, undoName){
458
+ this.setAttribute(name, undefined, undoName);
459
+ },
460
+
439
461
  removeParagraphAttribute: function(name, undoName){
440
462
  this.setParagraphAttribute(name, undefined, undoName);
441
463
  },
@@ -535,7 +557,7 @@ JSClass("UITextEditor", JSObject, {
535
557
  var selections = this._selectionsCopy();
536
558
  for (i = 0, l = selections.length; i < l; ++i){
537
559
  selection = selections[i];
538
- this._setBooleanAttributeForSelection(name, !currentValue, selection);
560
+ this._setAttributeValueForSelection(name, !currentValue, selection);
539
561
  }
540
562
  this._setSelectionsAllowingUndo(selections);
541
563
  this.undoManager.endUndoGrouping();
@@ -543,25 +565,26 @@ JSClass("UITextEditor", JSObject, {
543
565
  this._resetSelectionAffinity();
544
566
  },
545
567
 
546
- _setBooleanAttributeForSelection: function(name, value, selection){
568
+ _setAttributeValueForSelection: function(name, value, selection){
547
569
  var textStorage = this.textLayoutManager.textStorage;
548
570
  var replacementString;
549
571
  if (selection.range.length > 0){
550
572
  replacementString = textStorage.attributedSubstringInRange(selection.range);
551
- if (value){
552
- replacementString.addAttributeInRange(name, true, JSRange(0, replacementString.string.length));
573
+ if (value !== null && value !== undefined){
574
+ replacementString.addAttributeInRange(name, value, JSRange(0, replacementString.string.length));
553
575
  }else{
554
576
  replacementString.removeAttributeInRange(name, JSRange(0, replacementString.string.length));
555
577
  }
556
578
  this._replaceTextStorageRangeAllowingUndo(textStorage, selection.range, replacementString);
557
579
  }else{
558
580
  selection.attributes = this._insertAttributesForSelection(selection);
559
- if (value){
560
- selection.attributes[name] = true;
581
+ var currentValue = selection.attributes[name];
582
+ if (value !== null && value !== undefined){
583
+ selection.attributes[name] = value;
561
584
  }else{
562
585
  delete selection.attributes[name];
563
586
  }
564
- this.undoManager.registerUndo(this, this._setBooleanAttributeForSelection, name, !value, selection);
587
+ this.undoManager.registerUndo(this, this._setAttributeValueForSelection, name, currentValue, selection);
565
588
  }
566
589
  },
567
590
 
@@ -723,7 +746,7 @@ JSClass("UITextEditor", JSObject, {
723
746
  }
724
747
  var index = selection.range.location;
725
748
  var iterator;
726
- if (index > 0){
749
+ if (selection.range.length === 0 && index > 0){
727
750
  iterator = this.textLayoutManager.textStorage.string.userPerceivedCharacterIterator(index);
728
751
  iterator.decrement();
729
752
  if (!iterator.isParagraphBreak){
@@ -896,6 +896,7 @@ JSClass("UITextField", UIControl, {
896
896
 
897
897
  windowDidChangeKeyStatus: function(){
898
898
  this._localEditor.windowDidChangeKeyStatus(this.window);
899
+ UITextField.$super.windowDidChangeKeyStatus.call(this);
899
900
  },
900
901
 
901
902
  _isHandlingMouseDown: false,
@@ -201,7 +201,7 @@ JSClass("UITokenFieldTokenView", UIView, {
201
201
  this.tokenLabel.cornerRadius = 3.0;
202
202
  this.addSubview(this.tokenLabel);
203
203
  this._tokenInsets = JSInsets(0, 1.5);
204
- this.tokenLabel.cursor = UICursor.arrow;
204
+ this.tokenLabel.cursor = UICursor.systemDefault;
205
205
  this.setNeedsLayout();
206
206
  },
207
207
 
@@ -78,7 +78,7 @@ JSClass("UIToolbar", UIView, {
78
78
 
79
79
  setItems: function(items){
80
80
  var i, l;
81
- for (i = this._items.length; i >= 0; --i){
81
+ for (i = this._items.length - 1; i >= 0; --i){
82
82
  this.removeItemAtIndex(i);
83
83
  }
84
84
  for (i = 0, l = items.length; i < l; ++i){
@@ -218,7 +218,7 @@ JSClass("UIToolbarItemView", UIView, {
218
218
  }else{
219
219
  switch (item.identifier){
220
220
  case UIToolbarItem.Identifier.space:
221
- this.contentView = UIToolbarItemSpaceView.initWithWidth(item.minimumWidth ? item.minimumWidth.width : item.toolbar.imageSize);
221
+ this.contentView = UIToolbarItemSpaceView.initWithWidth(item.minimumSize !== null ? item.minimumSize.width : item.toolbar.imageSize);
222
222
  this._handlesEvents = false;
223
223
  break;
224
224
  case UIToolbarItem.Identifier.flexibleSpace:
@@ -267,10 +267,11 @@ JSClass("UIToolbarItemView", UIView, {
267
267
  }
268
268
  var width;
269
269
  var height;
270
- if (!isNaN(this._item.minimumWidth) && this._item.minimumWidth > 0){
271
- width = this._item.minimumWidth;
272
- }else if (this._item.view !== null){
270
+ if (this._item.view !== null){
273
271
  width = this._item.view.intrinsicSize.width;
272
+ if (width === UIView.noIntrinsicSize){
273
+ width = bounds.size.width;
274
+ }
274
275
  }else{
275
276
  width = this._item.image.size.width * toolbar._imageSize / this._item.image.size.height;
276
277
  }
@@ -292,10 +293,15 @@ JSClass("UIToolbarItemView", UIView, {
292
293
  var toolbar = this._item.toolbar;
293
294
  var width;
294
295
  if (this._item.identifier == UIToolbarItem.Identifier.custom){
295
- if (!isNaN(this._item.minimumWidth) && this._item.minimumWidth > 0){
296
- width = this._item.minimumWidth;
297
- }else if (this._item.view !== null){
296
+ if (this._item.view !== null){
298
297
  width = this._item.view.intrinsicSize.width;
298
+ if (width === UIView.noIntrinsicSize){
299
+ if (this._item.minimumSize !== null){
300
+ width = this._item.minimumSize.width;
301
+ }else{
302
+ width = toolbar._imageSize;
303
+ }
304
+ }
299
305
  }else{
300
306
  width = this._item.image.size.width * toolbar._imageSize / this._item.image.size.height;
301
307
  }
@@ -541,7 +547,7 @@ JSClass("UIToolbarCustomStyler", UIToolbarStyler, {
541
547
  itemView.index = i;
542
548
  itemView.item = item;
543
549
  }
544
- for (var j = l - 1; j >= i; --j){
550
+ for (var j = props.itemViews.length - 1; j >= i; --j){
545
551
  itemView = props.itemViews.pop();
546
552
  itemView.removeFromSuperview();
547
553
  }
@@ -656,6 +662,8 @@ JSClass("UIToolbarCustomStyler", UIToolbarStyler, {
656
662
  itemsWidth += size.width;
657
663
  if (item.identifier === UIToolbarItem.Identifier.flexibleSpace){
658
664
  flexibleItemSizes.push(size);
665
+ }else if (item.minimumSize !== null && item.maximumSize !== null && item.minimumSize.width < item.maximumSize.width){
666
+ flexibleItemSizes.push(size);
659
667
  }
660
668
  }
661
669
  itemsWidth += (props.itemViews.length - 1) * this.itemSpacing;
@@ -395,7 +395,7 @@ JSClass('UIWindow', UIView, {
395
395
 
396
396
  makeKeyAndOrderFront: function(){
397
397
  this.orderFront();
398
- this.windowServer.makeWindowKey(this);
398
+ this.makeKey();
399
399
  },
400
400
 
401
401
  receivesAllEvents: false,
@@ -795,6 +795,9 @@ JSClass('UIWindow', UIView, {
795
795
  if (this.mouseTrackingViews === null || this.mouseTrackingViews.length === 0){
796
796
  return;
797
797
  }
798
+ if (this._modal !== null){
799
+ return;
800
+ }
798
801
  var view;
799
802
  var area;
800
803
  var viewIndex, viewCount;
@@ -818,9 +821,7 @@ JSClass('UIWindow', UIView, {
818
821
  enters.push(area);
819
822
  }
820
823
  }
821
- if ((area.trackingType & UIMouseTrackingArea.TrackingType.move) !== 0){
822
- moves.push(area);
823
- }
824
+ moves.push(area);
824
825
  }else{
825
826
  if (area._entered){
826
827
  area._entered = false;
@@ -841,6 +842,12 @@ JSClass('UIWindow', UIView, {
841
842
  area = exits[areaIndex];
842
843
  area.mouseExited(event);
843
844
  }
845
+ for (areaIndex = 0, areaCount = moves.length; areaIndex < areaCount; ++areaIndex){
846
+ area = moves[areaIndex];
847
+ if (area.cursor !== null){
848
+ area.cursor.set();
849
+ }
850
+ }
844
851
  }
845
852
  if (enters.length > 0){
846
853
  event = UIEvent.initMouseEventWithType(UIEvent.Type.mouseEntered, timestamp, this, locationInWindow, modifiers, 0);
@@ -852,8 +859,10 @@ JSClass('UIWindow', UIView, {
852
859
  if (moves.length > 0){
853
860
  event = UIEvent.initMouseEventWithType(UIEvent.Type.mouseMoved, timestamp, this, locationInWindow, modifiers, 0);
854
861
  for (areaIndex = 0, areaCount = moves.length; areaIndex < areaCount; ++areaIndex){
855
- area = moves[areaIndex];
856
- area.mouseMoved(event);
862
+ if ((area.trackingType & UIMouseTrackingArea.TrackingType.move) !== 0){
863
+ area = moves[areaIndex];
864
+ area.mouseMoved(event);
865
+ }
857
866
  }
858
867
  }
859
868
  },
@@ -901,6 +910,9 @@ JSClass('UIWindow', UIView, {
901
910
  while (modal !== null && modal._modal !== null){
902
911
  modal = modal._modal;
903
912
  }
913
+ if (this.mouseEventView !== null && this.mouseEventView.window !== this){
914
+ this.mouseEventView = null;
915
+ }
904
916
  if (modal !== null){
905
917
  this.mouseEventView = null;
906
918
  if (event.type == UIEvent.Type.mouseEntered || event.type == UIEvent.Type.mouseExited || event.type == UIEvent.mouseMoved){
@@ -925,7 +937,9 @@ JSClass('UIWindow', UIView, {
925
937
  }
926
938
  switch (event.type){
927
939
  case UIEvent.Type.leftMouseDown:
928
- this.makeKeyAndOrderFront();
940
+ if (this._isOpen){
941
+ this.makeKeyAndOrderFront();
942
+ }
929
943
  eventTarget.mouseDown(event);
930
944
  this._validateToolbar();
931
945
  break;
@@ -726,7 +726,7 @@ JSClass("UIWindowServer", JSObject, {
726
726
  var event;
727
727
  for (windowIndex = this.windowStack.length - 1; windowIndex >= 0 && window === null; --windowIndex){
728
728
  location = this.windowStack[windowIndex].convertPointFromScreen(this.mouseLocation);
729
- if (this.windowStack[windowIndex].userInteractionEnabled && this.windowStack[windowIndex].containsPoint(location)){
729
+ if (this.windowStack[windowIndex].userInteractionEnabled && (this.windowStack[windowIndex].containsPoint(location) || this.windowStack[windowIndex].receivesAllEvents)){
730
730
  window = this.windowStack[windowIndex];
731
731
  }
732
732
  }
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2023.13.0
3
+ JSBundleVersion: 2023.14.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -36,6 +36,8 @@ http {
36
36
  gzip on;
37
37
  gzip_types text/css application/javascript application/json text/xml text/plain image/svg+xml text/cache-manifest application/x-font-ttf;
38
38
 
39
+ absolute_redirect off;
40
+
39
41
  server {
40
42
  listen *:{{HTTP_PORT}}{{SSL_LISTEN}};
41
43
  {{SSL_CERT}}
@@ -36,6 +36,8 @@ http {
36
36
  gzip on;
37
37
  gzip_types text/css application/javascript application/json text/xml text/plain image/svg+xml text/cache-manifest application/x-font-ttf;
38
38
 
39
+ absolute_redirect off;
40
+
39
41
  server {
40
42
  listen *:{{HTTP_PORT}};
41
43
  server_name "";
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2023.13.0",
12
+ "version": "2023.14.1",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"