@cocreate/render 1.16.0 → 1.16.2

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,19 @@
1
+ ## [1.16.2](https://github.com/CoCreate-app/CoCreate-render/compare/v1.16.1...v1.16.2) (2022-11-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump d@cocreate ependencies ([01decf7](https://github.com/CoCreate-app/CoCreate-render/commit/01decf7c4d526e190b76fe27dacff7918223131f))
7
+
8
+ ## [1.16.1](https://github.com/CoCreate-app/CoCreate-render/compare/v1.16.0...v1.16.1) (2022-11-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * data.document._id ([b416a9c](https://github.com/CoCreate-app/CoCreate-render/commit/b416a9cfe975d8454a34d176a60c326a4dbf82c4))
14
+ * improved handling of data structure, added @cocreate/element-prototype ([e458cfc](https://github.com/CoCreate-app/CoCreate-render/commit/e458cfc7fbf034701cc7e90bacc625d6705c4259))
15
+ * renamed {{data.key}} to {{document.key}} ([f108b83](https://github.com/CoCreate-app/CoCreate-render/commit/f108b8324f80f22b3b784f02738949e7b357912f))
16
+
1
17
  # [1.16.0](https://github.com/CoCreate-app/CoCreate-render/compare/v1.15.11...v1.16.0) (2022-10-03)
2
18
 
3
19
 
@@ -12,8 +12,8 @@
12
12
 
13
13
  <cocreate-select name="current_org" template_id="abc1">
14
14
  <selected class="template" template_id="abc1" render-array="data">
15
- <cc-option class="template" value="{{data.current_org}}">
16
- <h3>{{data.current_org}}</h3>
15
+ <cc-option class="template" value="{{document.current_org}}">
16
+ <h3>{{document.current_org}}</h3>
17
17
  </cc-option>
18
18
  </selected>
19
19
  </cocreate-select>
package/demo/render.html CHANGED
@@ -13,8 +13,8 @@
13
13
  <body>
14
14
 
15
15
  <div class="template" template_id="abc1">
16
- <h3>{{collection}}</h3>
17
- <h3>{{data._id}}</h3>
16
+ <h3>{{document.collection}}</h3>
17
+ <h3>{{document._id}}</h3>
18
18
  </div>
19
19
 
20
20
  <pre>
@@ -12,7 +12,7 @@
12
12
 
13
13
  <div class="template" template_id="abc1">
14
14
  <!-- <div>{{data}}</div>
15
- <h1> {{data.collection}} {{data._id}}</h1> -->
15
+ <h1> {{document.collection}} {{document._id}}</h1> -->
16
16
  <div class="template" render-object="" render-key="one">
17
17
  <h5>{{one.key}}: {{one.value}}</h5>
18
18
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/render",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
4
4
  "description": "A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "render",
@@ -61,9 +61,10 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/actions": "^1.5.12",
65
- "@cocreate/api": "^1.4.12",
66
- "@cocreate/docs": "^1.3.18",
67
- "@cocreate/utils": "^1.10.12"
64
+ "@cocreate/actions": "^1.5.13",
65
+ "@cocreate/api": "^1.5.0",
66
+ "@cocreate/docs": "^1.3.20",
67
+ "@cocreate/element-prototype": "^1.0.0",
68
+ "@cocreate/utils": "^1.10.14"
68
69
  }
69
70
  }
package/src/index.js CHANGED
@@ -3,8 +3,8 @@ import action from '@cocreate/actions';
3
3
  import observer from '@cocreate/observer';
4
4
  import uuid from '@cocreate/uuid';
5
5
  import { queryDocumentSelector } from '@cocreate/utils';
6
+ import '@cocreate/element-prototype';
6
7
  import './index.css';
7
- // import { getValue } from '../../CoCreate-elements/src/getValue';
8
8
  // import api from '@cocreate/api';
9
9
 
10
10
  const CoCreateRender = {
@@ -70,11 +70,11 @@ const CoCreateRender = {
70
70
  variables.forEach((attr) => {
71
71
  let value;
72
72
 
73
- if (attr == "{{data._id}}" || attr == `{{${renderKey}._id}}` || attr == "{{document_id}}")
74
- value = this.document_id;
75
- else if (attr == "{{collection}" || attr == `{{${renderKey}.collection}}`)
76
- value = this.collection;
77
- else
73
+ // if (attr == "{{data._id}}" || attr == `{{${renderKey}._id}}` || attr == "{{document_id}}" || attr == "{{document._id}}")
74
+ // value = this.document_id;
75
+ // else if (attr == "{{collection}" || attr == `{{${renderKey}.collection}}`)
76
+ // value = this.collection;
77
+ // else
78
78
  value = self.__getValue(data, attr);
79
79
 
80
80
  if (value) {
@@ -234,11 +234,11 @@ const CoCreateRender = {
234
234
  if (data.renderKey)
235
235
  isRenderKey = true
236
236
 
237
- if (data.document_id || data.data && data.data._id)
238
- this.document_id = data.document_id || data.data._id;
237
+ // if (data.document._id)
238
+ // this.document_id = data.document._id;
239
239
 
240
- if (data.collection)
241
- this.collection = data.collection;
240
+ // if (data.collection)
241
+ // this.collection = data.collection;
242
242
 
243
243
  const that = this;
244
244
  Array.from(els).forEach(el => {