@breakside/jskit 2022.3.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.
Files changed (42) 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/JSColor.js +9 -0
  7. package/Frameworks/Foundation.jsframework/JS/JSMediaType.js +1 -1
  8. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  9. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  10. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  11. package/Info.json +2 -2
  12. package/Node/io.breakside.jskit-bundle.js +2 -2
  13. package/Root/Frameworks/APIKit/APIRequest.js +99 -0
  14. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  15. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  16. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  17. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  18. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  19. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  20. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  21. package/Root/Frameworks/DOM/Info.yaml +1 -1
  22. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  23. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  24. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  25. package/Root/Frameworks/Foundation/JSColor.js +9 -0
  26. package/Root/Frameworks/Foundation/JSMediaType.js +1 -1
  27. package/Root/Frameworks/ImageKit/IKColorProfile.js +133 -21
  28. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  29. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  30. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  31. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  32. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  33. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  34. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  35. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  36. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  37. package/Root/Frameworks/ServerKit/SKHTTPRequest.js +44 -0
  38. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  39. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  40. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  41. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  42. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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);
@@ -17,7 +17,7 @@
17
17
  'use strict';
18
18
 
19
19
  JSGlobalObject.JSMediaType = function(str, parameters){
20
- if (str === null || str === undefined){
20
+ if (str === null || str === undefined || str === ""){
21
21
  return null;
22
22
  }
23
23
  if (this === undefined){
@@ -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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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": "2022.3.0",
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": "8ea8049227075f2b10cb4fea532b34607b4df1cc"
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
  });
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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.ChartKit
3
- JSBundleVersion: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -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);
@@ -17,7 +17,7 @@
17
17
  'use strict';
18
18
 
