@breakside/jskit 2023.17.0 → 2023.18.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 (44) 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/JSBundle.js +16 -1
  7. package/Frameworks/Foundation.jsframework/JS/JSImage.js +13 -2
  8. package/Frameworks/Foundation.jsframework/JS/JSXMLParser.js +13 -5
  9. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  10. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  11. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  12. package/Info.json +2 -2
  13. package/Node/Resources.js +1 -10
  14. package/Node/io.breakside.jskit-bundle.js +2 -2
  15. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  16. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  17. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  18. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  19. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  20. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  21. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  22. package/Root/Frameworks/DOM/Info.yaml +1 -1
  23. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  24. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  25. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  26. package/Root/Frameworks/Foundation/JSBundle.js +16 -1
  27. package/Root/Frameworks/Foundation/JSImage.js +13 -2
  28. package/Root/Frameworks/Foundation/JSXMLParser.js +13 -5
  29. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  30. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  31. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  32. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  33. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  34. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  35. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  36. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  37. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  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/UIKit/UIHTMLOpenPanel.js +17 -3
  42. package/Root/Frameworks/UIKit/UIWindowServer.js +3 -3
  43. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  44. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2023.17.0",
4
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
12
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
6
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
14
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
4
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
11
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
6
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
13
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
4
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
12
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
13
13
  }
@@ -16,8 +16,13 @@
16
16
  // #import "JSObject.js"
17
17
  // #import "JSLocale.js"
18
18
  // #import "JSFile.js"
19
+ // #import "JSLog.js"
19
20
  'use strict';
20
21
 
22
+ (function(){
23
+
24
+ var logger = JSLog("foundation", "bundle");
25
+
21
26
  JSClass('JSBundle', JSObject, {
22
27
 
23
28
  _dict: null,
@@ -252,6 +257,14 @@ JSClass('JSBundle', JSObject, {
252
257
  if (metadata !== null){
253
258
  return metadata.strings[key];
254
259
  }
260
+ var langs;
261
+ if (locale){
262
+ langs = this._getSupportedLanguagesForLocaleIdentifiers([locale.identifier]);
263
+ }else{
264
+ this._updateSupportedUserLanguagesIfNeeded();
265
+ langs = this._supportedPreferredLanguages;
266
+ }
267
+ logger.warn("Missing localization key '%{public}' in %{public} for %{public}", key, table, langs.join(","));
255
268
  return key;
256
269
  },
257
270
 
@@ -312,4 +325,6 @@ Object.defineProperty(JSBundle, 'mainBundle', {
312
325
  });
313
326
  return bundle;
314
327
  }
315
- });
328
+ });
329
+
330
+ })();
@@ -314,8 +314,19 @@ JSImage.contentTypeOfData = function(data){
314
314
  return JSMediaType("image/png");
315
315
  }else if (data.length > 2 && data[0] == 0xFF && data[1] == 0xD8){
316
316
  return JSMediaType("image/jpeg");
317
- }else if (data.length > 5 && data[0] == 0x3C && data[1] == 0x3F && data[2] == 0x78 && data[3] == 0x6D && data[4] == 0x6C){
318
- return JSMediaType("image/svg+xml");
317
+ }else if (data.length > 0 && data[0] == 0x3C){
318
+ var parser = JSXMLParser.initWithData(data);
319
+ var contentType = null;
320
+ parser.delegate = {
321
+ xmlParserDidBeginElement: function(parser, name, prefix, namespace, attributes){
322
+ if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
323
+ contentType = JSMediaType("image/svg+xml");
324
+ }
325
+ parser.stop();
326
+ }
327
+ };
328
+ parser.parse();
329
+ return contentType;
319
330
  }
320
331
  return null;
321
332
  };
