@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.
- 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/JSClass.js +0 -2
- package/Frameworks/Foundation.jsframework/JS/JSFont.js +8 -0
- package/Frameworks/Foundation.jsframework/JS/JSFontDescriptor.js +5 -0
- package/Frameworks/Foundation.jsframework/JS/JSTextFramesetter.js +7 -2
- package/Frameworks/Foundation.jsframework/JS/JSTextLine.js +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSTextTypesetter.js +1 -1
- 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/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/CHPieChart.js +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/JSClass.js +0 -2
- package/Root/Frameworks/Foundation/JSFont.js +8 -0
- package/Root/Frameworks/Foundation/JSFontDescriptor.js +5 -0
- package/Root/Frameworks/Foundation/JSTextFramesetter.js +7 -2
- package/Root/Frameworks/Foundation/JSTextLine.js +2 -2
- package/Root/Frameworks/Foundation/JSTextTypesetter.js +1 -1
- 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/TestKit/TKTestSuite.js +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIAlertController.js +2 -2
- package/Root/Frameworks/UIKit/UIHTMLTextLine.js +6 -5
- package/Root/Frameworks/UIKit/UIListView.js +4 -1
- package/Root/Frameworks/UIKit/UIMenuBar.js +1 -1
- package/Root/Frameworks/UIKit/UIVisualEffect+HTML.js +8 -0
- package/Root/Frameworks/UIKit/UIVisualEffect.js +25 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- 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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
12
|
+
"GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
|
|
13
13
|
}
|
|
@@ -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.
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
13
|
+
"GitRevision": "82e4b33e5cc31b920a148b1308206727138f5593"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -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).
|
|
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);
|
|
@@ -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.
|
|
338
|
+
attributes.font = attributes.font.bolderFont();
|
|
339
339
|
}
|
|
340
340
|
if (attributes.italic){
|
|
341
341
|
attributes.font = attributes.font.fontWithStyle(JSFont.Style.italic);
|
|
@@ -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
|
});
|
|
@@ -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.
|
|
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).
|
|
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.
|
|
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.
|
|
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).
|
|
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.
|
|
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
|
});
|