@cocreate/text 1.15.12 → 1.15.15

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.15.15](https://github.com/CoCreate-app/CoCreate-text/compare/v1.15.14...v1.15.15) (2022-05-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update config organization_Id to organization_id ([4c363f2](https://github.com/CoCreate-app/CoCreate-text/commit/4c363f2c0709082f85a59b514ca57fcbb0d19627))
7
+
8
+ ## [1.15.14](https://github.com/CoCreate-app/CoCreate-text/compare/v1.15.13...v1.15.14) (2022-04-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * activeCursor element defined on window object ([88e4575](https://github.com/CoCreate-app/CoCreate-text/commit/88e457592fac304ffd02e56c491688d598838e6f))
14
+
15
+ ## [1.15.13](https://github.com/CoCreate-app/CoCreate-text/compare/v1.15.12...v1.15.13) (2022-03-22)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * removed emit from message.send and message.listen ([b672bb5](https://github.com/CoCreate-app/CoCreate-text/commit/b672bb57ee7005a0d1933bd014c079a6faa96cbd))
21
+
1
22
  ## [1.15.12](https://github.com/CoCreate-app/CoCreate-text/compare/v1.15.11...v1.15.12) (2022-03-21)
2
23
 
3
24
 
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  "config": {
3
3
  "apiKey": "2061acef-0451-4545-f754-60cf8160",
4
- "organization_Id": "5ff747727005da1c272740ab",
4
+ "organization_id": "5ff747727005da1c272740ab",
5
5
  "host": "general.cocreate.app"
6
6
  },
7
7
 
@@ -197,7 +197,7 @@
197
197
  <script>
198
198
  var config = {
199
199
  apiKey: 'c2b08663-06e3-440c-ef6f-13978b42883a',
200
- organization_Id: '5de0387b12e200ea63204d6c',
200
+ organization_id: '5de0387b12e200ea63204d6c',
201
201
  host: 'wss://ws.cocreate.app'
202
202
  }
203
203
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/text",
3
- "version": "1.15.12",
3
+ "version": "1.15.15",
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",
package/src/index.js CHANGED
@@ -112,11 +112,14 @@ function _mousedown (event) {
112
112
  // const path = event.path || (event.composedPath && event.composedPath());
113
113
  // console.log(path)
114
114
  if (!target.id){
115
- let eid = target.getAttribute('eid');
116
- if (!eid){
117
- eid = uuid.generate(6);
118
- setAttribute({ domTextEditor, target, name: 'eid', value: eid });
119
- }
115
+ let isEid = domTextEditor.getAttribute('eid');
116
+ if (isEid != 'false' && isEid != null && isEid != undefined){
117
+ let eid = target.getAttribute('eid');
118
+ if (!eid){
119
+ eid = uuid.generate(6);
120
+ setAttribute({ domTextEditor, target, name: 'eid', value: eid });
121
+ }
122
+ }
120
123
  }
121
124
  let contentEditable = target.closest('[collection][document_id][name]');
122
125
  if (contentEditable){
@@ -254,6 +257,7 @@ export function sendPosition (element) {
254
257
  return;
255
258
  previousPosition = currentPosition;
256
259
  element.activeElement = element;
260
+ window.activeElement = element;
257
261
  cursors.sendPosition({ collection, document_id, name, start, end });
258
262
  }
259
263
 
@@ -308,7 +312,10 @@ function updateElements({elements, collection, document_id, name, value, start,
308
312
 
309
313
  async function updateElement ({element, collection, document_id, name, value, start, length, string }) {
310
314
  if (element.tagName == 'IFRAME') {
315
+ let eid = element.getAttribute('eid')
311
316
  element = element.contentDocument.documentElement;
317
+ if (eid != 'false' && eid != null && eid != undefined)
318
+ element.setAttribute('eid', eid)
312
319
  if (element.contenteditable != 'false')
313
320
  element.contentEditable = true;
314
321
  }