@breakside/jskit 2023.9.1 → 2023.10.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 (55) 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/JSClass.js +0 -2
  7. package/Frameworks/Foundation.jsframework/JS/JSFont.js +8 -0
  8. package/Frameworks/Foundation.jsframework/JS/JSFontDescriptor.js +5 -0
  9. package/Frameworks/Foundation.jsframework/JS/JSTextFramesetter.js +7 -2
  10. package/Frameworks/Foundation.jsframework/JS/JSTextLine.js +2 -2
  11. package/Frameworks/Foundation.jsframework/JS/JSTextTypesetter.js +1 -1
  12. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  13. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  14. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  15. package/Info.json +2 -2
  16. package/Node/io.breakside.jskit-bundle.js +2 -2
  17. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  18. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  19. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  20. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  21. package/Root/Frameworks/ChartKit/CHPieChart.js +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/Info.yaml +1 -1
  28. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  29. package/Root/Frameworks/Foundation/JSClass.js +0 -2
  30. package/Root/Frameworks/Foundation/JSFont.js +8 -0
  31. package/Root/Frameworks/Foundation/JSFontDescriptor.js +5 -0
  32. package/Root/Frameworks/Foundation/JSTextFramesetter.js +7 -2
  33. package/Root/Frameworks/Foundation/JSTextLine.js +2 -2
  34. package/Root/Frameworks/Foundation/JSTextTypesetter.js +1 -1
  35. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  36. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  37. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  38. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  39. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  40. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  41. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  42. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  43. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  44. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  45. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  46. package/Root/Frameworks/TestKit/TKTestSuite.js +1 -1
  47. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  48. package/Root/Frameworks/UIKit/UIAlertController.js +2 -2
  49. package/Root/Frameworks/UIKit/UIHTMLTextLine.js +6 -5
  50. package/Root/Frameworks/UIKit/UIListView.js +4 -1
  51. package/Root/Frameworks/UIKit/UIMenuBar.js +1 -1
  52. package/Root/Frameworks/UIKit/UIVisualEffect+HTML.js +8 -0
  53. package/Root/Frameworks/UIKit/UIVisualEffect.js +25 -0
  54. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  55. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2023.9.1",
4
+ "JSBundleVersion": "2023.10.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "DOM+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
12
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
6
- "JSBundleVersion": "2023.9.1",
6
+ "JSBundleVersion": "2023.10.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
11
11
  "node": "DOM+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
14
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
4
- "JSBundleVersion": "2023.9.1",
4
+ "JSBundleVersion": "2023.10.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
8
8
  "html": "FontKit+HTML.js"
9
9
  },
10
10
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
11
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
11
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
6
- "JSBundleVersion": "2023.9.1",
6
+ "JSBundleVersion": "2023.10.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
10
10
  "html": "FontKit+HTML.js"
11
11
  },
12
12
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
13
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
13
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
14
14
  },
15
15
  "Resources": [],
16
16
  "ResourceLookup": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
4
- "JSBundleVersion": "2023.9.1",
4
+ "JSBundleVersion": "2023.10.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "Foundation+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
12
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
13
13
  }
