@cocreate/text 1.15.12 → 1.15.13
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 +7 -0
- package/package.json +1 -1
- package/src/index.js +11 -5
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [1.15.13](https://github.com/CoCreate-app/CoCreate-text/compare/v1.15.12...v1.15.13) (2022-03-22)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* removed emit from message.send and message.listen ([b672bb5](https://github.com/CoCreate-app/CoCreate-text/commit/b672bb57ee7005a0d1933bd014c079a6faa96cbd))
|
7
|
+
|
1
8
|
## [1.15.12](https://github.com/CoCreate-app/CoCreate-text/compare/v1.15.11...v1.15.12) (2022-03-21)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
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
|
-
|
116
|
-
if (
|
117
|
-
|
118
|
-
|
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){
|
@@ -308,7 +311,10 @@ function updateElements({elements, collection, document_id, name, value, start,
|
|
308
311
|
|
309
312
|
async function updateElement ({element, collection, document_id, name, value, start, length, string }) {
|
310
313
|
if (element.tagName == 'IFRAME') {
|
314
|
+
let eid = element.getAttribute('eid')
|
311
315
|
element = element.contentDocument.documentElement;
|
316
|
+
if (eid != 'false' && eid != null && eid != undefined)
|
317
|
+
element.setAttribute('eid', eid)
|
312
318
|
if (element.contenteditable != 'false')
|
313
319
|
element.contentEditable = true;
|
314
320
|
}
|