@breakside/jskit 2023.12.2 → 2023.14.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 (52) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/JS/DOM+HTML.js +14 -11
  3. package/Frameworks/DOM.jsframework/JS/DOMDocument.js +11 -0
  4. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  5. package/Frameworks/DOM.jsframework/sources.json +3 -1
  6. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  7. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  8. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  9. package/Frameworks/Foundation.jsframework/JS/JSGradient.js +55 -0
  10. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  11. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  12. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  13. package/Info.json +2 -2
  14. package/Node/HTMLBuilder.js +45 -1
  15. package/Node/io.breakside.jskit-bundle.js +2 -2
  16. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  17. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  18. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  19. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  20. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  21. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  22. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  23. package/Root/Frameworks/DOM/DOM+HTML.js +14 -11
  24. package/Root/Frameworks/DOM/DOMDocument.js +11 -0
  25. package/Root/Frameworks/DOM/Info.yaml +1 -1
  26. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  27. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  28. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  29. package/Root/Frameworks/Foundation/JSGradient.js +55 -0
  30. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  31. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  32. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  33. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  34. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  35. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  36. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  37. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  38. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  39. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  40. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  41. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  42. package/Root/Frameworks/UIKit/UIHTMLContentEditableTextInputManager.js +164 -151
  43. package/Root/Frameworks/UIKit/UIHTMLTextLine.js +45 -25
  44. package/Root/Frameworks/UIKit/UIHTMLTextRun.js +7 -2
  45. package/Root/Frameworks/UIKit/UIHTMLTextTypesetter.js +9 -3
  46. package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +1 -0
  47. package/Root/Frameworks/UIKit/UIWindow.js +9 -1
  48. package/Root/Frameworks/UIKit/UIWindowServer.js +2 -2
  49. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  50. package/Root/Templates/html/${PROJECT_NAME}/conf/debug/nginx.conf +4 -0
  51. package/Root/Templates/html/${PROJECT_NAME}/conf/release/nginx.conf +4 -0
  52. package/package.json +1 -1
