@breakside/jskit 2026.11.0 → 2026.27.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/JS/FNTOpenTypeFont.js +331 -22
- 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/JSAttributedString.js +56 -1
- package/Frameworks/Foundation.jsframework/JS/JSContext.js +44 -17
- package/Frameworks/Foundation.jsframework/JS/JSCubicBezier.js +54 -1
- package/Frameworks/Foundation.jsframework/JS/JSFont.js +8 -9
- package/Frameworks/Foundation.jsframework/JS/JSGradient.js +28 -2
- package/Frameworks/Foundation.jsframework/JS/JSImage+HTML.js +27 -1
- package/Frameworks/Foundation.jsframework/JS/JSNumberFormatter.js +23 -1
- package/Frameworks/Foundation.jsframework/JS/JSPath.js +194 -6
- package/Frameworks/Foundation.jsframework/JS/JSPoint.js +56 -0
- package/Frameworks/Foundation.jsframework/JS/JSTextRun.js +21 -4
- package/Frameworks/Foundation.jsframework/JS/JSTextStorage.js +5 -0
- package/Frameworks/Foundation.jsframework/JS/JSTextTypesetter.js +6 -1
- package/Frameworks/Foundation.jsframework/JS/JSXMLParser.js +1 -1
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/sources.json +1 -0
- 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/CSSTokenizer.js +633 -470
- 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/FNTOpenTypeFont.js +331 -22
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSAttributedString.js +56 -1
- package/Root/Frameworks/Foundation/JSContext.js +44 -17
- package/Root/Frameworks/Foundation/JSCubicBezier.js +54 -1
- package/Root/Frameworks/Foundation/JSFont.js +8 -9
- package/Root/Frameworks/Foundation/JSGradient.js +28 -2
- package/Root/Frameworks/Foundation/JSImage+HTML.js +27 -1
- package/Root/Frameworks/Foundation/JSNumberFormatter.js +23 -1
- package/Root/Frameworks/Foundation/JSPath.js +194 -6
- package/Root/Frameworks/Foundation/JSPoint.js +56 -0
- package/Root/Frameworks/Foundation/JSTextRun.js +21 -4
- package/Root/Frameworks/Foundation/JSTextStorage.js +5 -0
- package/Root/Frameworks/Foundation/JSTextTypesetter.js +6 -1
- package/Root/Frameworks/Foundation/JSXMLParser.js +1 -1
- package/Root/Frameworks/ImageKit/IKHTMLCanvasBitmapContext.js +187 -101
- package/Root/Frameworks/ImageKit/IKNodeBitmapContext.js +4 -4
- 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/TKAssert.js +4 -4
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIApplication.js +9 -1
- package/Root/Frameworks/UIKit/UICollectionView.js +4 -0
- package/Root/Frameworks/UIKit/UIColorPanel.js +46 -0
- package/Root/Frameworks/UIKit/UIColorWell.js +8 -0
- package/Root/Frameworks/UIKit/UIHTMLDisplayServer.js +21 -2
- package/Root/Frameworks/UIKit/UIHTMLDisplayServerCanvasContext.js +150 -69
- package/Root/Frameworks/UIKit/UIHTMLTextRun.js +5 -0
- package/Root/Frameworks/UIKit/UIHTMLTextTypesetter.js +18 -3
- package/Root/Frameworks/UIKit/UIListView.js +7 -5
- package/Root/Frameworks/UIKit/UIMenu.js +50 -32
- package/Root/Frameworks/UIKit/UIMenuItem.js +12 -0
- package/Root/Frameworks/UIKit/UIMenuView.js +27 -5
- package/Root/Frameworks/UIKit/UIPlatform.js +7 -0
- package/Root/Frameworks/UIKit/UIPopupButton.js +7 -1
- package/Root/Frameworks/UIKit/UIResponder.js +8 -0
- package/Root/Frameworks/UIKit/UITextEditor.js +31 -7
- package/Root/Frameworks/UIKit/UITextField.js +7 -0
- package/Root/Frameworks/UIKit/UITokenField.js +65 -0
- package/Root/Frameworks/UIKit/UIToolbar.js +1 -1
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -72,6 +72,62 @@ JSPoint.prototype = {
|
|
|
72
72
|
|
|
73
73
|
subtracting: function(other){
|
|
74
74
|
return JSPoint(this.x - other.x, this.y - other.y);
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
interpolation: function(p1, percentage){
|
|
78
|
+
return JSPoint(
|
|
79
|
+
this.x + (p1.x - this.x) * percentage,
|
|
80
|
+
this.y + (p1.y - this.y) * percentage
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
lineToPointContainsPoint: function(other, point, tolerance){
|
|
85
|
+
// first check if we're within the box defined by the segment
|
|
86
|
+
var minX, maxX;
|
|
87
|
+
if (this.x <= other.x){
|
|
88
|
+
minX = this.x - tolerance;
|
|
89
|
+
maxX = other.x + tolerance;
|
|
90
|
+
}else{
|
|
91
|
+
minX = other.x - tolerance;
|
|
92
|
+
maxX = this.x + tolerance;
|
|
93
|
+
}
|
|
94
|
+
var minY, maxY;
|
|
95
|
+
if (this.y <= other.y){
|
|
96
|
+
minY = this.y - tolerance;
|
|
97
|
+
maxY = other.y + tolerance;
|
|
98
|
+
}else{
|
|
99
|
+
minY = other.y - tolerance;
|
|
100
|
+
maxY = this.y + tolerance;
|
|
101
|
+
}
|
|
102
|
+
if (point.x < minX){
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (point.x > maxX){
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
if (point.y < minY){
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (point.y > maxY){
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// next check for the special cases of a vertical and horizontal line,
|
|
116
|
+
// where we must be near the line if we're within the box
|
|
117
|
+
var dx = (other.x - this.x);
|
|
118
|
+
var dy = (other.y - this.y);
|
|
119
|
+
if (Math.abs(dx) < 0.00001 || (Math.abs(dy) < 0.00001)){
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Finally, find the nearest point to the line and see how far away we are
|
|
124
|
+
var m1 = dy / dx;
|
|
125
|
+
var b1 = this.y - m1 * this.x;
|
|
126
|
+
var m2 = -1/m1;
|
|
127
|
+
var b2 = point.y - m2 * point.x;
|
|
128
|
+
var x = (b2 - b1) / (m1 - m2);
|
|
129
|
+
var y = m1 * x + b1;
|
|
130
|
+
return JSPoint(x, y).distanceToPoint(point) <= tolerance;
|
|
75
131
|
}
|
|
76
132
|
};
|
|
77
133
|
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// #import "JSObject.js"
|
|
17
17
|
// #import "CoreTypes.js"
|
|
18
18
|
// #import "JSAttributedString.js"
|
|
19
|
+
// #import "JSContext.js"
|
|
19
20
|
'use strict';
|
|
20
21
|
|
|
21
22
|
(function(){
|
|
@@ -31,8 +32,10 @@ JSClass("JSTextRun", JSObject, {
|
|
|
31
32
|
attributes: null,
|
|
32
33
|
font: null,
|
|
33
34
|
attachment: null,
|
|
35
|
+
_useDisplayMetrics: false,
|
|
34
36
|
|
|
35
|
-
initWithGlyphs: function(glyphs, glyphCharacterLengths, font, attributes, range){
|
|
37
|
+
initWithGlyphs: function(glyphs, glyphCharacterLengths, font, attributes, range, useDisplayMetrics){
|
|
38
|
+
this._useDisplayMetrics = useDisplayMetrics === true;
|
|
36
39
|
this.glyphs = glyphs;
|
|
37
40
|
this.glyphCharacterLengths = glyphCharacterLengths;
|
|
38
41
|
this.attributes = attributes;
|
|
@@ -42,8 +45,13 @@ JSClass("JSTextRun", JSObject, {
|
|
|
42
45
|
this._size = JSSize(this.attachment.size);
|
|
43
46
|
}else{
|
|
44
47
|
this.font = font;
|
|
45
|
-
this.
|
|
46
|
-
|
|
48
|
+
if (this._useDisplayMetrics){
|
|
49
|
+
this.baseline = -font.displayDescender;
|
|
50
|
+
this._size = JSSize(0, font.displayLineHeight);
|
|
51
|
+
}else{
|
|
52
|
+
this.baseline = -font.descender;
|
|
53
|
+
this._size = JSSize(0, font.lineHeight);
|
|
54
|
+
}
|
|
47
55
|
for (var i = 0, l = glyphs.length; i < l; ++i){
|
|
48
56
|
this._size.width += font.widthOfGlyph(glyphs[i]);
|
|
49
57
|
}
|
|
@@ -67,9 +75,18 @@ JSClass("JSTextRun", JSObject, {
|
|
|
67
75
|
context.restore();
|
|
68
76
|
}else{
|
|
69
77
|
context.save();
|
|
70
|
-
|
|
78
|
+
if (this._useDisplayMetrics){
|
|
79
|
+
context.translateBy(point.x, point.y + this.font.displayAscender);
|
|
80
|
+
}else{
|
|
81
|
+
context.translateBy(point.x, point.y + this.font.ascender);
|
|
82
|
+
}
|
|
71
83
|
context.setFont(this.font);
|
|
72
84
|
context.setFillColor(this.attributes.textColor);
|
|
85
|
+
if (this.attributes.strokeWidth){
|
|
86
|
+
context.setLineWidth(this.attributes.strokeWidth);
|
|
87
|
+
context.setStrokeColor(this.attributes.strokeColor);
|
|
88
|
+
context.setTextDrawingMode(JSContext.TextDrawingMode.fillStroke);
|
|
89
|
+
}
|
|
73
90
|
context.showGlyphs(this.glyphs);
|
|
74
91
|
context.restore();
|
|
75
92
|
}
|
|
@@ -30,6 +30,11 @@ JSClass("JSTextStorage", JSAttributedString, {
|
|
|
30
30
|
this._commonTextStorageInit();
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
+
initFromDictionary: function(dictionary){
|
|
34
|
+
JSTextStorage.$super.initFromDictionary.call(this, dictionary);
|
|
35
|
+
this._commonTextStorageInit();
|
|
36
|
+
},
|
|
37
|
+
|
|
33
38
|
_commonTextStorageInit: function(){
|
|
34
39
|
this._layoutManagers = [];
|
|
35
40
|
},
|
|
@@ -77,9 +77,14 @@ JSClass("JSTextTypesetter", JSObject, {
|
|
|
77
77
|
var attributes = this._attributedString.attributesAtIndex(range.location);
|
|
78
78
|
attributes = this.resolveAttributes(attributes);
|
|
79
79
|
var font = attributes.font;
|
|
80
|
+
if (this.useDisplayMetrics){
|
|
81
|
+
return JSTextLine.initWithHeight(font.displayLineHeight, -font.displayDescender, range.location);
|
|
82
|
+
}
|
|
80
83
|
return JSTextLine.initWithHeight(font.lineHeight, -font.descender, range.location);
|
|
81
84
|
},
|
|
82
85
|
|
|
86
|
+
useDisplayMetrics: false,
|
|
87
|
+
|
|
83
88
|
_createLineFromLayout: function(layout){
|
|
84
89
|
// Create runs from the adjusted run descriptors
|
|
85
90
|
var runs = [];
|
|
@@ -88,7 +93,7 @@ JSClass("JSTextTypesetter", JSObject, {
|
|
|
88
93
|
var runDescriptor;
|
|
89
94
|
for (var i = 0, l = layout.runDescriptors.length; i < l; ++i){
|
|
90
95
|
runDescriptor = layout.runDescriptors[i];
|
|
91
|
-
run = JSTextRun.initWithGlyphs(runDescriptor.glyphs, runDescriptor.glyphCharacterLengths, runDescriptor.font, runDescriptor.attributes, JSRange(runDescriptor.location, runDescriptor.length));
|
|
96
|
+
run = JSTextRun.initWithGlyphs(runDescriptor.glyphs, runDescriptor.glyphCharacterLengths, runDescriptor.font, runDescriptor.attributes, JSRange(runDescriptor.location, runDescriptor.length), this.useDisplayMetrics);
|
|
92
97
|
run.origin.x = x;
|
|
93
98
|
x += run.size.width;
|
|
94
99
|
runs.push(run);
|
|
@@ -475,7 +475,7 @@ JSClass("JSXMLParser", JSObject, {
|
|
|
475
475
|
}
|
|
476
476
|
obj = readObject();
|
|
477
477
|
}
|
|
478
|
-
if (!this.isStopped && this.delegate.xmlParserDidEndDocument){
|
|
478
|
+
if (!this.isStopped && this.delegate && this.delegate.xmlParserDidEndDocument){
|
|
479
479
|
this.delegate.xmlParserDidEndDocument(this);
|
|
480
480
|
}
|
|
481
481
|
}catch (e){
|
|
@@ -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": "2026.
|
|
6
|
+
"JSBundleVersion": "2026.27.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": "f25bf439a7b48f4536a7f4a44d2f1ec39c46208d"
|
|
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": "2026.
|
|
4
|
+
"JSBundleVersion": "2026.27.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": "f25bf439a7b48f4536a7f4a44d2f1ec39c46208d"
|
|
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": "2026.
|
|
6
|
+
"JSBundleVersion": "2026.27.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": "f25bf439a7b48f4536a7f4a44d2f1ec39c46208d"
|
|
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": "2026.
|
|
4
|
+
"JSBundleVersion": "2026.27.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": "f25bf439a7b48f4536a7f4a44d2f1ec39c46208d"
|
|
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": "2026.
|
|
6
|
+
"JSBundleVersion": "2026.27.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": "f25bf439a7b48f4536a7f4a44d2f1ec39c46208d"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|