19
19
  JSGlobalObject.JSMediaType = function(str, parameters){
20
- if (str === null || str === undefined){
20
+ if (str === null || str === undefined || str === ""){
21
21
  return null;
22
22
  }
23
23
  if (this === undefined){
@@ -803,47 +803,159 @@ JSClass("IKColorProfileLookupTable8", IKColorProfileType, {
803
803
  JSClass("IKColorProfileLookupTable16", IKColorProfileType, {
804
804
 
805
805
  type: IKColorProfile.DataType.lookupTable16,
806
+ numberOfInputTableEntries: 0,
807
+ mumberOfOutputTableEntries: 0,
808
+ numberOfInputChannels: 0,
809
+ numberOfOutputChannels: 0,
810
+ numberOfGridPoints: 0,
811
+ matrix: null,
812
+ inputTables: null,
813
+ outputTables: null,
814
+ lookupTableDataView: null,
815
+ stride: 0,
806
816
 
807
817
  initWithData: function(data){
808
818
  IKColorProfileLookupTable16.$super.initWithData.call(this, data);
809
819
  var dataView = data.dataView();
810
- // TODO:
820
+ if (data.length < 48){
821
+ logger.warn("not enough data for lut8 matrix");
822
+ return null;
823
+ }
824
+ this.numberOfInputChannels = dataView.getUint8(8);
825
+ this.numberOfOutputChannels = dataView.getUint8(9);
826
+ this.numberOfGridPoints = dataView.getUint8(10);
827
+ this.matrix = IKMatrix([
828
+ [s15Fixed16(dataView.getUint32(12)), s15Fixed16(dataView.getUint32(16)), s15Fixed16(dataView.getUint32(20))],
829
+ [s15Fixed16(dataView.getUint32(24)), s15Fixed16(dataView.getUint32(28)), s15Fixed16(dataView.getUint32(32))],
830
+ [s15Fixed16(dataView.getUint32(36)), s15Fixed16(dataView.getUint32(40)), s15Fixed16(dataView.getUint32(44))]
831
+ ]);
832
+ this.numberOfInputTableEntries = dataView.getUint16(48);
833
+ this.numberOfOutputTableEntries = dataView.getUint16(50);
834
+ var offset = 52;
835
+ var end;
836
+ var i, j, k;
837
+ var table;
838
+ this.stride = this.numberOfOutputChannels + this.numberOfOutputChannels;
839
+ this.inputTables = [];
840
+ this.outputTables = [];
841
+ for (i = 0; i < this.numberOfInputChannels; ++i){
842
+ this.stride *= this.numberOfGridPoints;
843
+ end = offset + this.numberOfInputTableEntries + this.numberOfInputTableEntries;
844
+ if (data.length < end){
845
+ logger.warn("not enough data for lut16 input tables");
846
+ return null;
847
+ }
848
+ table = [];
849
+ for (; offset < end; offset += 2){
850
+ table.push(dataView.getUint16(offset) / 65535.0);
851
+ }
852
+ this.inputTables.push(table);
853
+ }
854
+ end = offset + this.stride;
855
+ if (data.length < end){
856
+ logger.warn("not enough data for lut8 clut");
857
+ return null;
858
+ }
859
+ this.lookupTableDataView = this.data.subdataInRange(JSRange(offset, this.stride)).dataView();
860
+ offset += this.stride;
861
+ for (i = 0; i < this.numberOfOutputChannels; ++i){
862
+ end = offset + this.numberOfOutputTableEntries + this.numberOfOutputTableEntries;
863
+ if (data.length < end){
864
+ logger.warn("not enough data for lut8 output tables");
865
+ return null;
866
+ }
867
+ table = [];
868
+ for (; offset < end; offset += 2){
869
+ table.push(dataView.getUint16(offset) / 65535.0);
870
+ }
871
+ this.outputTables.push(table);
872
+ }
811
873
  },
812
874
 
813
875
  lookup: function(components){
876
+ var input = [];
877
+ var i, j, l;
878
+ var x, x0, x1;
879
+ var offsetCount;
880
+ var offsets = [0];
881
+ var weights = [1];
882
+ var w0, w1;
883
+ var stride = this.stride;
884
+ var d;
885
+ for (i = 0; i < this.numberOfInputChannels; ++i){
886
+ stride /= this.numberOfGridPoints;
887
+ x = this.inputTables[i][Math.round(Math.max(0, Math.min(1, components[i])) * (this.numberOfInputTableEntries - 1))];
888
+ x *= (this.numberOfGridPoints - 1);
889
+ x0 = Math.floor(x);
890
+ d = x0 * stride;
891
+ for (j = 0, l = offsets.length; j < l; ++j){
892
+ offsets[j] += d;
893
+ }
894
+ if (x > x0){
895
+ x1 = x0 + 1;
896
+ w1 = (x - x0);
897
+ w0 = 1 - w1;
898
+ for (j = 0, l = offsets.length; j < l; ++j){
899
+ offsets.push(offsets[j] + stride);
900
+ weights.push(weights[j] * w1);
901
+ weights[j] *= w0;
902
+ }
903
+ }
904
+ }
905
+ var output = [];
906
+ for (i = 0; i < this.numberOfOutputChannels; ++i){
907
+ output.push(0);
908
+ }
909
+ var offset;
910
+ for (i = 0, l = offsets.length; i < l; ++i){
911
+ offset = offsets[i];
912
+ for (j = 0; j < this.numberOfOutputChannels; ++j, offset += 2){
913
+ x = (this.lookupTableDataView.getUint16(offset) / 65535.0) * (this.numberOfOutputTableEntries - 1);
914
+ x0 = Math.floor(x);
915
+ if (x0 < x){
916
+ x1 = x0 + 1;
917
+ w1 = (x - x0);
918
+ w0 = 1 - w1;
919
+ output[j] += (this.outputTables[j][x0] * w0 + this.outputTables[j][x1] * w1) * weights[i];
920
+ }else{
921
+ output[j] += this.outputTables[j][x0] * weights[i];
922
+ }
923
+ }
924
+ }
925
+ return output;
814
926
  }
815
927
 
816
928
  });
817
929
 
818
- JSClass("IKColorProfileLookupTableAToB", IKColorProfileType, {
930
+ // JSClass("IKColorProfileLookupTableAToB", IKColorProfileType, {
819
931
 
820
- type: IKColorProfile.DataType.lookupTableAToB,
932
+ // type: IKColorProfile.DataType.lookupTableAToB,
821
933
 
822
- initWithData: function(data){
823
- IKColorProfileLookupTableAToB.$super.initWithData.call(this, data);
824
- var dataView = data.dataView();
825
- // TODO:
826
- },
934
+ // initWithData: function(data){
935
+ // IKColorProfileLookupTableAToB.$super.initWithData.call(this, data);
936
+ // var dataView = data.dataView();
937
+ // // TODO:
938
+ // },
827
939
 
828
- lookup: function(components){
829
- }
940
+ // lookup: function(components){
941
+ // }
830
942
 
831
- });
943
+ // });
832
944
 
833
- JSClass("IKColorProfileLookupTableBToA", IKColorProfileType, {
945
+ // JSClass("IKColorProfileLookupTableBToA", IKColorProfileType, {
834
946
 
835
- type: IKColorProfile.DataType.lookupTableBToA,
947
+ // type: IKColorProfile.DataType.lookupTableBToA,
836
948
 
837
- initWithData: function(data){
838
- IKColorProfileLookupTableBToA.$super.initWithData.call(this, data);
839
- var dataView = data.dataView();
840
- // TODO:
841
- },
949
+ // initWithData: function(data){
950
+ // IKColorProfileLookupTableBToA.$super.initWithData.call(this, data);
951
+ // var dataView = data.dataView();
952
+ // // TODO:
953
+ // },
842
954
 
843
- lookup: function(components){
844
- }
955
+ // lookup: function(components){
956
+ // }
845
957
 
846
- });
958
+ // });
847
959
 
848
960
  JSClass("IKColorProfileComponentConverter", JSObject, {
849
961
 
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -72,6 +72,50 @@ JSClass("SKHTTPRequest", JSObject, {
72
72
  _getOrigin: function(){
73
73
  return this.headerMap.get('Origin', null);
74
74
  },
75
+
76
+ acceptContentTypes: JSLazyInitProperty(function(){
77
+ var mediaStrings = this.headerMap.get("Accept", "").split(/\s*,\s*/);
78
+ var contentTypesAndWeights = [];
79
+ var contentType;
80
+ var q;
81
+ for (var i = 0, l = mediaStrings.length; i < l; ++i){
82
+ contentType = JSMediaType(mediaStrings[i]);
83
+ if (contentType !== null){
84
+ q = 1;
85
+ if (contentType.parameters.q !== undefined){
86
+ q = parseFloat(contentType.parameters.q);
87
+ if (isNaN(q)){
88
+ q = 0;
89
+ }
90
+ delete contentType.parameters.q;
91
+ }
92
+ contentTypesAndWeights.push([contentType, q]);
93
+ }
94
+ }
95
+ contentTypesAndWeights.sort(function(a, b){
96
+ var d = b[1] - a[1];
97
+ if (d !== 0){
98
+ return d;
99
+ }
100
+ if (a[0].type !== "*" && b[0].type === "*"){
101
+ return -1;
102
+ }
103
+ if (a[0].type === "*" && b[0].type !== "*"){
104
+ return 1;
105
+ }
106
+ if (a[0].subtype !== "*" && b[0].subtype === "*"){
107
+ return -1;
108
+ }
109
+ if (a[0].subtype === "*" && b[0].subtype !== "*"){
110
+ return 1;
111
+ }
112
+ d = Object.keys(b[0].parameters).length - Object.keys(a[0].parameters).length;
113
+ return d;
114
+ });
115
+ return contentTypesAndWeights.map(function(pair){
116
+ return pair[0];
117
+ });
118
+ }),
75
119
 
76
120
  createWebsocket: function(){
77
121
  },
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKitTesting
3
- JSBundleVersion: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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.UIKit
3
- JSBundleVersion: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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.UIKitTesting
3
- JSBundleVersion: 2022.3.0
3
+ JSBundleVersion: 2022.3.1
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": "2022.3.0",
12
+ "version": "2022.3.1",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"