@cocreate/elements 1.20.0 → 1.20.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 +14 -0
- package/CoCreate.config.js +25 -25
- package/package.json +8 -8
- package/src/index.js +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.20.2](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.20.1...v1.20.2) (2023-09-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* get type from method ([274751e](https://github.com/CoCreate-app/CoCreate-elements/commit/274751e8ef66e8ef19cf8d323297599e78c82ef9))
|
|
7
|
+
|
|
8
|
+
## [1.20.1](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.20.0...v1.20.1) (2023-08-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies ([3f6e9ac](https://github.com/CoCreate-app/CoCreate-elements/commit/3f6e9ac30e280c9a34404564003f0cf3e8a38130))
|
|
14
|
+
|
|
1
15
|
# [1.20.0](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.19.3...v1.20.0) (2023-08-21)
|
|
2
16
|
|
|
3
17
|
|
package/CoCreate.config.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"organization_id": "",
|
|
3
|
-
"key": "",
|
|
4
|
-
"host": "",
|
|
5
|
-
"sources": [
|
|
6
|
-
{
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
"organization_id": "",
|
|
3
|
+
"key": "",
|
|
4
|
+
"host": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
{
|
|
7
|
+
"entry": "./docs",
|
|
8
|
+
"exclude": [
|
|
9
|
+
"demo"
|
|
10
|
+
],
|
|
11
|
+
"array": "files",
|
|
12
|
+
"object": {
|
|
13
|
+
"name": "{{name}}",
|
|
14
|
+
"src": "{{source}}",
|
|
15
|
+
"host": [
|
|
16
|
+
"*"
|
|
17
|
+
],
|
|
18
|
+
"directory": "/docs/{{directory}}",
|
|
19
|
+
"path": "{{path}}",
|
|
20
|
+
"content-type": "{{content-type}}",
|
|
21
|
+
"public": "true"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/elements",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2",
|
|
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",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/actions": "^1.
|
|
62
|
-
"@cocreate/crud-client": "^1.
|
|
63
|
-
"@cocreate/element-prototype": "^1.
|
|
64
|
-
"@cocreate/filter": "^1.
|
|
65
|
-
"@cocreate/observer": "^1.
|
|
66
|
-
"@cocreate/render": "^1.
|
|
67
|
-
"@cocreate/utils": "^1.
|
|
61
|
+
"@cocreate/actions": "^1.11.0",
|
|
62
|
+
"@cocreate/crud-client": "^1.24.0",
|
|
63
|
+
"@cocreate/element-prototype": "^1.11.0",
|
|
64
|
+
"@cocreate/filter": "^1.22.0",
|
|
65
|
+
"@cocreate/observer": "^1.11.0",
|
|
66
|
+
"@cocreate/render": "^1.27.0",
|
|
67
|
+
"@cocreate/utils": "^1.24.0"
|
|
68
68
|
}
|
|
69
69
|
}
|
package/src/index.js
CHANGED
|
@@ -240,7 +240,7 @@ async function read(element, data, dataKey) {
|
|
|
240
240
|
debounce.set(dataKey.string, delayTimer)
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
function setData(element, data
|
|
243
|
+
function setData(element, data) {
|
|
244
244
|
if (!element) {
|
|
245
245
|
element = getDataElements(data)
|
|
246
246
|
if (!element.length) return
|
|
@@ -250,8 +250,8 @@ function setData(element, data, action) {
|
|
|
250
250
|
element = [element]
|
|
251
251
|
|
|
252
252
|
let type = data.type
|
|
253
|
-
if (!type &&
|
|
254
|
-
type =
|
|
253
|
+
if (!type && data.method) {
|
|
254
|
+
type = data.method.split('.')[1]
|
|
255
255
|
} else if (type == 'key')
|
|
256
256
|
type = 'object'
|
|
257
257
|
|
|
@@ -263,7 +263,7 @@ function setData(element, data, action) {
|
|
|
263
263
|
if (!data[type])
|
|
264
264
|
continue;
|
|
265
265
|
|
|
266
|
-
action = el.getAttribute('actions')
|
|
266
|
+
let action = el.getAttribute('actions')
|
|
267
267
|
if (action && ['database', 'array', 'object', 'key'].includes(action)) continue;
|
|
268
268
|
|
|
269
269
|
const { key, isRead, isListen, isCrdt } = getAttributes(el);
|
|
@@ -751,13 +751,13 @@ function initSocket() {
|
|
|
751
751
|
const action = array[i] + '.' + attributes[j];
|
|
752
752
|
|
|
753
753
|
CRUD.listen(action, function (data) {
|
|
754
|
-
setData(null, data
|
|
754
|
+
setData(null, data);
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
CRUD.listen('sync', function (data) {
|
|
760
|
-
setData(null, data
|
|
760
|
+
setData(null, data);
|
|
761
761
|
});
|
|
762
762
|
|
|
763
763
|
}
|
|
@@ -838,6 +838,8 @@ function dndCrudData(element, parent, operator) {
|
|
|
838
838
|
newData[newData.type].push({ ...previousData, ...Data })
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
|
+
|
|
842
|
+
|
|
841
843
|
} else {
|
|
842
844
|
newData[newData.type] = [{ ...data[data.type][index], ...Data }]
|
|
843
845
|
}
|
|
@@ -870,6 +872,7 @@ function dndNewData(element, data) {
|
|
|
870
872
|
}
|
|
871
873
|
}
|
|
872
874
|
|
|
875
|
+
|
|
873
876
|
let keyPath, clonesMap, clones, index
|
|
874
877
|
|
|
875
878
|
let renderedNode = CoCreate.render.renderedNodes.get(element)
|