@dualbox/editor 1.0.64 → 1.0.65

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.
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
1
+ import _ from "lodash-es";
2
2
 
3
3
  import GraphModel from "./m/GraphModel";
4
4
  import GraphView from "./v/GraphView";
@@ -3,7 +3,7 @@
3
3
  * Every change in the application starts here.
4
4
  */
5
5
 
6
- import _ from 'lodash';
6
+ import _ from 'lodash-es';
7
7
  import utils from '../m/DualboxUtils';
8
8
  import swal from 'sweetalert2';
9
9
  import Merger from '../m/Merger';
@@ -5,7 +5,7 @@
5
5
  import History from './History';
6
6
  import AppParser from '@dualbox/dualbox-lib-appparser';
7
7
  import utils from './DualboxUtils';
8
- import _ from 'lodash';
8
+ import _ from 'lodash-es';
9
9
  import idx from 'idx';
10
10
  import swal from 'sweetalert2';
11
11
 
@@ -204,9 +204,12 @@ class GraphModel {
204
204
 
205
205
  // save changes into history
206
206
  save() {
207
- let { diff, hash } = this.history.save();
208
- if (this.onChangeCb) {
209
- this.onChangeCb(diff);
207
+ let diffChange = this.history.save();
208
+ if (diffChange && diffChange.diff && diffChange.hash) {
209
+ let { diff, hash } = diffChange;
210
+ if (this.onChangeCb) {
211
+ this.onChangeCb(diff, hash);
212
+ }
210
213
  }
211
214
  }
212
215
 
@@ -3,14 +3,27 @@
3
3
  * Manages the different states of the model and is able to restore them
4
4
  */
5
5
 
6
- import _ from 'lodash';
7
- import crypto from 'crypto';
6
+ import _ from 'lodash-es';
7
+
8
+ String.prototype.hashCode = function() {
9
+ var hash = 0,
10
+ i, chr;
11
+ if (this.length === 0) return hash;
12
+ for (i = 0; i < this.length; i++) {
13
+ chr = this.charCodeAt(i);
14
+ hash = ((hash << 5) - hash) + chr;
15
+ hash |= 0; // Convert to 32bit integer
16
+ }
17
+ return hash;
18
+ };
8
19
 
9
20
  var hash = function(json) {
10
- var str = JSON.stringify(json);
11
- var shasum = crypto.createHash('sha1');
12
- shasum.update(str);
13
- return shasum.digest('hex');
21
+ if (json) {
22
+ var str = JSON.stringify(json);
23
+ return str.hashCode();
24
+ } else {
25
+ return null;
26
+ }
14
27
  }
15
28
 
16
29
  var patcher = window.jsondiffpatch.create(); // must be declared in window
@@ -4,7 +4,7 @@
4
4
  * needed to preserve the actual app behavior
5
5
  */
6
6
 
7
- import _ from 'lodash';
7
+ import _ from 'lodash-es';
8
8
  import utils from './DualboxUtils';
9
9
 
10
10
  class Merger {
@@ -2,7 +2,7 @@
2
2
  * This object is in charge of managing the application state
3
3
  */
4
4
 
5
- import _ from 'lodash';
5
+ import _ from 'lodash-es';
6
6
 
7
7
  class AppManager {
8
8
  constructor(view, div) {
@@ -3,7 +3,7 @@
3
3
  * when called with the dragging() method
4
4
  */
5
5
 
6
- import _ from 'lodash';
6
+ import _ from 'lodash-es';
7
7
 
8
8
  var editorView = null;
9
9
  $.fn.savePosition = function(selector) {
@@ -3,7 +3,7 @@
3
3
  * Everything related to display should be here
4
4
  */
5
5
 
6
- import _ from 'lodash';
6
+ import _ from 'lodash-es';
7
7
  import swal from 'sweetalert2';
8
8
 
9
9
  // Manage the start/stop lifetime of the application
@@ -1,4 +1,4 @@
1
- import _ from 'lodash';
1
+ import _ from 'lodash-es';
2
2
 
3
3
  class Translater {
4
4
  constructor(parent, container, canvas) {
@@ -56,7 +56,7 @@
56
56
  </template>
57
57
 
58
58
  <script>
59
- import _ from 'lodash';
59
+ import _ from 'lodash-es';
60
60
  import swal from 'sweetalert2';
61
61
 
62
62
  export default {
@@ -276,7 +276,7 @@ fieldset {
276
276
  </template>
277
277
 
278
278
  <script>
279
- import _ from 'lodash';
279
+ import _ from 'lodash-es';
280
280
  import swal from 'sweetalert2';
281
281
  import SearchResultsVue from './searchResults.vue';
282
282
  import DisplayResultVue from './displayResult.vue';
@@ -228,7 +228,7 @@
228
228
  </template>
229
229
 
230
230
  <script>
231
- import _ from 'lodash';
231
+ import _ from 'lodash-es';
232
232
  import moment from 'moment';
233
233
 
234
234
  import DisplayValueVue from './displayValue.vue';
@@ -114,7 +114,7 @@
114
114
  </template>
115
115
 
116
116
  <script>
117
- import _ from 'lodash';
117
+ import _ from 'lodash-es';
118
118
  import GraphNodeVue from './graphNode.vue';
119
119
  import dbutils from '../../m/DualboxUtils';
120
120
 
@@ -372,7 +372,7 @@ i.fa, i.fas, i.far {
372
372
  </template>
373
373
 
374
374
  <script>
375
- import _ from 'lodash';
375
+ import _ from 'lodash-es';
376
376
  import swal from 'sweetalert2';
377
377
  import DisplayTypeVue from './displayType.vue';
378
378
  import DisplayValueVue from './displayValue.vue';
@@ -587,7 +587,7 @@
587
587
  </template>
588
588
 
589
589
  <script>
590
- import _ from 'lodash';
590
+ import _ from 'lodash-es';
591
591
  import DisplayTypeVue from './displayType.vue';
592
592
  import DisplayValueVue from './displayValue.vue';
593
593
  import GraphNodeVue from './graphNode.vue';
@@ -45,7 +45,7 @@
45
45
  </template>
46
46
 
47
47
  <script>
48
- import _ from 'lodash';
48
+ import _ from 'lodash-es';
49
49
 
50
50
  // including bootstrap-select doesn't work
51
51
  // made a PR for this: see https://github.com/snapappointments/bootstrap-select/issues/2374
@@ -62,7 +62,7 @@
62
62
  </template>
63
63
 
64
64
  <script>
65
- import _ from 'lodash';
65
+ import _ from 'lodash-es';
66
66
  import swal from 'sweetalert2';
67
67
  import JSONEditor from '@dualbox/dualbox-lib-jsoneditor';
68
68
 
@@ -124,7 +124,7 @@
124
124
 
125
125
  <script>
126
126
  // Utils
127
- import _ from 'lodash';
127
+ import _ from 'lodash-es';
128
128
  import dbutils from '../../m/DualboxUtils';
129
129
  import Utils from '../Utils';
130
130
  import swal from 'sweetalert2';
@@ -468,7 +468,7 @@ span.name {
468
468
 
469
469
  <script>
470
470
  import ContextMenu from '../ContextMenu';
471
- import _ from 'lodash';
471
+ import _ from 'lodash-es';
472
472
  import dbutils from '../../m/DualboxUtils';
473
473
 
474
474
  // fix inputs types and output types position relatively to the div
@@ -566,7 +566,7 @@ button.close {
566
566
  </template>
567
567
 
568
568
  <script>
569
- import _ from 'lodash';
569
+ import _ from 'lodash-es';
570
570
  import swal from 'sweetalert2';
571
571
 
572
572
  import graphVue from './graph.vue';
@@ -64,7 +64,7 @@
64
64
  </template>
65
65
 
66
66
  <script>
67
- import _ from 'lodash';
67
+ import _ from 'lodash-es';
68
68
  import swal from 'sweetalert2';
69
69
 
70
70
  export default {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dualbox/editor",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "Editor of Dualbox apps",
5
5
  "browser": "js/dist/GraphEditor.js",
6
6
  "main": "js/dist/GraphEditor.js",
@@ -22,7 +22,10 @@
22
22
  "rollup-plugin-commonjs": "10.0.0",
23
23
  "rollup-plugin-embed-css": "0.4.0",
24
24
  "rollup-plugin-eslint": "6.0.0",
25
+ "rollup-plugin-json": "^4.0.0",
25
26
  "rollup-plugin-less": "1.1.2",
27
+ "rollup-plugin-node-builtins": "^2.1.2",
28
+ "rollup-plugin-node-globals": "^1.4.0",
26
29
  "rollup-plugin-node-resolve": "5.0.1",
27
30
  "rollup-plugin-replace": "2.2.0",
28
31
  "rollup-plugin-vue": "5.0.0"
@@ -48,9 +51,9 @@
48
51
  "jsoneditor": "^5.27.0",
49
52
  "jsplumb": "2.10.0",
50
53
  "lodash": "^4.17.5",
54
+ "lodash-es": "^4.17.15",
51
55
  "moment": "^2.22.2",
52
56
  "object-hash": "^2.0.2",
53
- "rollup-plugin-node-builtins": "2.1.2",
54
57
  "rollup-plugin-postcss": "2.0.3",
55
58
  "sweetalert2": "^7.19.3",
56
59
  "vue": "2.6.10",