@breakside/jskit 2023.3.1 → 2023.7.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/JS/Foundation.js +1 -0
- package/Frameworks/Foundation.jsframework/JS/JSAttributedString.js +3 -0
- package/Frameworks/Foundation.jsframework/JS/JSBundle+HTML.js +2 -1
- package/Frameworks/Foundation.jsframework/JS/JSDiff.js +99 -0
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/sources.json +2 -0
- 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/Node/jskit +1 -0
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Foundation.js +1 -0
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSAttributedString.js +3 -0
- package/Root/Frameworks/Foundation/JSBundle+HTML.js +2 -1
- package/Root/Frameworks/Foundation/JSDiff.js +99 -0
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/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/UIActivityIndicatorView.js +1 -1
- package/Root/Frameworks/UIKit/UIBrowserView.js +1 -1
- package/Root/Frameworks/UIKit/UIButton.js +2 -2
- package/Root/Frameworks/UIKit/UICollectionView.js +3 -3
- package/Root/Frameworks/UIKit/UIColorWell.js +6 -6
- package/Root/Frameworks/UIKit/UIDisplayServer.js +5 -1
- package/Root/Frameworks/UIKit/UIHTMLTextField.js +1 -1
- package/Root/Frameworks/UIKit/UILabel.js +1 -1
- package/Root/Frameworks/UIKit/UIListView.js +4 -4
- package/Root/Frameworks/UIKit/UIMenu.js +7 -7
- package/Root/Frameworks/UIKit/UINavigationBar.js +2 -2
- package/Root/Frameworks/UIKit/UIPopupButton.js +5 -5
- package/Root/Frameworks/UIKit/UIProgressIndicatorView.js +1 -1
- package/Root/Frameworks/UIKit/UISlider.js +6 -6
- package/Root/Frameworks/UIKit/UISplitView.js +9 -9
- package/Root/Frameworks/UIKit/UISplitViewController.js +3 -0
- package/Root/Frameworks/UIKit/UIStackView.js +1 -1
- package/Root/Frameworks/UIKit/UITabView.js +5 -5
- package/Root/Frameworks/UIKit/UITextField.js +3 -3
- package/Root/Frameworks/UIKit/UIToolbar.js +1 -1
- package/Root/Frameworks/UIKit/UIView.js +4 -4
- package/Root/Frameworks/UIKit/UIWindow.js +3 -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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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.
|
|
6
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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.
|
|
6
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
13
13
|
}
|
|
@@ -43,6 +43,9 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
43
43
|
},
|
|
44
44
|
|
|
45
45
|
initFromDictionary: function(dictionary){
|
|
46
|
+
if (dictionary === null || dictionary === undefined){
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
46
49
|
this._string = typeof(dictionary.string) === "string" ? dictionary.string : "";
|
|
47
50
|
this._runs = [];
|
|
48
51
|
var i, l;
|
|
@@ -29,8 +29,9 @@ JSBundle.definePropertiesFromExtensions({
|
|
|
29
29
|
var task = session.dataTaskWithURL(url, function(error){
|
|
30
30
|
if (error !== null || task.response.statusClass != JSURLResponse.StatusClass.success){
|
|
31
31
|
completion.call(target, null);
|
|
32
|
+
}else{
|
|
33
|
+
completion.call(target, task.response.data);
|
|
32
34
|
}
|
|
33
|
-
completion.call(target, task.response.data);
|
|
34
35
|
});
|
|
35
36
|
task.resume();
|
|
36
37
|
return completion.promise;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// #import "JSObject.js"
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
JSClass("JSDiff", JSObject, {
|
|
5
|
+
|
|
6
|
+
a: null,
|
|
7
|
+
b: null,
|
|
8
|
+
|
|
9
|
+
mapFunction: null,
|
|
10
|
+
|
|
11
|
+
initWithArrays: function(a, b, mapFunction){
|
|
12
|
+
this.a = a;
|
|
13
|
+
this.b = b;
|
|
14
|
+
if (mapFunction !== undefined){
|
|
15
|
+
this.mapFunction = mapFunction;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
initWithStrings: function(a, b){
|
|
20
|
+
this.initWithArrays(a, b);
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
commonIndexes: JSLazyInitProperty(function(){
|
|
24
|
+
var a = this.a;
|
|
25
|
+
var b = this.b;
|
|
26
|
+
if (this.mapFunction !== null){
|
|
27
|
+
a = a.map(this.mapFunction);
|
|
28
|
+
b = b.map(this.mapFunction);
|
|
29
|
+
}
|
|
30
|
+
return this.indexesOfLongestCommonSubsequence(a, 0, a.length - 1, b, 0, b.length - 1);
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
recursionCount: 0,
|
|
34
|
+
comparisonCount: 0,
|
|
35
|
+
|
|
36
|
+
indexesOfLongestCommonSubsequence: function(a, i0, i1, b, j0, j1){
|
|
37
|
+
++this.recursionCount;
|
|
38
|
+
if (i1 >= i0 && j1 >= j0){
|
|
39
|
+
++this.comparisonCount;
|
|
40
|
+
if (a[i0] === b[j0]){
|
|
41
|
+
var head = [];
|
|
42
|
+
++this.comparisonCount;
|
|
43
|
+
while (i1 >= i0 && j1 >= j0 && a[i0] === b[i0]){
|
|
44
|
+
head.push([i0, j0]);
|
|
45
|
+
++i0;
|
|
46
|
+
++j0;
|
|
47
|
+
++this.comparisonCount;
|
|
48
|
+
}
|
|
49
|
+
return head.concat(this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1));
|
|
50
|
+
}
|
|
51
|
+
++this.comparisonCount;
|
|
52
|
+
if (a[i1] === b[j1]){
|
|
53
|
+
var tail = [];
|
|
54
|
+
++this.comparisonCount;
|
|
55
|
+
while (i1 >= i0 && j1 >= j0 && a[i1] === b[j1]){
|
|
56
|
+
tail.unshift([i1, j1]);
|
|
57
|
+
--i1;
|
|
58
|
+
--j1;
|
|
59
|
+
++this.comparisonCount;
|
|
60
|
+
}
|
|
61
|
+
return this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1).concat(tail);
|
|
62
|
+
}
|
|
63
|
+
var sequence1 = this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1 - 1);
|
|
64
|
+
var sequence2 = this.indexesOfLongestCommonSubsequence(a, i0, i1 - 1, b, j0, j1);
|
|
65
|
+
if (sequence1.length >= sequence2.length){
|
|
66
|
+
return sequence1;
|
|
67
|
+
}
|
|
68
|
+
return sequence2;
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
operations: function(){
|
|
74
|
+
var a = [];
|
|
75
|
+
var b = [];
|
|
76
|
+
var i, l;
|
|
77
|
+
var j, k;
|
|
78
|
+
var commonIndexes = this.commonIndexes;
|
|
79
|
+
for (i = 0, l = a.length; i < l; ++i){
|
|
80
|
+
}
|
|
81
|
+
return [a, b];
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
longestCommonSubsequence: function(){
|
|
85
|
+
var commonIndexes = this.commonIndexes;
|
|
86
|
+
var sequence = [];
|
|
87
|
+
var i, l;
|
|
88
|
+
for (i = 0, l = commonIndexes.length; i < l; ++i){
|
|
89
|
+
sequence.push(this.a[commonIndexes[i][0]]);
|
|
90
|
+
}
|
|
91
|
+
return sequence;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
JSDiff.Operation = {
|
|
97
|
+
insert: 1,
|
|
98
|
+
delete: 2
|
|
99
|
+
};
|
|
@@ -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.
|
|
6
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [
|
|
17
17
|
{
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"JSUndoManager.js",
|
|
96
96
|
"JSDistributedNotificationCenter.js",
|
|
97
97
|
"JSSynchronizer.js",
|
|
98
|
+
"JSDiff.js",
|
|
98
99
|
"JSCRC32.js",
|
|
99
100
|
"JSZip.js",
|
|
100
101
|
"JSIterativeHash.js",
|
|
@@ -259,6 +260,7 @@
|
|
|
259
260
|
"JSUndoManager",
|
|
260
261
|
"JSDistributedNotificationCenter",
|
|
261
262
|
"JSSynchronizer",
|
|
263
|
+
"JSDiff",
|
|
262
264
|
"JSCRC32",
|
|
263
265
|
"JSZip",
|
|
264
266
|
"JSIterativeHash",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
4
|
-
"JSBundleVersion": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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.
|
|
6
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
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": "2023.
|
|
6
|
+
"JSBundleVersion": "2023.7.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": "d8b79e9503051e78994d724adf53b786a719d8b4"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
package/Node/jskit
CHANGED
|
@@ -96,6 +96,7 @@ require("./../Frameworks/Foundation.jsframework/JS/JSUserDefaults.js");
|
|
|
96
96
|
require("./../Frameworks/Foundation.jsframework/JS/JSUndoManager.js");
|
|
97
97
|
require("./../Frameworks/Foundation.jsframework/JS/JSDistributedNotificationCenter.js");
|
|
98
98
|
require("./../Frameworks/Foundation.jsframework/JS/JSSynchronizer.js");
|
|
99
|
+
require("./../Frameworks/Foundation.jsframework/JS/JSDiff.js");
|
|
99
100
|
require("./../Frameworks/Foundation.jsframework/JS/JSCRC32.js");
|
|
100
101
|
require("./../Frameworks/Foundation.jsframework/JS/JSZip.js");
|
|
101
102
|
require("./../Frameworks/Foundation.jsframework/JS/JSIterativeHash.js");
|
|
@@ -43,6 +43,9 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
43
43
|
},
|
|
44
44
|
|
|
45
45
|
initFromDictionary: function(dictionary){
|
|
46
|
+
if (dictionary === null || dictionary === undefined){
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
46
49
|
this._string = typeof(dictionary.string) === "string" ? dictionary.string : "";
|
|
47
50
|
this._runs = [];
|
|
48
51
|
var i, l;
|
|
@@ -29,8 +29,9 @@ JSBundle.definePropertiesFromExtensions({
|
|
|
29
29
|
var task = session.dataTaskWithURL(url, function(error){
|
|
30
30
|
if (error !== null || task.response.statusClass != JSURLResponse.StatusClass.success){
|
|
31
31
|
completion.call(target, null);
|
|
32
|
+
}else{
|
|
33
|
+
completion.call(target, task.response.data);
|
|
32
34
|
}
|
|
33
|
-
completion.call(target, task.response.data);
|
|
34
35
|
});
|
|
35
36
|
task.resume();
|
|
36
37
|
return completion.promise;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// #import "JSObject.js"
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
JSClass("JSDiff", JSObject, {
|
|
5
|
+
|
|
6
|
+
a: null,
|
|
7
|
+
b: null,
|
|
8
|
+
|
|
9
|
+
mapFunction: null,
|
|
10
|
+
|
|
11
|
+
initWithArrays: function(a, b, mapFunction){
|
|
12
|
+
this.a = a;
|
|
13
|
+
this.b = b;
|
|
14
|
+
if (mapFunction !== undefined){
|
|
15
|
+
this.mapFunction = mapFunction;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
initWithStrings: function(a, b){
|
|
20
|
+
this.initWithArrays(a, b);
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
commonIndexes: JSLazyInitProperty(function(){
|
|
24
|
+
var a = this.a;
|
|
25
|
+
var b = this.b;
|
|
26
|
+
if (this.mapFunction !== null){
|
|
27
|
+
a = a.map(this.mapFunction);
|
|
28
|
+
b = b.map(this.mapFunction);
|
|
29
|
+
}
|
|
30
|
+
return this.indexesOfLongestCommonSubsequence(a, 0, a.length - 1, b, 0, b.length - 1);
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
recursionCount: 0,
|
|
34
|
+
comparisonCount: 0,
|
|
35
|
+
|
|
36
|
+
indexesOfLongestCommonSubsequence: function(a, i0, i1, b, j0, j1){
|
|
37
|
+
++this.recursionCount;
|
|
38
|
+
if (i1 >= i0 && j1 >= j0){
|
|
39
|
+
++this.comparisonCount;
|
|
40
|
+
if (a[i0] === b[j0]){
|
|
41
|
+
var head = [];
|
|
42
|
+
++this.comparisonCount;
|
|
43
|
+
while (i1 >= i0 && j1 >= j0 && a[i0] === b[i0]){
|
|
44
|
+
head.push([i0, j0]);
|
|
45
|
+
++i0;
|
|
46
|
+
++j0;
|
|
47
|
+
++this.comparisonCount;
|
|
48
|
+
}
|
|
49
|
+
return head.concat(this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1));
|
|
50
|
+
}
|
|
51
|
+
++this.comparisonCount;
|
|
52
|
+
if (a[i1] === b[j1]){
|
|
53
|
+
var tail = [];
|
|
54
|
+
++this.comparisonCount;
|
|
55
|
+
while (i1 >= i0 && j1 >= j0 && a[i1] === b[j1]){
|
|
56
|
+
tail.unshift([i1, j1]);
|
|
57
|
+
--i1;
|
|
58
|
+
--j1;
|
|
59
|
+
++this.comparisonCount;
|
|
60
|
+
}
|
|
61
|
+
return this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1).concat(tail);
|
|
62
|
+
}
|
|
63
|
+
var sequence1 = this.indexesOfLongestCommonSubsequence(a, i0, i1, b, j0, j1 - 1);
|
|
64
|
+
var sequence2 = this.indexesOfLongestCommonSubsequence(a, i0, i1 - 1, b, j0, j1);
|
|
65
|
+
if (sequence1.length >= sequence2.length){
|
|
66
|
+
return sequence1;
|
|
67
|
+
}
|
|
68
|
+
return sequence2;
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
operations: function(){
|
|
74
|
+
var a = [];
|
|
75
|
+
var b = [];
|
|
76
|
+
var i, l;
|
|
77
|
+
var j, k;
|
|
78
|
+
var commonIndexes = this.commonIndexes;
|
|
79
|
+
for (i = 0, l = a.length; i < l; ++i){
|
|
80
|
+
}
|
|
81
|
+
return [a, b];
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
longestCommonSubsequence: function(){
|
|
85
|
+
var commonIndexes = this.commonIndexes;
|
|
86
|
+
var sequence = [];
|
|
87
|
+
var i, l;
|
|
88
|
+
for (i = 0, l = commonIndexes.length; i < l; ++i){
|
|
89
|
+
sequence.push(this.a[commonIndexes[i][0]]);
|
|
90
|
+
}
|
|
91
|
+
return sequence;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
JSDiff.Operation = {
|
|
97
|
+
insert: 1,
|
|
98
|
+
delete: 2
|
|
99
|
+
};
|