@cocreate/text 1.17.3 → 1.17.6

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,24 @@
1
+ ## [1.17.6](https://github.com/CoCreate-app/CoCreate-text/compare/v1.17.5...v1.17.6) (2022-09-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump all of [@cocreate](https://github.com/cocreate) dependencies ([adff98e](https://github.com/CoCreate-app/CoCreate-text/commit/adff98ee487011d1deaeb1f15295318759899531))
7
+
8
+ ## [1.17.5](https://github.com/CoCreate-app/CoCreate-text/compare/v1.17.4...v1.17.5) (2022-08-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * rename variables isBroadcast and isBroadcastSender to broadcast and broadcastSender ([57bcc6f](https://github.com/CoCreate-app/CoCreate-text/commit/57bcc6fc40df63491d24565d987140f0a83593aa))
14
+
15
+ ## [1.17.4](https://github.com/CoCreate-app/CoCreate-text/compare/v1.17.3...v1.17.4) (2022-08-18)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * if CurCaret.range ([a0a1678](https://github.com/CoCreate-app/CoCreate-text/commit/a0a1678236f1805ec246def322eedad4267ce498))
21
+
1
22
  ## [1.17.3](https://github.com/CoCreate-app/CoCreate-text/compare/v1.17.2...v1.17.3) (2022-07-25)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/text",
3
- "version": "1.17.3",
3
+ "version": "1.17.6",
4
4
  "description": "A simple text component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "text",
@@ -61,15 +61,15 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/actions": "^1.4.3",
65
- "@cocreate/crdt": "^1.11.1",
66
- "@cocreate/crud-client": "^1.7.1",
67
- "@cocreate/cursors": "^1.11.21",
68
- "@cocreate/docs": "^1.3.3",
69
- "@cocreate/hosting": "^1.3.3",
70
- "@cocreate/observer": "^1.5.3",
71
- "@cocreate/selection": "^1.4.11",
72
- "@cocreate/utils": "^1.7.4",
73
- "@cocreate/uuid": "^1.2.4"
64
+ "@cocreate/actions": "^1.5.0",
65
+ "@cocreate/crdt": "^1.13.2",
66
+ "@cocreate/crud-client": "^1.10.0",
67
+ "@cocreate/cursors": "^1.11.23",
68
+ "@cocreate/docs": "^1.3.5",
69
+ "@cocreate/hosting": "^1.3.4",
70
+ "@cocreate/observer": "^1.5.4",
71
+ "@cocreate/selection": "^1.4.13",
72
+ "@cocreate/utils": "^1.10.0",
73
+ "@cocreate/uuid": "^1.2.5"
74
74
  }
75
75
  }
@@ -4,19 +4,19 @@ import crud from '@cocreate/crud-client';
4
4
  import crdt from '@cocreate/crdt';
5
5
 
6
6
  function save(btn){
7
- const { collection, document_id, name, namespace, room, isBroadcast, isBroadcastSender, isUpsert} = crud.getAttr(btn);
7
+ const { collection, document_id, name, namespace, room, broadcast, broadcastSender, isUpsert} = crud.getAttr(btn);
8
8
  crdt.getText({collection, document_id, name}).then(response => {
9
9
  crud.updateDocument({
10
- collection: collection,
11
- document_id: document_id,
10
+ collection,
11
+ document_id,
12
12
  data: {
13
13
  [name]: response
14
14
  },
15
15
  upsert: isUpsert,
16
- namespace: namespace,
17
- room: room,
18
- broadcast: isBroadcast,
19
- broadcast_sender: isBroadcastSender
16
+ namespace,
17
+ room,
18
+ broadcast,
19
+ broadcastSender
20
20
  });
21
21
 
22
22
  document.dispatchEvent(new CustomEvent('savedDomText'));
package/src/updateDom.js CHANGED
@@ -147,8 +147,8 @@ export function updateDom({domTextEditor, value, start, end, html}) {
147
147
  domTextEditor.htmlString = html;
148
148
 
149
149
  if(curCaret && start >= 0 && end >= 0) {
150
- if (curCaret.range.startContainer == domEl)
151
- if (curCaret.range && curCaret.start >= curCaret.range.startOffset) {
150
+ if (curCaret.range && curCaret.range.startContainer == domEl)
151
+ if (curCaret.start >= curCaret.range.startOffset) {
152
152
  let p = processSelection(domEl, value, curCaret.start, curCaret.end, start, end, curCaret.range);
153
153
  sendPosition(domEl);
154
154
  _dispatchInputEvent(p.element, p.value, p.start, p.end, p.prev_start, p.prev_end);