@cocreate/elements 1.14.7 → 1.15.0

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,22 @@
1
+ # [1.15.0](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.14.8...v1.15.0) (2023-01-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([c4afd3c](https://github.com/CoCreate-app/CoCreate-elements/commit/c4afd3c24e1c0962f3c7281333ff628541b15ef9))
7
+
8
+
9
+ ### Features
10
+
11
+ * use setValue() ([fd14270](https://github.com/CoCreate-app/CoCreate-elements/commit/fd14270bd8a92cc8c6117bbbc11f247962d32515))
12
+
13
+ ## [1.14.8](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.14.7...v1.14.8) (2023-01-09)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * bump dependnecies ([1882a61](https://github.com/CoCreate-app/CoCreate-elements/commit/1882a618ea98b9ca558014e616713cb0d8e835e3))
19
+
1
20
  ## [1.14.7](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.14.6...v1.14.7) (2023-01-06)
2
21
 
3
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/elements",
3
- "version": "1.14.7",
3
+ "version": "1.15.0",
4
4
  "description": "Fetch content into any html element by using html5 attributes to query data stored in CoCreate headless CMS. If data is changed it will instantly reflect in html tags as changes are broadcasted in realtime",
5
5
  "keywords": [
6
6
  "elements",
@@ -60,11 +60,11 @@
60
60
  "webpack-log": "^3.0.1"
61
61
  },
62
62
  "dependencies": {
63
- "@cocreate/actions": "^1.5.50",
64
- "@cocreate/crud-client": "^1.17.12",
65
- "@cocreate/docs": "^1.5.4",
66
- "@cocreate/element-prototype": "^1.2.25",
67
- "@cocreate/observer": "^1.5.54",
68
- "@cocreate/utils": "^1.17.16"
63
+ "@cocreate/actions": "^1.5.52",
64
+ "@cocreate/crud-client": "^1.17.15",
65
+ "@cocreate/docs": "^1.5.6",
66
+ "@cocreate/element-prototype": "^1.4.0",
67
+ "@cocreate/observer": "^1.5.56",
68
+ "@cocreate/utils": "^1.17.19"
69
69
  }
70
70
  }
package/src/fetchSrc.js CHANGED
@@ -21,29 +21,14 @@ async function initElement(element) {
21
21
  initializing.set(element, {src});
22
22
  if (src) {
23
23
  try {
24
- let response = await fetch(src); // Gets a promise
25
- let text = await response.text(); // Replaces body with response
24
+ let response = await fetch(src);
25
+ let text = await response.text();
26
26
  if (text) {
27
- let dom = document.createElement('dom')
28
- dom.innerHTML = text;
29
-
30
- let CoCreateJS = dom.querySelector('script[src*="CoCreate.js"], script[src*="CoCreate.min.js"]')
31
- if (CoCreateJS)
32
- CoCreateJS.remove()
33
-
34
- let CoCreateCSS = dom.querySelector('link[href*="CoCreate.css"], link[href*="CoCreate.min.css"]')
35
- if (CoCreateCSS)
36
- CoCreateCSS.remove()
37
-
38
- let css = dom.querySelector('link[collection], link[document]')
39
- if (css)
40
- css.remove()
41
-
42
- element.innerHTML = dom.innerHTML; // Replaces body with response
27
+ element.setValue(text);
43
28
  initializing.delete(element)
44
29
  }
45
30
  } catch (err) {
46
- console.log('FetchSrc error:' + err); // Error handling
31
+ console.log('FetchSrc error:' + err);
47
32
  }
48
33
  }
49
34
  }