@@ -362,13 +362,21 @@ JSClass("JSXMLParser", JSObject, {
362
362
  var obj;
363
363
  if (isHTML){
364
364
  readWhitespace();
365
- }else{
366
- obj = readObject();
367
- if (obj === null || obj.kind != 'PI' || obj.name != 'xml'){
368
- throw new Error("Expecting <?xml at start of document");
369
- }
370
365
  }
371
366
  obj = readObject();
367
+ if (!isHTML){
368
+ if (obj === null){
369
+ throw new Error("Expecting XML prolog or root element");
370
+ }
371
+ if (obj.kind === "PI"){
372
+ if (obj.name != 'xml'){
373
+ throw new Error("Expecting XML prolog");
374
+ }
375
+ obj = readObject();
376
+ }else if (obj.kind !== "ElementStart"){
377
+ throw new Error("Expecting XML root element");
378
+ }
379
+ }
372
380
  var elementStack = [];
373
381
  var namespaces = {
374
382
  ':default:': null,
@@ -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": "2023.17.0",
6
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
14
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
4
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
12
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
6
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
14
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
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": "2023.17.0",
4
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
11
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
12
12
  }
package/Node/Resources.js CHANGED
@@ -370,19 +370,10 @@ var addMetadata = {
370
370
  },
371
371
 
372
372
  '.svg': async function(name, contents, metadata){
373
- var xml = contents.stringByDecodingUTF8();
374
- // SVG icons from fontawesome don't start with xml prologue, so
375
- // add one if it looks to be missing
376
- if (xml.startsWith("<svg ")){
377
- xml = '<?xml version="1.0" encoding="utf-8"?>\n' + xml;
378
- }
379
- if (!xml.startsWith("<?xml")){
380
- return;
381
- }
382
373
  metadata.image = {
383
374
  vector: true
384
375
  };
385
- var parser = JSXMLParser.initWithString(xml);
376
+ var parser = JSXMLParser.initWithData(contents);
386
377
  parser.delegate = {
387
378
  xmlParserDidBeginElement: function(parser, name, prefix, namespace, attributes){
388
379
  var multiple = {
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "node",
5
5
  "JSBundleIdentifier": "io.breakside.jskit",
6
- "JSBundleVersion": "2023.17.0",
6
+ "JSBundleVersion": "2023.18.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": "b6b8131cccead289633700d72d78d5bd4769a8ab"
13
+ "GitRevision": "e7355f52684cb42e4f6903552340ad3fd8e3e502"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -16,8 +16,13 @@
16
16
  // #import "JSObject.js"
17
17
  // #import "JSLocale.js"
18
18
  // #import "JSFile.js"
19
+ // #import "JSLog.js"
19
20
  'use strict';
20
21
 
22
+ (function(){
23
+
24
+ var logger = JSLog("foundation", "bundle");
25
+
21
26
  JSClass('JSBundle', JSObject, {
22
27
 
23
28
  _dict: null,
@@ -252,6 +257,14 @@ JSClass('JSBundle', JSObject, {
252
257
  if (metadata !== null){
253
258
  return metadata.strings[key];
254
259
  }
260
+ var langs;
261
+ if (locale){
262
+ langs = this._getSupportedLanguagesForLocaleIdentifiers([locale.identifier]);
263
+ }else{
264
+ this._updateSupportedUserLanguagesIfNeeded();
265
+ langs = this._supportedPreferredLanguages;
266
+ }
267
+ logger.warn("Missing localization key '%{public}' in %{public} for %{public}", key, table, langs.join(","));
255
268
  return key;
256
269
  },
257
270
 
@@ -312,4 +325,6 @@ Object.defineProperty(JSBundle, 'mainBundle', {
312
325
  });
313
326
  return bundle;
314
327
  }
315
- });
328
+ });
329
+
330
+ })();
@@ -314,8 +314,19 @@ JSImage.contentTypeOfData = function(data){
314
314
  return JSMediaType("image/png");
315
315
  }else if (data.length > 2 && data[0] == 0xFF && data[1] == 0xD8){
316
316
  return JSMediaType("image/jpeg");
317
- }else if (data.length > 5 && data[0] == 0x3C && data[1] == 0x3F && data[2] == 0x78 && data[3] == 0x6D && data[4] == 0x6C){
318
- return JSMediaType("image/svg+xml");
317
+ }else if (data.length > 0 && data[0] == 0x3C){
318
+ var parser = JSXMLParser.initWithData(data);
319
+ var contentType = null;
320
+ parser.delegate = {
321
+ xmlParserDidBeginElement: function(parser, name, prefix, namespace, attributes){
322
+ if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
323
+ contentType = JSMediaType("image/svg+xml");
324
+ }
325
+ parser.stop();
326
+ }
327
+ };
328
+ parser.parse();
329
+ return contentType;
319
330
  }
320
331
  return null;
321
332
  };
@@ -362,13 +362,21 @@ JSClass("JSXMLParser", JSObject, {
362
362
  var obj;
363
363
  if (isHTML){
364
364
  readWhitespace();
365
- }else{
366
- obj = readObject();
367
- if (obj === null || obj.kind != 'PI' || obj.name != 'xml'){
368
- throw new Error("Expecting <?xml at start of document");
369
- }
370
365
  }
371
366
  obj = readObject();
367
+ if (!isHTML){
368
+ if (obj === null){
369
+ throw new Error("Expecting XML prolog or root element");
370
+ }
371
+ if (obj.kind === "PI"){
372
+ if (obj.name != 'xml'){
373
+ throw new Error("Expecting XML prolog");
374
+ }
375
+ obj = readObject();
376
+ }else if (obj.kind !== "ElementStart"){
377
+ throw new Error("Expecting XML root element");
378
+ }
379
+ }
372
380
  var elementStack = [];
373
381
  var namespaces = {
374
382
  ':default:': null,
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.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: 2023.17.0
3
+ JSBundleVersion: 2023.18.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -25,8 +25,14 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
25
25
  },
26
26
 
27
27
  show: function(action, target){
28
- var fileInput = document.createElement('input');
28
+ if (UIHTMLOpenPanel.fileInput !== null){
29
+ UIHTMLOpenPanel.fileInput.parentNode.removeChild(UIHTMLOpenPanel.fileInput);
30
+ }
31
+ UIHTMLOpenPanel.fileInput = document.createElement('input');
32
+ var fileInput = UIHTMLOpenPanel.fileInput;
29
33
  fileInput.type = 'file';
34
+ fileInput.style.display = 'none';
35
+ document.body.appendChild(fileInput);
30
36
  if (this.allowsMultipleSelection){
31
37
  fileInput.multiple = true;
32
38
  }
@@ -38,7 +44,7 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
38
44
  }
39
45
  }
40
46
  var panel = this;
41
- fileInput.onchange = function(){
47
+ fileInput.addEventListener("change", function(){
42
48
  if (panel.allowsMultipleSelection || panel.chooseDirectories){
43
49
  if (fileInput.webkitEntries && fileInput.webkitEntries.length > 0){
44
50
  panel._fileEnumerator = JSHTMLFileSystemEntryFileEnumerator.initWithHTMLEntries(fileInput.webkitEntries);
@@ -51,12 +57,20 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
51
57
  }
52
58
  }
53
59
  action.call(target, panel);
54
- };
60
+ fileInput.parentNode.removeChild(fileInput);
61
+ UIHTMLOpenPanel.fileInput = null;
62
+ });
63
+ fileInput.addEventListener("cancel", function(){
64
+ fileInput.parentNode.removeChild(fileInput);
65
+ UIHTMLOpenPanel.fileInput = null;
66
+ });
55
67
  fileInput.click();
56
68
  }
57
69
 
58
70
  });
