@breakside/jskit 2024.25.1 → 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.
- 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/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/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/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/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIApplication.js +22 -0
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +14 -4
- package/Root/Frameworks/UIKit/UIWindowServer.js +51 -3
- 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": "2024.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
12
|
+
"GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
|
|
13
13
|
}
|
|
@@ -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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
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.
|
|
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": "
|
|
13
|
+
"GitRevision": "ea323d2d9be65a7a5010b4f8d00ddbf84f293fd7"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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(){
|