@breakside/jskit 2024.25.0 → 2024.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +16 -0
  7. package/Frameworks/Foundation.jsframework/JS/JSColorSpace.js +2 -0
  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/Info.yaml +1 -1
  14. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  15. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  16. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  17. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  18. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  19. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  20. package/Root/Frameworks/DOM/Info.yaml +1 -1
  21. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  22. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  23. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  24. package/Root/Frameworks/Foundation/JSColor.js +16 -0
  25. package/Root/Frameworks/Foundation/JSColorSpace.js +2 -0
  26. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  27. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  28. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  29. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  30. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  31. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  32. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  33. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  34. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  35. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  36. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  37. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  38. package/Root/Frameworks/UIKit/UIApplication.js +22 -0
  39. package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +14 -4
  40. package/Root/Frameworks/UIKit/UIWindowServer.js +51 -3
  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": "2024.25.0",
4
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
12
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
6
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
14
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
4
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
11
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
6
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
13
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
4
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
12
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
13
13
  }
@@ -309,6 +309,22 @@ JSClass('JSColor', JSObject, {
309
309
  return JSColor.initWithSpaceAndComponents(space, components);
310
310
  },
311
311
 
312
+ luminance: JSReadOnlyProperty(),
313
+
314
+ getLuminance: function(){
315
+ var xyzColor = this.colorInSpace(JSColorSpace.xyz);
316
+ return xyzColor.components[1];
317
+ },
318
+
319
+ contrastRatioWithColor: function(other){
320
+ var l1 = this.luminance;
321
+ var l2 = other.luminance;
322
+ if (l1 > l2){
323
+ return (l1 + 0.05) / (l2 + 0.05);
324
+ }
325
+ return (l2 + 0.05) / (l1 + 0.05);
326
+ },
327
+
312
328
  rgbaHexStringRepresentation: function(){
313
329
  var color = this.rgbaColor();
314
330
  var r = Math.round(color.red * 255);
@@ -87,6 +87,7 @@ JSClass("JSColorSpace", JSObject, {
87
87
  JSClass("JSXYZColorSpace", JSColorSpace, {
88
88
 
89
89
  name: "xyz",
90
+ numberOfComponents: 3,
90
91
 
91
92
  initWithWhitepoint: function(mediaWhitepoint){
92
93
  if (mediaWhitepoint === JSColorSpace.Whitepoint.profileConnection){
@@ -163,6 +164,7 @@ JSClass("JSXYZScaledColorSpace", JSXYZColorSpace, {
163
164
  JSClass("JSLabColorSpace", JSColorSpace, {
164
165
 
165
166
  name: "lab",
167
+ numberOfComponents: 3,
166
168
 
167
169
  init: function(){
168
170
  },
@@ -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": "2024.25.0",
6
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
14
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
4
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
12
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
6
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
14
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
4
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
11
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
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": "2024.25.0",
6
+ "JSBundleVersion": "2024.26.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": "e58ea65d45a3cd3f4e61eb08af4aa7b9d65b5028"
13
+ "GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSIncludeDirectories:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKitTesting
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.AuthKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.CSSOM
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ChartKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  # JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ConferenceKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DBKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DOM
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Dispatch
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSCopyright: Copyright © 2020 Breakside Inc.
5
5
  JSBundleEnvironments:
6
6
  html: Dispatch+HTML.js
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.FontKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Foundation
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -309,6 +309,22 @@ JSClass('JSColor', JSObject, {
309
309
  return JSColor.initWithSpaceAndComponents(space, components);
310
310
  },
311
311
 
312
+ luminance: JSReadOnlyProperty(),
313
+
314
+ getLuminance: function(){
315
+ var xyzColor = this.colorInSpace(JSColorSpace.xyz);
316
+ return xyzColor.components[1];
317
+ },
318
+
319
+ contrastRatioWithColor: function(other){
320
+ var l1 = this.luminance;
321
+ var l2 = other.luminance;
322
+ if (l1 > l2){
323
+ return (l1 + 0.05) / (l2 + 0.05);
324
+ }
325
+ return (l2 + 0.05) / (l1 + 0.05);
326
+ },
327
+
312
328
  rgbaHexStringRepresentation: function(){
313
329
  var color = this.rgbaColor();
314
330
  var r = Math.round(color.red * 255);
@@ -87,6 +87,7 @@ JSClass("JSColorSpace", JSObject, {
87
87
  JSClass("JSXYZColorSpace", JSColorSpace, {
88
88
 
89
89
  name: "xyz",
90
+ numberOfComponents: 3,
90
91
 
91
92
  initWithWhitepoint: function(mediaWhitepoint){
92
93
  if (mediaWhitepoint === JSColorSpace.Whitepoint.profileConnection){
@@ -163,6 +164,7 @@ JSClass("JSXYZScaledColorSpace", JSXYZColorSpace, {
163
164
  JSClass("JSLabColorSpace", JSColorSpace, {
164
165
 
165
166
  name: "lab",
167
+ numberOfComponents: 3,
166
168
 
167
169
  init: function(){
168
170
  },
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKitUI
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.NotificationKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.PDFKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.QRKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SearchKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SecurityKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKitTesting
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.TestKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKit
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -39,6 +39,8 @@ JSClass('UIApplication', UIResponder, {
39
39
  this.windowServer = windowServer;
40
40
  if (this.bundle.info.UIUserInterfaceStyle === "light"){
41
41
  this.windowServer.darkModeEnabled = false;
42
+ }else if (this.bundle.info.UIUserInterfaceStyle === "dark"){
43
+ this.windowServer.lightModeEnabled = false;
42
44
  }
43
45
  this._windows = [];
44
46
  this.windowServer.postNotificationForAccessibilityElement(UIAccessibility.Notification.elementCreated, this);
@@ -104,6 +106,16 @@ JSClass('UIApplication', UIResponder, {
104
106
  JSTimeZone.stopSendingNotifications(JSNotificationCenter.shared);
105
107
  },
106
108
 
109
+ observeValueForKeyPath: function(keyPath, ofObject, change, context){
110
+ if (ofObject === JSUserDefaults.shared){
111
+ if (keyPath === "UIUserInterfaceStyle"){
112
+ this.windowServer.userInterfaceStyle = JSUserDefaults.shared.UIUserInterfaceStyle;
113
+ }else if (keyPath === "UIUserInterfaceContrast"){
114
+ this.windowServer.accessibilityContrast = JSUserDefaults.shared.UIUserInterfaceContrast;
115
+ }
116
+ }
117
+ },
118
+
107
119
  setupTimeZones: function(completion, target){
108
120
  var subdirectory = (this.bundle.info.JSTimeZoneInfo || "tz") + ".zoneinfo";
109
121
  var metadata = this.bundle.metadataForResourceName("Contents", "json", subdirectory);
@@ -201,6 +213,14 @@ JSClass('UIApplication', UIResponder, {
201
213
  logger.info("Need user defaults");
202
214
  JSUserDefaults.shared.open(function UIApplication_userDefaultsDidOpen(){
203
215
  logger.info("User defaults opened");
216
+ JSUserDefaults.shared.registerDefaults({
217
+ UIUserInterfaceStyle: 0,
218
+ UIUserInterfaceContrast: 0
219
+ });
220
+ JSUserDefaults.shared.addObserverForKeyPath(this, "UIUserInterfaceStyle");
221
+ JSUserDefaults.shared.addObserverForKeyPath(this, "UIUserInterfaceContrast");
222
+ this.windowServer.userInterfaceStyle = JSUserDefaults.shared.UIUserInterfaceStyle;
223
+ this.windowServer.accessibilityContrast = JSUserDefaults.shared.UIUserInterfaceContrast;
204
224
  try{
205
225
  this._launch(completion, target);
206
226
  }catch (e){
@@ -245,6 +265,8 @@ JSClass('UIApplication', UIResponder, {
245
265
  this._stopCalled = true;
246
266
  logger.info("Stopping application");
247
267
  this.stopSystemNotifications();
268
+ JSUserDefaults.shared.removeObserverForKeyPath(this, "UIUserInterfaceStyle");
269
+ JSUserDefaults.shared.removeObserverForKeyPath(this, "UIUserInterfaceContrast");
248
270
  this.windowServer.stop(true);
249
271
  var closed = false;
250
272
  var _close = function(){
@@ -110,6 +110,7 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
110
110
  this.rootElement.style.userSelect = 'none';
111
111
  this.rootElement.style.mozUserSelect = 'none';
112
112
  this.rootElement.style.webkitUserSelect = 'none';
113
+ this.rootElement.style.forcedColorAdjust = 'none';
113
114
  },
114
115
 
115
116
  // --------------------------------------------------------------------
@@ -227,6 +228,9 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
227
228
  // --------------------------------------------------------------------
228
229
  // MARK: - Media Queries
229
230
 
231
+ darkColorSchemeQuery: null,
232
+ highContrastQuery: null,
233
+ reducedMotionQuery: null,
230
234
  darkColorSchemeListener: null,
231
235
  highContrastListener: null,
232
236
  reducedMotionListener: null,
@@ -252,14 +256,12 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
252
256
  },
253
257
 
254
258
  handleDarkColorSchemeChanged: function(query){
255
- var style = query.matches ? UIUserInterface.Style.dark : UIUserInterface.Style.light;
256
- this.traitCollection = this._traitCollection.traitsWithUserInterfaceStyle(style);
259
+ this.traitCollection = this._traitCollection.traitsWithUserInterfaceStyle(this.effectiveUserInterfaceStyle);
257
260
  this.updateThemeColorElement();
258
261
  },
259
262
 
260
263
  handleHighContrastChanged: function(query){
261
- var contrast = query.matches ? UIUserInterface.Contrast.high : UIUserInterface.Contrast.normal;
262
- this.traitCollection = this._traitCollection.traitsWithContrast(contrast);
264
+ this.traitCollection = this._traitCollection.traitsWithContrast(this.effectiveAccessibilityContrast);
263
265
  this.updateThemeColorElement();
264
266
  },
265
267
 
@@ -267,6 +269,14 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
267
269
  this.displayServer.reducedMotionEnabled = query.matches;
268
270
  },
269
271
 
272
+ getSystemUserInterfaceStyle: function(){
273
+ return this.darkColorSchemeQuery.matches ? UIUserInterface.Style.dark : UIUserInterface.Style.light;
274
+ },
275
+
276
+ getSystemAccessibilityContrast: function(){
277
+ return this.highContrastQuery.matches ? UIUserInterface.Contrast.high : UIUserInterface.Contrast.normal;
278
+ },
279
+
270
280
  // --------------------------------------------------------------------
271
281
  // MARK: - Mouse Events
272
282
 
@@ -40,6 +40,7 @@ JSClass("UIWindowServer", JSObject, {
40
40
  mouseLocation: null,
41
41
  fullKeyboardAccessEnabled: false,
42
42
  darkModeEnabled: true,
43
+ lightModeEnabled: true,
43
44
  _windowsById: null,
44
45
  _mouseIdleTimer: null,
45
46
  _tooltipWindow: null,
@@ -1033,9 +1034,6 @@ JSClass("UIWindowServer", JSObject, {
1033
1034
  traitCollection: JSDynamicProperty("_traitCollection", null),
1034
1035
 
1035
1036
  setTraitCollection: function(traitCollection){
1036
- if (!this.darkModeEnabled && traitCollection.userInterfaceStyle === UIUserInterface.Style.dark){
1037
- traitCollection = traitCollection.traitsWithUserInterfaceStyle(UIUserInterface.Style.light);
1038
- }
1039
1037
  if (this._traitCollection.isEqual(traitCollection)){
1040
1038
  return;
1041
1039
  }
@@ -1051,6 +1049,56 @@ JSClass("UIWindowServer", JSObject, {
1051
1049
  }
1052
1050
  },
1053
1051
 
1052
+ userInterfaceStyle: JSDynamicProperty("_userInterfaceStyle", UIUserInterface.Style.unspecified),
1053
+
1054
+ setUserInterfaceStyle: function(userInterfaceStyle){
1055
+ this._userInterfaceStyle = userInterfaceStyle;
1056
+ this.traitCollection = this._traitCollection.traitsWithUserInterfaceStyle(this.effectiveUserInterfaceStyle);
1057
+ },
1058
+
1059
+ effectiveUserInterfaceStyle: JSReadOnlyProperty(),
1060
+
1061
+ getEffectiveUserInterfaceStyle: function(){
1062
+ if (!this.darkModeEnabled){
1063
+ return UIUserInterface.Style.light;
1064
+ }
1065
+ if (!this.lightModeEnabled){
1066
+ return UIUserInterface.Style.dark;
1067
+ }
1068
+ if (this._userInterfaceStyle !== UIUserInterface.Style.unspecified){
1069
+ return this._userInterfaceStyle;
1070
+ }
1071
+ return this.systemUserInterfaceStyle;
1072
+ },
1073
+
1074
+ systemUserInterfaceStyle: JSReadOnlyProperty(),
1075
+
1076
+ getSystemUserInterfaceStyle: function(){
1077
+ return UIUserInterface.Style.light;
1078
+ },
1079
+
1080
+ accessibilityContrast: JSDynamicProperty("_accessibilityContrast", UIUserInterface.Contrast.unspecified),
1081
+
1082
+ setAccessibilityContrast: function(accessibilityContrast){
1083
+ this._accessibilityContrast = accessibilityContrast;
1084
+ this.traitCollection = this._traitCollection.traitsWithContrast(this.effectiveAccessibilityContrast);
1085
+ },
1086
+
1087
+ effectiveAccessibilityContrast: JSReadOnlyProperty(),
1088
+
1089
+ getEffectiveAccessibilityContrast: function(){
1090
+ if (this._accessibilityContrast !== UIUserInterface.Contrast.unspecified){
1091
+ return this._accessibilityContrast;
1092
+ }
1093
+ return this.systemAccessibilityContrast;
1094
+ },
1095
+
1096
+ systemAccessibilityContrast: JSReadOnlyProperty(),
1097
+
1098
+ getSystemAccessibilityContrast: function(){
1099
+ return UIUserInterface.Contrast.normal;
1100
+ },
1101
+
1054
1102
  _needsRedisplay: false,
1055
1103
 
1056
1104
  setNeedsRedisplay: function(){
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2024.25.0
3
+ JSBundleVersion: 2024.26.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2024.25.0",
12
+ "version": "2024.26.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"