@@ -178,8 +178,6 @@ JSClass.prototype = {
178
178
  if (result instanceof Promise){
179
179
  return result.then(function(promiseResult){
180
180
  return promiseResult || obj;
181
- }, function(){
182
- return null;
183
181
  });
184
182
  }
185
183
  return result;
@@ -134,6 +134,14 @@ JSClass("JSFont", JSObject, {
134
134
  return JSFont.initWithDescriptor(descriptor, this.pointSize);
135
135
  },
136
136
 
137
+ bolderFont: function(){
138
+ var descriptor = this.descriptor.bolderDescriptor();
139
+ if (descriptor === null){
140
+ descriptor = this.descriptor.fontWithWeight(JSFont.Weight.bold);
141
+ }
142
+ return JSFont.initWithDescriptor(descriptor, this.pointSize);
143
+ },
144
+
137
145
  fontWithStyle: function(style){
138
146
  if (style == this.descriptor.style){
139
147
  return this;
@@ -43,6 +43,11 @@ JSClass("JSFontDescriptor", JSObject, {
43
43
  return JSFontDescriptor.descriptorWithFamily(this.family, weight, this.style) || this;
44
44
  },
45
45
 
46
+ bolderDescriptor: function(){
47
+ var weight = this._weight + 300;
48
+ return this.descriptorWithWeight(weight);
49
+ },
50
+
46
51
  descriptorWithStyle: function(style){
47
52
  return JSFontDescriptor.descriptorWithFamily(this.family, this.weight, style) || this;
48
53
  },
@@ -109,11 +109,16 @@ JSClass("JSTextFramesetter", JSObject, {
109
109
  if (remianingRange.length > 0 && lineLimit > lines.length + 1){
110
110
  // we got truncated because of height. Re-run the last line so it
111
111
  // gets broken according to truncation rules rather than word break
112
+ y = line.origin.y;
112
113
  lineRange = this._typesetter.suggestLineBreak(widthLimit, JSRange(line.range.location, line.range.length + remianingRange.length), paragraphStyle.lineBreakMode);
113
114
  line = this._typesetter.createLine(lineRange);
115
+ line.origin.y = y;
116
+ line = line.truncatedLine(widthLimit, undefined, true);
117
+ lines.push(line);
118
+ }else{
119
+ line = line.truncatedLine(widthLimit);
120
+ lines.push(line);
114
121
  }
115
- var truncated = line.truncatedLine(widthLimit);
116
- lines.push(truncated);
117
122
  }
118
123
  var frame = this.constructFrame(lines, size);
119
124
  this._alignLinesInFrame(frame);
@@ -191,8 +191,8 @@ JSClass("JSTextLine", JSObject, {
191
191
  return line;
192
192
  },
193
193
 
194
- truncatedLine: function(width, token){
195
- if (width + 0.1 >= this._size.width){
194
+ truncatedLine: function(width, token, force){
195
+ if (width + 0.1 >= this._size.width && force !== true){
196
196
  return this;
197
197
  }
198
198
 
@@ -335,7 +335,7 @@ JSClass("JSTextTypesetter", JSObject, {
335
335
  if (attributes.bold || attributes.italic){
336
336
  attributes = JSCopy(attributes);
337
337
  if (attributes.bold){
338
- attributes.font = attributes.font.fontWithWeight(JSFont.Weight.bold);
338
+ attributes.font = attributes.font.bolderFont();
339
339
  }
340
340
  if (attributes.italic){
341
341
  attributes.font = attributes.font.fontWithStyle(JSFont.Style.italic);
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
6
- "JSBundleVersion": "2023.9.1",
6
+ "JSBundleVersion": "2023.10.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
11
11
  "node": "Foundation+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
14
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
15
15
  },
16
16
  "Resources": [
17
17
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
4
- "JSBundleVersion": "2023.9.1",
4
+ "JSBundleVersion": "2023.10.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "SecurityKit+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
12
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
6
- "JSBundleVersion": "2023.9.1",
6
+ "JSBundleVersion": "2023.10.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
11
11
  "node": "SecurityKit+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
14
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
package/Info.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "node",
3
3
  "JSBundleIdentifier": "io.breakside.jskit",
4
- "JSBundleVersion": "2023.9.1",
4
+ "JSBundleVersion": "2023.10.0",
5
5
  "JSExecutableName": "jskit",
6
6
  "NPMOrganization": "breakside",
7
7
  "JSResources": [
8
8
  "Tests/HTMLTestRunner.js",
9
9
  "Tests/NodeTestRunner.js"
10
10
  ],
11
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
11
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "node",
5
5
  "JSBundleIdentifier": "io.breakside.jskit",
6
- "JSBundleVersion": "2023.9.1",
6
+ "JSBundleVersion": "2023.10.0",
7
7
  "JSExecutableName": "jskit",
8
8
  "NPMOrganization": "breakside",
9
9
  "JSResources": [
10
10
  "Tests/HTMLTestRunner.js",
11
11
  "Tests/NodeTestRunner.js"
12
12
  ],
13
- "GitRevision": "1a4e4cfebe3671d6605583e7b24ff9665646b58f"
13
+ "GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSIncludeDirectories:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKitTesting
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.AuthKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.CSSOM
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -28,7 +28,7 @@ JSClass("CHPieChart", CHChart, {
28
28
  this.valueFormatter = JSNumberFormatter.init();
29
29
  this.valueFormatter.format = "0%";
30
30
  this.valueFormatter.multiplier = 100;
31
- this.labelFont = JSFont.systemFontOfSize(JSFont.Size.normal).fontWithWeight(JSFont.Weight.bold);
31
+ this.labelFont = JSFont.systemFontOfSize(JSFont.Size.normal).bolderFont();
32
32
  this.labelTextColor = JSColor.white;
33
33
  this.labelShadowColor = JSColor.black.colorWithAlpha(0.4);
34
34
  this.labelShadowOffset = JSPoint(1, 1);
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ChartKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  # JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ConferenceKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DBKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DOM
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Dispatch
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSCopyright: Copyright © 2020 Breakside Inc.
5
5
  JSBundleEnvironments:
6
6
  html: Dispatch+HTML.js
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.FontKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Foundation
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -178,8 +178,6 @@ JSClass.prototype = {
178
178
  if (result instanceof Promise){
179
179
  return result.then(function(promiseResult){
180
180
  return promiseResult || obj;
181
- }, function(){
182
- return null;
183
181
  });
184
182
  }
185
183
  return result;
@@ -134,6 +134,14 @@ JSClass("JSFont", JSObject, {
134
134
  return JSFont.initWithDescriptor(descriptor, this.pointSize);
135
135
  },
136
136
 
137
+ bolderFont: function(){
138
+ var descriptor = this.descriptor.bolderDescriptor();
139
+ if (descriptor === null){
140
+ descriptor = this.descriptor.fontWithWeight(JSFont.Weight.bold);
141
+ }
142
+ return JSFont.initWithDescriptor(descriptor, this.pointSize);
143
+ },
144
+
137
145
  fontWithStyle: function(style){
138
146
  if (style == this.descriptor.style){
139
147
  return this;
@@ -43,6 +43,11 @@ JSClass("JSFontDescriptor", JSObject, {
43
43
  return JSFontDescriptor.descriptorWithFamily(this.family, weight, this.style) || this;
44
44
  },
45
45
 
46
+ bolderDescriptor: function(){
47
+ var weight = this._weight + 300;
48
+ return this.descriptorWithWeight(weight);
49
+ },
50
+
46
51
  descriptorWithStyle: function(style){
47
52
  return JSFontDescriptor.descriptorWithFamily(this.family, this.weight, style) || this;
48
53
  },
@@ -109,11 +109,16 @@ JSClass("JSTextFramesetter", JSObject, {
109
109
  if (remianingRange.length > 0 && lineLimit > lines.length + 1){
110
110
  // we got truncated because of height. Re-run the last line so it
111
111
  // gets broken according to truncation rules rather than word break
112
+ y = line.origin.y;
112
113
  lineRange = this._typesetter.suggestLineBreak(widthLimit, JSRange(line.range.location, line.range.length + remianingRange.length), paragraphStyle.lineBreakMode);
113
114
  line = this._typesetter.createLine(lineRange);
115
+ line.origin.y = y;
116
+ line = line.truncatedLine(widthLimit, undefined, true);
117
+ lines.push(line);
118
+ }else{
119
+ line = line.truncatedLine(widthLimit);
120
+ lines.push(line);
114
121
  }
115
- var truncated = line.truncatedLine(widthLimit);
116
- lines.push(truncated);
117
122
  }
118
123
  var frame = this.constructFrame(lines, size);
119
124
  this._alignLinesInFrame(frame);
@@ -191,8 +191,8 @@ JSClass("JSTextLine", JSObject, {
191
191
  return line;
192
192
  },
193
193
 
194
- truncatedLine: function(width, token){
195
- if (width + 0.1 >= this._size.width){
194
+ truncatedLine: function(width, token, force){
195
+ if (width + 0.1 >= this._size.width && force !== true){
196
196
  return this;
197
197
  }
198
198
 
@@ -335,7 +335,7 @@ JSClass("JSTextTypesetter", JSObject, {
335
335
  if (attributes.bold || attributes.italic){
336
336
  attributes = JSCopy(attributes);
337
337
  if (attributes.bold){
338
- attributes.font = attributes.font.fontWithWeight(JSFont.Weight.bold);
338
+ attributes.font = attributes.font.bolderFont();
339
339
  }
340
340
  if (attributes.italic){
341
341
  attributes.font = attributes.font.fontWithStyle(JSFont.Style.italic);
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKitUI
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.NotificationKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.PDFKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.QRKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SearchKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SecurityKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKitTesting
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.TestKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -49,7 +49,7 @@ JSClass("TKTestSuite", JSObject, {
49
49
 
50
50
  getResourceData: function(resourceName, ext, completion, target){
51
51
  var metadata = this.bundle.metadataForResourceName(resourceName, ext);
52
- this.bundle.getResourceData(metadata, completion, target);
52
+ return this.bundle.getResourceData(metadata, completion, target);
53
53
  }
54
54
 
55
55
  });
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKit
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -75,7 +75,7 @@ JSClass("UIAlertController", UIViewController, {
75
75
  this._titleLabel.maximumNumberOfLines = 2;
76
76
  this._titleLabel.textAlignment = JSTextAlignment.center;
77
77
  this._titleLabel.text = this.title;
78
- this._titleLabel.font = this._titleLabel.font.fontWithWeight(JSFont.Weight.bold);
78
+ this._titleLabel.font = this._titleLabel.font.bolderFont();
79
79
  this._primaryStackView.addSubview(this._titleLabel);
80
80
  }
81
81
  if (this.message !== null && this.message !== ''){
@@ -214,7 +214,7 @@ UIAlertController.ButtonStylers = Object.create({}, {
214
214
  configurable: true,
215
215
  get: function(){
216
216
  var styler = UIButtonDefaultStyler.init();
217
- styler.font = styler.font.fontWithPointSize(JSFont.Size.detail).fontWithWeight(JSFont.Weight.bold);
217
+ styler.font = styler.font.fontWithPointSize(JSFont.Size.detail).bolderFont();
218
218
  styler.normalTitleColor = JSColor.destructive;
219
219
  styler.activeTitleColor = JSColor.destructive.colorDarkenedByPercentage(0.2);
220
220
  styler.disabledTitleColor = JSColor.destructive.colorWithAlpha(0.5);
@@ -64,8 +64,8 @@ JSClass("UIHTMLTextLine", JSTextLine, {
64
64
  // // HTML does this for us
65
65
  // },
66
66
 
67
- truncatedLine: function(width, token){
68
- if (width + 0.1 >= this._size.width){
67
+ truncatedLine: function(width, token, force){
68
+ if (width + 0.1 >= this._size.width && force !== true){
69
69
  return this;
70
70
  }
71
71
 
@@ -119,12 +119,13 @@ JSClass("UIHTMLTextLine", JSTextLine, {
119
119
  line.size.width += tokenRun.size.width;
120
120
 
121
121
  var iterator = run.textNode.nodeValue.userPerceivedCharacterIterator(run.textNode.nodeValue.length - 1);
122
- while (iterator.character !== null && iterator.isMandatoryLineBreak){
123
- iterator.decrement();
122
+ while (iterator.firstCharacter !== null && iterator.isMandatoryLineBreak){
124
123
  run.range.length -= iterator.range.length;
125
124
  line.range.length -= iterator.range.length;
125
+ run.textNode.nodeValue = run.textNode.nodeValue.substr(0, run.textNode.nodeValue.length - iterator.range.length);
126
+ iterator.decrement();
126
127
  }
127
- while (iterator.character !== null && line.size.width > width){
128
+ while (iterator.firstCharacter !== null && line.size.width > width){
128
129
  metrics = this.canvasContext.measureText(iterator.utf16);
129
130
  run.size.width -= metrics.width;
130
131
  run.range.length -= iterator.range.length;
@@ -2421,6 +2421,9 @@ JSClass("UIListView", UIScrollView, {
2421
2421
  if (this._touch.cell){
2422
2422
  this._touch.cell.active = false;
2423
2423
  this._setSelectedIndexPaths([this._touch.cell.indexPath], {notifyDelegate: true});
2424
+ if (this.delegate && this.delegate.listViewDidFinishSelectingCellAtIndexPath){
2425
+ this.delegate.listViewDidFinishSelectingCellAtIndexPath(this, this._touch.cell.indexPath);
2426
+ }
2424
2427
  }
2425
2428
  this._touch = null;
2426
2429
  }
@@ -3135,7 +3138,7 @@ JSClass("UIListViewDefaultStyler", UIListViewStyler, {
3135
3138
  this.cellFont = JSFont.systemFontOfSize(JSFont.Size.normal);
3136
3139
  }
3137
3140
  if (this.headerFont === null){
3138
- this.headerFont = JSFont.systemFontOfSize(JSFont.Size.normal).fontWithWeight(JSFont.Weight.bold);
3141
+ this.headerFont = JSFont.systemFontOfSize(JSFont.Size.normal).bolderFont();
3139
3142
  }
3140
3143
  if (this.cellTextColor === null){
3141
3144
  this.cellTextColor = JSColor.text;
@@ -882,7 +882,7 @@ JSClass("UIMenuBarItemView", UIView, {
882
882
  if (this._titleLabel){
883
883
  var font = this._menuBar.font;
884
884
  if (this._item === this._menuBar.primaryMenuItem){
885
- font = font.fontWithWeight(JSFont.Weight.bold);
885
+ font = font.bolderFont();
886
886
  }
887
887
  this._titleLabel.font = font;
888
888
  this._titleLabel.textColor = textColor;
@@ -54,4 +54,12 @@ UIDesaturateEffect.definePropertiesFromExtensions({
54
54
  return "saturate(%f)".sprintf(1 - this.percentage);
55
55
  }
56
56
 
57
+ });
58
+
59
+ UIDarkenEffect.definePropertiesFromExtensions({
60
+
61
+ cssFilterString: function(){
62
+ return "brightness(%f)".sprintf(1 - this.percentage);
63
+ }
64
+
57
65
  });
@@ -118,4 +118,29 @@ JSClass("UIDesaturateEffect", UIVisualEffect, {
118
118
  return UIDesaturateEffect.initWithPercentage(0);
119
119
  }
120
120
 
121
+ });
122
+
123
+ JSClass("UIDarkenEffect", UIVisualEffect, {
124
+
125
+ percentage: 1,
126
+
127
+ initWithPercentage: function(percentage){
128
+ this.percentage = percentage;
129
+ },
130
+
131
+ initWithSpec: function(spec){
132
+ UIDesaturateEffect.$super.initWithSpec.call(this, spec);
133
+ if (spec.containsKey("percentage")){
134
+ this.percentage = spec.valueForKey("percentage", Number);
135
+ }
136
+ },
137
+
138
+ animationInterpolation: function(from, to, progress){
139
+ return UIDesaturateEffect.initWithPercentage(from.percentage + (to.percentage - from.percentage) * progress);
140
+ },
141
+
142
+ defaultAnimationValue: function(){
143
+ return UIDesaturateEffect.initWithPercentage(0);
144
+ }
145
+
121
146
  });
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2023.9.1
3
+ JSBundleVersion: 2023.10.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": "2023.9.1",
12
+ "version": "2023.10.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"