@breakside/jskit 2021.46.0 → 2022.3.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.
- 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/JSColor.js +9 -0
- package/Frameworks/Foundation.jsframework/JS/JSColorSpace.js +106 -20
- package/Frameworks/Foundation.jsframework/JS/JSMediaType.js +1 -1
- package/Frameworks/Foundation.jsframework/JS/JSTimer.js +6 -0
- 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/APIRequest.js +99 -0
- 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/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/JSColor.js +9 -0
- package/Root/Frameworks/Foundation/JSColorSpace.js +106 -20
- package/Root/Frameworks/Foundation/JSMediaType.js +1 -1
- package/Root/Frameworks/Foundation/JSTimer.js +6 -0
- package/Root/Frameworks/ImageKit/IKColorProfile.js +1091 -0
- package/Root/Frameworks/ImageKit/IKColorSpace.js +49 -198
- package/Root/Frameworks/ImageKit/IKMatrix.js +124 -0
- package/Root/Frameworks/ImageKit/ImageKit.js +2 -0
- 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/ServerKit/SKHTTPRequest.js +44 -0
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UICollectionReusableView.js +91 -0
- package/Root/Frameworks/UIKit/UICollectionView.js +1254 -0
- package/Root/Frameworks/UIKit/UICollectionViewCell.js +121 -0
- package/Root/Frameworks/UIKit/UICollectionViewGridLayout.js +425 -0
- package/Root/Frameworks/UIKit/UICollectionViewLayout.js +82 -0
- package/Root/Frameworks/UIKit/UIColorWell.js +12 -1
- package/Root/Frameworks/UIKit/UIDisplayServer.js +5 -1
- package/Root/Frameworks/UIKit/UIKit.js +7 -0
- package/Root/Frameworks/UIKit/UILayer.js +3 -0
- package/Root/Frameworks/UIKit/UIListView.js +26 -11
- package/Root/Frameworks/UIKit/UIMenu.js +1 -1
- package/Root/Frameworks/UIKit/UIMenuView.js +5 -1
- package/Root/Frameworks/UIKit/UINavigationBar.js +2 -2
- package/Root/Frameworks/UIKit/UIPopupButton.js +31 -3
- package/Root/Frameworks/UIKit/UIScrollView.js +2 -0
- package/Root/Frameworks/UIKit/UISplitViewController.js +43 -9
- package/Root/Frameworks/UIKit/UITextField.js +3 -0
- package/Root/Frameworks/UIKit/UIView.js +3 -0
- package/Root/Frameworks/UIKit/UIViewController.js +11 -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": "
|
|
4
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
6
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
4
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
6
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
4
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
13
13
|
}
|
|
@@ -300,6 +300,15 @@ JSClass('JSColor', JSObject, {
|
|
|
300
300
|
return JSColor.initWithSpaceAndComponents(JSColorSpace.gray, gray);
|
|
301
301
|
},
|
|
302
302
|
|
|
303
|
+
colorInSpace: function(space){
|
|
304
|
+
if (space === this._space){
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
var components = space.componentsFromSpace(this._space, this._components);
|
|
308
|
+
components.push(this._components[this._components.length - 1]);
|
|
309
|
+
return JSColor.initWithSpaceAndComponents(space, components);
|
|
310
|
+
},
|
|
311
|
+
|
|
303
312
|
rgbaHexStringRepresentation: function(){
|
|
304
313
|
var color = this.rgbaColor();
|
|
305
314
|
var r = Math.round(color.red * 255);
|
|
@@ -88,14 +88,14 @@ JSClass("JSXYZColorSpace", JSColorSpace, {
|
|
|
88
88
|
|
|
89
89
|
name: "xyz",
|
|
90
90
|
|
|
91
|
-
initWithWhitepoint: function(mediaWhitepoint
|
|
92
|
-
if (mediaWhitepoint ===
|
|
91
|
+
initWithWhitepoint: function(mediaWhitepoint){
|
|
92
|
+
if (mediaWhitepoint === JSColorSpace.Whitepoint.profileConnection){
|
|
93
93
|
return JSColorSpace.xyz;
|
|
94
94
|
}
|
|
95
|
-
if (mediaWhitepoint[0] ===
|
|
95
|
+
if (mediaWhitepoint[0] === JSColorSpace.Whitepoint.profileConnection[0] && mediaWhitepoint[1] === JSColorSpace.Whitepoint.profileConnection[1] && mediaWhitepoint[2] === JSColorSpace.Whitepoint.profileConnection[2]){
|
|
96
96
|
return JSColorSpace.xyz;
|
|
97
97
|
}
|
|
98
|
-
return JSXYZScaledColorSpace.initWithWhitepoint(mediaWhitepoint
|
|
98
|
+
return JSXYZScaledColorSpace.initWithWhitepoint(mediaWhitepoint);
|
|
99
99
|
},
|
|
100
100
|
|
|
101
101
|
initWithScale: function(scale){
|
|
@@ -125,11 +125,11 @@ JSClass("JSXYZScaledColorSpace", JSXYZColorSpace, {
|
|
|
125
125
|
_scale: null,
|
|
126
126
|
_inverseScale: null,
|
|
127
127
|
|
|
128
|
-
initWithWhitepoint: function(mediaWhitepoint
|
|
128
|
+
initWithWhitepoint: function(mediaWhitepoint){
|
|
129
129
|
this.initWithScale([
|
|
130
|
-
mediaWhitepoint[0] /
|
|
131
|
-
mediaWhitepoint[1] /
|
|
132
|
-
mediaWhitepoint[2] /
|
|
130
|
+
mediaWhitepoint[0] / JSColorSpace.Whitepoint.profileConnection[0],
|
|
131
|
+
mediaWhitepoint[1] / JSColorSpace.Whitepoint.profileConnection[1],
|
|
132
|
+
mediaWhitepoint[2] / JSColorSpace.Whitepoint.profileConnection[2]
|
|
133
133
|
]);
|
|
134
134
|
},
|
|
135
135
|
|
|
@@ -164,10 +164,7 @@ JSClass("JSLabColorSpace", JSColorSpace, {
|
|
|
164
164
|
|
|
165
165
|
name: "lab",
|
|
166
166
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
initWithWhitepoint: function(mediaWhitepoint){
|
|
170
|
-
this.mediaWhitepoint = mediaWhitepoint;
|
|
167
|
+
init: function(){
|
|
171
168
|
},
|
|
172
169
|
|
|
173
170
|
xyzFromComponents: function(components){
|
|
@@ -181,9 +178,9 @@ JSClass("JSLabColorSpace", JSColorSpace, {
|
|
|
181
178
|
var fx = components[1] / 500.0 + fy;
|
|
182
179
|
var fz = fy - components[2] / 200.0;
|
|
183
180
|
return [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
JSColorSpace.Whitepoint.profileConnection[0] * fi(fx),
|
|
182
|
+
JSColorSpace.Whitepoint.profileConnection[1] * fi(fy),
|
|
183
|
+
JSColorSpace.Whitepoint.profileConnection[2] * fi(fz)
|
|
187
184
|
];
|
|
188
185
|
},
|
|
189
186
|
|
|
@@ -194,9 +191,9 @@ JSClass("JSLabColorSpace", JSColorSpace, {
|
|
|
194
191
|
}
|
|
195
192
|
return (841.0 / 108.0) * x + 4.0 / 29.0;
|
|
196
193
|
};
|
|
197
|
-
var fx = f(xyz[0] /
|
|
198
|
-
var fy = f(xyz[1] /
|
|
199
|
-
var fz = f(xyz[2] /
|
|
194
|
+
var fx = f(xyz[0] / JSColorSpace.Whitepoint.profileConnection[0]);
|
|
195
|
+
var fy = f(xyz[1] / JSColorSpace.Whitepoint.profileConnection[1]);
|
|
196
|
+
var fz = f(xyz[2] / JSColorSpace.Whitepoint.profileConnection[2]);
|
|
200
197
|
return [
|
|
201
198
|
116.0 * fy - 16.0,
|
|
202
199
|
500.0 * (fx - fy),
|
|
@@ -239,10 +236,52 @@ JSClass("JSRGBColorSpace", JSColorSpace, {
|
|
|
239
236
|
|
|
240
237
|
// MARK: - Lab conversions
|
|
241
238
|
|
|
239
|
+
xyzMatrix: [
|
|
240
|
+
[0.4360, 0.3851, 0.1431],
|
|
241
|
+
[0.2225, 0.7169, 0.0606],
|
|
242
|
+
[0.0139, 0.09710, 0.7139]
|
|
243
|
+
],
|
|
244
|
+
|
|
245
|
+
xyzInverseMatrix: [
|
|
246
|
+
[3.13458, -1.61731, -0.491034],
|
|
247
|
+
[-0.978957, 1.91622, 0.0335704],
|
|
248
|
+
[0.0721194, -0.229142, 1.40575]
|
|
249
|
+
],
|
|
250
|
+
|
|
251
|
+
g: 2.4,
|
|
252
|
+
a: 1.0 / 1.055,
|
|
253
|
+
b: 0.055 / 1.055,
|
|
254
|
+
c: 1.0 / 12.92,
|
|
255
|
+
d: 0.04045,
|
|
256
|
+
|
|
257
|
+
curve: function(x){
|
|
258
|
+
return parametricCurve3(x, this.g, this.a, this.b, this.c, this.d);
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
inverseCurve: function(y){
|
|
262
|
+
y = Math.max(0, Math.min(1, y));
|
|
263
|
+
return inverseParametricCurve3(y, this.g, this.a, this.b, this.c, this.d);
|
|
264
|
+
},
|
|
265
|
+
|
|
242
266
|
xyzFromComponents: function(components){
|
|
267
|
+
var rgb = [
|
|
268
|
+
this.curve(components[0]),
|
|
269
|
+
this.curve(components[1]),
|
|
270
|
+
this.curve(components[2])
|
|
271
|
+
];
|
|
272
|
+
return [
|
|
273
|
+
this.xyzMatrix[0][0] * rgb[0] + this.xyzMatrix[0][1] * rgb[1] + this.xyzMatrix[0][2] * rgb[2],
|
|
274
|
+
this.xyzMatrix[1][0] * rgb[0] + this.xyzMatrix[1][1] * rgb[1] + this.xyzMatrix[1][2] * rgb[2],
|
|
275
|
+
this.xyzMatrix[2][0] * rgb[0] + this.xyzMatrix[2][1] * rgb[1] + this.xyzMatrix[2][2] * rgb[2]
|
|
276
|
+
];
|
|
243
277
|
},
|
|
244
278
|
|
|
245
279
|
componentsFromXYZ: function(xyz){
|
|
280
|
+
return [
|
|
281
|
+
this.inverseCurve(this.xyzInverseMatrix[0][0] * xyz[0] + this.xyzInverseMatrix[0][1] * xyz[1] + this.xyzInverseMatrix[0][2] * xyz[2]),
|
|
282
|
+
this.inverseCurve(this.xyzInverseMatrix[1][0] * xyz[0] + this.xyzInverseMatrix[1][1] * xyz[1] + this.xyzInverseMatrix[1][2] * xyz[2]),
|
|
283
|
+
this.inverseCurve(this.xyzInverseMatrix[2][0] * xyz[0] + this.xyzInverseMatrix[2][1] * xyz[1] + this.xyzInverseMatrix[2][2] * xyz[2])
|
|
284
|
+
];
|
|
246
285
|
},
|
|
247
286
|
|
|
248
287
|
// MARK: - rgb <-> hsl
|
|
@@ -425,7 +464,38 @@ JSClass("JSGrayColorSpace", JSColorSpace, {
|
|
|
425
464
|
return [
|
|
426
465
|
components[0] + (1.0 - components[0]) * percentage
|
|
427
466
|
];
|
|
428
|
-
}
|
|
467
|
+
},
|
|
468
|
+
|
|
469
|
+
g: 2.4,
|
|
470
|
+
a: 1.0 / 1.055,
|
|
471
|
+
b: 0.055 / 1.055,
|
|
472
|
+
c: 1.0 / 12.92,
|
|
473
|
+
d: 0.04045,
|
|
474
|
+
|
|
475
|
+
curve: function(x){
|
|
476
|
+
return parametricCurve3(x, this.g, this.a, this.b, this.c, this.d);
|
|
477
|
+
},
|
|
478
|
+
|
|
479
|
+
inverseCurve: function(y){
|
|
480
|
+
y = Math.max(0, Math.min(1, y));
|
|
481
|
+
return inverseParametricCurve3(y, this.g, this.a, this.b, this.c, this.d);
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
// MARK: - Lab conversions
|
|
485
|
+
|
|
486
|
+
xyzFromComponents: function(components){
|
|
487
|
+
var w = this.curve(components[0]);
|
|
488
|
+
return [
|
|
489
|
+
JSColorSpace.Whitepoint.profileConnection[0] * w,
|
|
490
|
+
JSColorSpace.Whitepoint.profileConnection[1] * w,
|
|
491
|
+
JSColorSpace.Whitepoint.profileConnection[2] * w
|
|
492
|
+
];
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
componentsFromXYZ: function(xyz){
|
|
496
|
+
var y = Math.min(JSColorSpace.Whitepoint.profileConnection[1], Math.max(0, xyz[1])) / JSColorSpace.Whitepoint.profileConnection[1];
|
|
497
|
+
return [this.inverseCurve(y)];
|
|
498
|
+
},
|
|
429
499
|
|
|
430
500
|
});
|
|
431
501
|
|
|
@@ -622,7 +692,7 @@ Object.defineProperties(JSColorSpace, {
|
|
|
622
692
|
lab: {
|
|
623
693
|
configurable: true,
|
|
624
694
|
get: function(){
|
|
625
|
-
var space = JSLabColorSpace.
|
|
695
|
+
var space = JSLabColorSpace.init();
|
|
626
696
|
Object.defineProperty(this, "lab", {value: space});
|
|
627
697
|
return space;
|
|
628
698
|
}
|
|
@@ -635,4 +705,20 @@ JSColorSpace.Whitepoint = {
|
|
|
635
705
|
D65: [0.9505, 1.0, 1.08883]
|
|
636
706
|
};
|
|
637
707
|
|
|
708
|
+
JSColorSpace.Whitepoint.profileConnection = JSColorSpace.Whitepoint.D50;
|
|
709
|
+
|
|
710
|
+
var parametricCurve3 = function(x, g, a, b, c, d){
|
|
711
|
+
if (x >= d){
|
|
712
|
+
return Math.pow(a * x + b, g);
|
|
713
|
+
}
|
|
714
|
+
return c * x;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
var inverseParametricCurve3 = function(y, g, a, b, c, d){
|
|
718
|
+
if (y < c * d){
|
|
719
|
+
return y / c;
|
|
720
|
+
}
|
|
721
|
+
return (Math.pow(y, 1.0 / g) - b) / a;
|
|
722
|
+
};
|
|
723
|
+
|
|
638
724
|
})();
|
|
@@ -72,4 +72,10 @@ JSTimer.scheduledRepeatingTimerWithInterval = function(interval, action, target)
|
|
|
72
72
|
var timer = JSTimer.initWithInterval(interval, true, action, target);
|
|
73
73
|
timer.schedule();
|
|
74
74
|
return timer;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
JSTimer.waitInterval = function(interval){
|
|
78
|
+
return new Promise(function(resolve, reject){
|
|
79
|
+
JSTimer.scheduledTimerWithInterval(interval, resolve);
|
|
80
|
+
});
|
|
75
81
|
};
|
|
@@ -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": "
|
|
6
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
4
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
6
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
4
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
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": "
|
|
6
|
+
"JSBundleVersion": "2022.3.1",
|
|
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": "058d16cc912875ff9af21c0dc4aebf24df0c9ce3"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -52,6 +52,50 @@ JSClass("APIRequest", JSObject, {
|
|
|
52
52
|
return this.headerMap.get('Origin', null);
|
|
53
53
|
},
|
|
54
54
|
|
|
55
|
+
acceptContentTypes: JSLazyInitProperty(function(){
|
|
56
|
+
var mediaStrings = this.headerMap.get("Accept", "").split(/\s*,\s*/);
|
|
57
|
+
var contentTypesAndWeights = [];
|
|
58
|
+
var contentType;
|
|
59
|
+
var q;
|
|
60
|
+
for (var i = 0, l = mediaStrings.length; i < l; ++i){
|
|
61
|
+
contentType = JSMediaType(mediaStrings[i]);
|
|
62
|
+
if (contentType !== null){
|
|
63
|
+
q = 1;
|
|
64
|
+
if (contentType.parameters.q !== undefined){
|
|
65
|
+
q = parseFloat(contentType.parameters.q);
|
|
66
|
+
if (isNaN(q)){
|
|
67
|
+
q = 0;
|
|
68
|
+
}
|
|
69
|
+
delete contentType.parameters.q;
|
|
70
|
+
}
|
|
71
|
+
contentTypesAndWeights.push([contentType, q]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
contentTypesAndWeights.sort(function(a, b){
|
|
75
|
+
var d = b[1] - a[1];
|
|
76
|
+
if (d !== 0){
|
|
77
|
+
return d;
|
|
78
|
+
}
|
|
79
|
+
if (a[0].type !== "*" && b[0].type === "*"){
|
|
80
|
+
return -1;
|
|
81
|
+
}
|
|
82
|
+
if (a[0].type === "*" && b[0].type !== "*"){
|
|
83
|
+
return 1;
|
|
84
|
+
}
|
|
85
|
+
if (a[0].subtype !== "*" && b[0].subtype === "*"){
|
|
86
|
+
return -1;
|
|
87
|
+
}
|
|
88
|
+
if (a[0].subtype === "*" && b[0].subtype !== "*"){
|
|
89
|
+
return 1;
|
|
90
|
+
}
|
|
91
|
+
d = Object.keys(b[0].parameters).length - Object.keys(a[0].parameters).length;
|
|
92
|
+
return d;
|
|
93
|
+
});
|
|
94
|
+
return contentTypesAndWeights.map(function(pair){
|
|
95
|
+
return pair[0];
|
|
96
|
+
});
|
|
97
|
+
}),
|
|
98
|
+
|
|
55
99
|
needsEntityWithTag: function(etag){
|
|
56
100
|
if (!etag){
|
|
57
101
|
return true;
|
|
@@ -225,6 +269,61 @@ JSClass("APIRequest", JSObject, {
|
|
|
225
269
|
getValidQuery: function(validatingClass){
|
|
226
270
|
var validator = this.getValidatingQuery();
|
|
227
271
|
return validatingClass.initWithValidatingObject(validator);
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
bearerToken: JSReadOnlyProperty(),
|
|
275
|
+
|
|
276
|
+
getBearerToken: function(){
|
|
277
|
+
var authorization = this.headerMap.get("Authorization", null);
|
|
278
|
+
if (authorization !== null){
|
|
279
|
+
if (authorization.startsWith("Bearer ")){
|
|
280
|
+
return authorization.substr(7);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
username: JSReadOnlyProperty(),
|
|
287
|
+
|
|
288
|
+
getBasicAuthorization: function(){
|
|
289
|
+
var authorization = this.headerMap.get("Authorization", null);
|
|
290
|
+
if (authorization !== null){
|
|
291
|
+
if (authorization.startsWith("Basic ")){
|
|
292
|
+
try{
|
|
293
|
+
var basic = authorization.substr(6).dataByDecodingBase64().stringByDecodingUTF8();
|
|
294
|
+
return basic;
|
|
295
|
+
}catch (e){
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
getUsername: function(){
|
|
304
|
+
var basic = this.getBasicAuthorization();
|
|
305
|
+
if (basic !== null){
|
|
306
|
+
var index = basic.indexOf(":");
|
|
307
|
+
if (index >= 0){
|
|
308
|
+
return basic.substr(0, index);
|
|
309
|
+
}
|
|
310
|
+
return basic;
|
|
311
|
+
}
|
|
312
|
+
return null;
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
password: JSReadOnlyProperty(),
|
|
316
|
+
|
|
317
|
+
getPassword: function(){
|
|
318
|
+
var basic = this.getBasicAuthorization();
|
|
319
|
+
if (basic !== null){
|
|
320
|
+
var index = basic.indexOf(":");
|
|
321
|
+
if (index >= 0){
|
|
322
|
+
return basic.substr(index + 1);
|
|
323
|
+
}
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
return null;
|
|
228
327
|
}
|
|
229
328
|
|
|
230
329
|
});
|
|
@@ -300,6 +300,15 @@ JSClass('JSColor', JSObject, {
|
|
|
300
300
|
return JSColor.initWithSpaceAndComponents(JSColorSpace.gray, gray);
|
|
301
301
|
},
|
|
302
302
|
|
|
303
|
+
colorInSpace: function(space){
|
|
304
|
+
if (space === this._space){
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
var components = space.componentsFromSpace(this._space, this._components);
|
|
308
|
+
components.push(this._components[this._components.length - 1]);
|
|
309
|
+
return JSColor.initWithSpaceAndComponents(space, components);
|
|
310
|
+
},
|
|
311
|
+
|
|
303
312
|
rgbaHexStringRepresentation: function(){
|
|
304
313
|
var color = this.rgbaColor();
|
|
305
314
|
var r = Math.round(color.red * 255);
|