@cocreate/crdt 1.8.18 → 1.8.22

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/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## [1.8.22](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.8.21...v1.8.22) (2021-11-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update dependencies ([e4f1d13](https://github.com/CoCreate-app/CoCreate-crdt/commit/e4f1d136b47f11120a61ddaa91dd782cdd42ab5d))
7
+
8
+ ## [1.8.21](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.8.20...v1.8.21) (2021-11-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * await generateText ([917dd9a](https://github.com/CoCreate-app/CoCreate-crdt/commit/917dd9acdeae8b6dc9185aa2049dd28b0337e3eb))
14
+
15
+ ## [1.8.20](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.8.19...v1.8.20) (2021-11-22)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * if crud or save will not save to crud ([b8f51ac](https://github.com/CoCreate-app/CoCreate-crdt/commit/b8f51ac606fc3d1894404ef8ec82c3895b16d6cc))
21
+
22
+ ## [1.8.19](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.8.18...v1.8.19) (2021-11-20)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * updated script tags and link tags ([6618c3a](https://github.com/CoCreate-app/CoCreate-crdt/commit/6618c3a265d348e6c2c8ba046a426509cb0ad03d))
28
+
1
29
  ## [1.8.18](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.8.17...v1.8.18) (2021-11-20)
2
30
 
3
31
 
package/docs/index.html CHANGED
@@ -13,13 +13,6 @@
13
13
  <!-- CoCreate CSS -->
14
14
  <link rel="stylesheet" href="https://cdn.cocreate.app/latest/CoCreate.min.css" type="text/css" />
15
15
 
16
- <!-- Font Awesome -->
17
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" crossorigin="anonymous" />
18
-
19
- <!-- Codemirror -->
20
- <link rel="stylesheet" href="https://server.cocreate.app/CoCreate-plugins/CoCreate-codemirror/src/CoCreate-codemirror.css" type="text/css" />
21
- <link rel=stylesheet href="https://codemirror.net/lib/codemirror.css" async defer>
22
-
23
16
  <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/themes/prism.min.css" rel="stylesheet" />
24
17
  </head>
25
18
 
@@ -120,21 +113,8 @@
120
113
 
121
114
  </div>
122
115
  </div>
123
- <script>
124
- var config = {
125
- apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
126
- securityKey: 'f26baf68-e3a9-45fc-effe-502e47116265',
127
- organization_Id: '5de0387b12e200ea63204d6c'
128
- }
129
- </script>
130
-
131
- <!--CoCreateJS-->
132
- <script src="https://cdn.cocreate.app/latest/CoCreate.min.js"></script>
133
-
134
- <!-- CoCreate CodeMiirror -->
135
- <script type="text/javascript" src="https://server.cocreate.app/CoCreate-plugins/CoCreate-codemirror/dist/CoCreate-codemirror.js" async></script>
136
-
137
- <!-- Prism -->
138
- <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/prism.min.js"></script>
116
+
117
+ <script src="/apikey.js"></script>
118
+ <script src="https://cdn.cocreate.app/latest/CoCreate.min.js" ></script>
139
119
  </body>
140
120
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crdt",
3
- "version": "1.8.18",
3
+ "version": "1.8.22",
4
4
  "description": "CoCreate crdt",
5
5
  "author": "CoCreate LLC",
6
6
  "license": "SEE LICENSE",
@@ -43,9 +43,9 @@
43
43
  "webpack-log": "^3.0.1"
44
44
  },
45
45
  "dependencies": {
46
- "@cocreate/action": "^1.3.15",
47
- "@cocreate/crud-client": "^1.4.29",
48
- "@cocreate/message-client": "^1.1.49",
49
- "@cocreate/utils": "^1.3.10"
46
+ "@cocreate/action": "^1.3.17",
47
+ "@cocreate/crud-client": "^1.4.33",
48
+ "@cocreate/message-client": "^1.1.51",
49
+ "@cocreate/utils": "^1.3.11"
50
50
  }
51
51
  }
package/src/index.js CHANGED
@@ -52,7 +52,9 @@ async function getDoc(info) {
52
52
  docs.get(docName).get(typeName).set('changeLog', changeLog);
53
53
  }
54
54
  }
55
- generateText(info);
55
+ }
56
+ if (!docs.get(docName).get(typeName).has('text')){
57
+ await generateText(info);
56
58
  }
57
59
  return true;
58
60
  }
@@ -75,7 +77,8 @@ async function generateText(info) {
75
77
  }
76
78
  name.set('text', string);
77
79
  if (string == '' && info.read != 'false')
78
- checkDb(info);
80
+ await checkDb(info);
81
+ return;
79
82
  }
80
83
  catch (e) {
81
84
  console.error(e);
@@ -92,6 +95,7 @@ function checkDb(info) {
92
95
  info.start = 0;
93
96
  insertChange(info);
94
97
  }
98
+ return;
95
99
  });
96
100
  }
97
101
 
@@ -228,7 +232,8 @@ async function getText(info) {
228
232
  let typeName = info.name;
229
233
  let doc = await getDoc(info);
230
234
  if (doc) {
231
- return docs.get(docName).get(typeName).get('text');
235
+ let value = docs.get(docName).get(typeName).get('text')
236
+ return value;
232
237
  }
233
238
  }
234
239
  catch (e) {
@@ -286,7 +291,7 @@ async function updateText(info, flag) {
286
291
 
287
292
  insertChange(info, broadcast, flag);
288
293
 
289
- if (info.crud != 'false') {
294
+ if (info.crud != 'false' && info.save != 'false') {
290
295
  let wholestring = await getText(info);
291
296
  crud.updateDocument({
292
297
  collection: info.collection,