@@ -247,9 +247,14 @@ JSClass("UIHTMLTextRun", JSTextRun, {
247
247
 
248
248
  recalculateRange: function(offset){
249
249
  var diff = 0;
250
+ var length = 0;
250
251
  if (this.textNode){
251
- diff = this.textNode.nodeValue.length - this._range.length;
252
- this._range = JSRange(this._range.location + offset, this.textNode.nodeValue.length);
252
+ length = this.textNode.nodeValue.length;
253
+ if (length > 0 && this.textNode.nodeValue[length - 1] === 0x200B){
254
+ length -= 1;
255
+ }
256
+ diff = length - this._range.length;
257
+ this._range = JSRange(this._range.location + offset, length);
253
258
  }else{
254
259
  this._range = JSRange(this._range.location + offset, this._range.length);
255
260
  }
@@ -125,8 +125,12 @@ JSClass("UIHTMLTextTypesetter", JSTextTypesetter, {
125
125
  var attributes = this._attributedString.attributesAtIndex(range.location);
126
126
  attributes = this.resolveAttributes(attributes);
127
127
  var font = attributes.font || null;
128
- var element = this._createLineElement();
129
- return UIHTMLTextLine.initWithElementAndFont(element, font, font.displayLineHeight, range.location, this.canvasContext);
128
+ var span = this._createRunElement();
129
+ span.appendChild(span.ownerDocument.createTextNode("\u200B"));
130
+ this._styleTextElementWithAttributes(span, attributes, font);
131
+ var div = this._createLineElement();
132
+ var emptyRun = UIHTMLTextRun.initWithElement(span, font, attributes, range);
133
+ return UIHTMLTextLine.initWithElement(div, [emptyRun], 0, [], this.canvasContext);
130
134
  },
131
135
 
132
136
  _createLineFromHTMLLayout: function(layout){
@@ -136,6 +140,7 @@ JSClass("UIHTMLTextTypesetter", JSTextTypesetter, {
136
140
  var runDescriptor;
137
141
  var span;
138
142
  var attachmentRuns = [];
143
+ var endsWithMandatoryLineBreak = false;
139
144
  for (var i = 0, l = layout.runDescriptors.length; i < l; ++i){
140
145
  runDescriptor = layout.runDescriptors[i];
141
146
  span = this._createRunElement();
@@ -150,6 +155,7 @@ JSClass("UIHTMLTextTypesetter", JSTextTypesetter, {
150
155
  }else{
151
156
  span.appendChild(span.ownerDocument.createTextNode(utf16));
152
157
  }
158
+ endsWithMandatoryLineBreak = utf16.userPerceivedCharacterIterator(utf16.length - 1).isMandatoryLineBreak;
153
159
  }else{
154
160
  this._styleAttachmentElementWithAttributes(span, runDescriptor.attributes, runDescriptor.attachment);
155
161
  if (span.childNodes.length > 0){
@@ -169,7 +175,7 @@ JSClass("UIHTMLTextTypesetter", JSTextTypesetter, {
169
175
  return this._createEmptyHTMLLine(layout.range);
170
176
  }
171
177
  var div = this._createLineElement();
172
- return UIHTMLTextLine.initWithElement(div, runs, layout.trailingWhitespaceWidth, attachmentRuns, this.canvasContext);
178
+ return UIHTMLTextLine.initWithElement(div, runs, layout.trailingWhitespaceWidth, attachmentRuns, this.canvasContext, endsWithMandatoryLineBreak);
173
179
  },
174
180
 
175
181
  _styleTextElementWithAttributes: function(span, attributes, font){
@@ -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){
@@ -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;
@@ -901,6 +904,9 @@ JSClass('UIWindow', UIView, {
901
904
  while (modal !== null && modal._modal !== null){
902
905
  modal = modal._modal;
903
906
  }
907
+ if (this.mouseEventView !== null && this.mouseEventView.window !== this){
908
+ this.mouseEventView = null;
909
+ }
904
910
  if (modal !== null){
905
911
  this.mouseEventView = null;
906
912
  if (event.type == UIEvent.Type.mouseEntered || event.type == UIEvent.Type.mouseExited || event.type == UIEvent.mouseMoved){
@@ -925,7 +931,9 @@ JSClass('UIWindow', UIView, {
925
931
  }
926
932
  switch (event.type){
927
933
  case UIEvent.Type.leftMouseDown:
928
- this.makeKeyAndOrderFront();
934
+ if (this._isOpen){
935
+ this.makeKeyAndOrderFront();
936
+ }
929
937
  eventTarget.mouseDown(event);
930
938
  this._validateToolbar();
931
939
  break;
@@ -422,7 +422,7 @@ JSClass("UIWindowServer", JSObject, {
422
422
  }
423
423
  }
424
424
  if (shouldHideTooltip){
425
- if (view !== null && view.tooltip !== null){
425
+ if (view !== null && view.tooltip !== null && view.tooltip !== ""){
426
426
  this.showTooltipForView(view, this.mouseLocation);
427
427
  }else{
428
428
  this._scheduleHideTooltip();
@@ -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.12.2
3
+ JSBundleVersion: 2023.14.0
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}}
@@ -76,6 +78,8 @@ http {
76
78
  return 200;
77
79
  }
78
80
 
81
+ {{STATE_PATH_REDIRECTS}}
82
+
79
83
  location /Resources {
80
84
  expires max;
81
85
  }
@@ -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 "";
@@ -77,6 +79,8 @@ http {
77
79
  return 200;
78
80
  }
79
81
 
82
+ {{STATE_PATH_REDIRECTS}}
83
+
80
84
  location / {
81
85
  # REQUIRED to eliminate extra requests for everything else
82
86
  expires max;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2023.12.2",
12
+ "version": "2023.14.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"