@cocreate/text 1.18.42 → 1.18.44

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +11 -11
  3. package/src/index.js +12 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.18.44](https://github.com/CoCreate-app/CoCreate-text/compare/v1.18.43...v1.18.44) (2023-01-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([b101f34](https://github.com/CoCreate-app/CoCreate-text/commit/b101f342bc6214e6532756a3e76b7dc4a3e19ab2))
7
+
8
+ ## [1.18.43](https://github.com/CoCreate-app/CoCreate-text/compare/v1.18.42...v1.18.43) (2023-01-30)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * catch cross-origin error when accessing window.top ([2753de1](https://github.com/CoCreate-app/CoCreate-text/commit/2753de13aac3973358bcfac2b256a152a35b2b9e))
14
+
1
15
  ## [1.18.42](https://github.com/CoCreate-app/CoCreate-text/compare/v1.18.41...v1.18.42) (2023-01-29)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/text",
3
- "version": "1.18.42",
3
+ "version": "1.18.44",
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",
@@ -60,15 +60,15 @@
60
60
  "webpack-log": "^3.0.1"
61
61
  },
62
62
  "dependencies": {
63
- "@cocreate/actions": "^1.5.55",
64
- "@cocreate/crdt": "^1.16.1",
65
- "@cocreate/crud-client": "^1.18.3",
66
- "@cocreate/cursors": "^1.14.1",
67
- "@cocreate/docs": "^1.5.10",
68
- "@cocreate/hosting": "^1.7.10",
69
- "@cocreate/observer": "^1.5.59",
70
- "@cocreate/selection": "^1.4.64",
71
- "@cocreate/utils": "^1.17.22",
72
- "@cocreate/uuid": "^1.2.58"
63
+ "@cocreate/actions": "^1.5.56",
64
+ "@cocreate/crdt": "^1.16.2",
65
+ "@cocreate/crud-client": "^1.18.4",
66
+ "@cocreate/cursors": "^1.14.3",
67
+ "@cocreate/docs": "^1.5.11",
68
+ "@cocreate/hosting": "^1.7.11",
69
+ "@cocreate/observer": "^1.5.60",
70
+ "@cocreate/selection": "^1.4.65",
71
+ "@cocreate/utils": "^1.17.25",
72
+ "@cocreate/uuid": "^1.2.59"
73
73
  }
74
74
  }
package/src/index.js CHANGED
@@ -107,10 +107,20 @@ function initElement (element) {
107
107
  }
108
108
 
109
109
  function initDocument(doc) {
110
- let documents = window.top.textDocuments;
110
+ let documents;
111
+ try {
112
+ documents = window.top.textDocuments;
113
+ } catch(e) {
114
+ console.log('cross-origin failed')
115
+ }
116
+
111
117
  if (!documents){
112
118
  documents = new Map();
113
- window.top.textDocuments = documents;
119
+ try {
120
+ window.top.textDocuments = documents;
121
+ } catch(e) {
122
+ console.log('cross-origin failed')
123
+ }
114
124
  }
115
125
  if (!documents.has(doc)) {
116
126
  documents.set(doc);