59
71
 
72
+ UIHTMLOpenPanel.fileInput = null;
73
+
60
74
  UIOpenPanel.definePropertiesFromExtensions({
61
75
  init: function(){
62
76
  return UIHTMLOpenPanel.init();
@@ -414,7 +414,7 @@ JSClass("UIWindowServer", JSObject, {
414
414
  var view = null;
415
415
  if (window !== null){
416
416
  view = window.hitTest(window.convertPointFromScreen(this.mouseLocation));
417
- while (view !== null && view.tooltip === null){
417
+ while (view !== null && (view.tooltip === null || view.tooltip === "")){
418
418
  view = view.superview;
419
419
  }
420
420
  if (view === this._tooltipSourceView){
@@ -705,10 +705,10 @@ JSClass("UIWindowServer", JSObject, {
705
705
  var window = this.windowForEventAtLocation(this.mouseLocation);
706
706
  if (window !== null){
707
707
  var view = window.hitTest(window.convertPointFromScreen(this.mouseLocation));
708
- while (view !== null && view.tooltip === null){
708
+ while (view !== null && (view.tooltip === null || view.tooltip === "")){
709
709
  view = view.superview;
710
710
  }
711
- if (view !== null && view.tooltip !== null){
711
+ if (view !== null && view.tooltip !== null && view.tooltip !== ""){
712
712
  this.showTooltipForView(view, this.mouseLocation);
713
713
  }
714
714
  }
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2023.17.0
3
+ JSBundleVersion: 2023.18.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": "2023.17.0",
12
+ "version": "2023.18.0",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"