@dualbox/editor 1.0.91 → 1.0.93
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/html/editor.html +24 -14
- package/js/dist/GraphEditor.js +493 -137
- package/js/dist/GraphEditor.min.js +492 -136
- package/js/src/GraphEditor.js +140 -22
- package/js/src/c/GraphController.js +4 -4
- package/js/src/m/GraphModel.js +12 -9
- package/js/src/v/templates/addNode.vue +17 -21
- package/package.json +2 -1
package/html/editor.html
CHANGED
|
@@ -133,21 +133,28 @@
|
|
|
133
133
|
showLoadButton: true,
|
|
134
134
|
showSaveButton: true,
|
|
135
135
|
|
|
136
|
+
packages: packages,
|
|
137
|
+
|
|
138
|
+
// non-necessary if packages are passed
|
|
136
139
|
search: function(text, cb) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
if (!text || text.length == 0) {
|
|
141
|
+
cb(null, packages);
|
|
142
|
+
} else {
|
|
143
|
+
var options = {
|
|
144
|
+
shouldSort: true,
|
|
145
|
+
threshold: 0.6,
|
|
146
|
+
location: 0,
|
|
147
|
+
distance: 100,
|
|
148
|
+
maxPatternLength: 32,
|
|
149
|
+
minMatchCharLength: 1,
|
|
150
|
+
tokenize: true,
|
|
151
|
+
matchAllTokens: true,
|
|
152
|
+
keys: ["name", "description"]
|
|
153
|
+
};
|
|
154
|
+
var fuse = new Fuse(packages, options); // "list" is the item array
|
|
155
|
+
var result = fuse.search(text);
|
|
156
|
+
cb(null, result);
|
|
157
|
+
}
|
|
151
158
|
},
|
|
152
159
|
|
|
153
160
|
find: function(name, version, cb) {
|
|
@@ -159,6 +166,9 @@
|
|
|
159
166
|
}
|
|
160
167
|
}
|
|
161
168
|
});
|
|
169
|
+
window.editor.onChange((diff, hash) => {
|
|
170
|
+
console.log("saving (new hash " + hash + ")");
|
|
171
|
+
});
|
|
162
172
|
|
|
163
173
|
// For debug purpose
|
|
164
174
|
window.getApp = function() {
|