@cocreate/elements 1.42.6 → 1.42.8

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.
@@ -22,13 +22,13 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
24
  - name: Checkout
25
- uses: actions/checkout@v3
25
+ uses: actions/checkout@v4
26
26
  - name: Setup Node.js
27
- uses: actions/setup-node@v3
27
+ uses: actions/setup-node@v4
28
28
  with:
29
- node-version: 14
29
+ node-version: 22 # Required for the latest semantic-release plugins
30
30
  - name: Semantic Release
31
- uses: cycjimmy/semantic-release-action@v3
31
+ uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
32
32
  id: semantic
33
33
  with:
34
34
  extra_plugins: |
@@ -36,9 +36,8 @@ jobs:
36
36
  @semantic-release/git
37
37
  @semantic-release/github
38
38
  env:
39
- GITHUB_TOKEN: "${{ secrets.GITHUB }}"
39
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Use the built-in token if possible
40
40
  NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
41
41
  outputs:
42
42
  new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
43
43
  new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
44
-
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## [1.42.8](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.42.7...v1.42.8) (2026-01-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update worklow ([f1e9d67](https://github.com/CoCreate-app/CoCreate-elements/commit/f1e9d6705f1bf72f0aa2baa7147480b3b5ff1b2e))
7
+
8
+ ## [1.42.7](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.42.6...v1.42.7) (2025-11-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * correct formatting in save function to ensure proper data handling ([19e0bdc](https://github.com/CoCreate-app/CoCreate-elements/commit/19e0bdccd02e95ffc4c0db22b7a96ad18bad663a))
14
+ * enhance setAttribute function to respect form-attributes and streamline attribute setting ([ce6c03b](https://github.com/CoCreate-app/CoCreate-elements/commit/ce6c03bfca08ac4634320725a72820fde49f604e))
15
+ * update filterData function to handle key-based data rendering ([2b4aecb](https://github.com/CoCreate-app/CoCreate-elements/commit/2b4aecb4f56ec0eb2666a56041b41f6191cb4e5e))
16
+ * update initElements function to correctly handle 'rendered' attribute and improve src validation ([a371968](https://github.com/CoCreate-app/CoCreate-elements/commit/a371968596c5c50a7f53c6f822ab7e432e985bad))
17
+
1
18
  ## [1.42.6](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.42.5...v1.42.6) (2025-10-10)
2
19
 
3
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/elements",
3
- "version": "1.42.6",
3
+ "version": "1.42.8",
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",
package/src/fetchSrc.js CHANGED
@@ -37,9 +37,12 @@ async function initElements(elements) {
37
37
  if (element.tagName === "AUDIO" || element.tagName === "VIDEO") {
38
38
  initMediaSource(element, src);
39
39
  } else {
40
- if (src && !textExtensions.includes(src.split('.').pop())) return
41
- element.removeAttribute("rendered");
40
+ if (src && !textExtensions.includes(src.split('.').pop())) continue
42
41
 
42
+ if (element.hasAttribute("rendered")) {
43
+ element.removeAttribute("rendered");
44
+ // continue;
45
+ }
43
46
  let text = await response.text();
44
47
  if (text) {
45
48
  let path = "";
package/src/form.js CHANGED
@@ -71,16 +71,15 @@ const formAttributesSelector = formAttributes.map((attr) => `[${attr}]`).join(",
71
71
  */
72
72
  function setAttribute(form, elements) {
73
73
  if (!elements) elements = form.querySelectorAll(formAttributesSelector);
74
-
75
- for (let attribute of form.attributes) {
76
- if (!formAttributes.includes(attribute.name)) continue;
77
-
78
- for (let el of elements) {
74
+ for (let el of elements) {
75
+ if (el.getAttribute("form-attributes") === "false") continue;
76
+ for (let attribute of form.attributes) {
77
+ if (!formAttributes.includes(attribute.name)) continue;
78
+ // let elArray = el.getAttribute("array");
79
+ // if (elArray && attribute.name === "array" && elArray !== attribute.value) break;
79
80
  // Set the value of the attribute.
80
- // TODO: skip-attribute naming convention, perhaps skip by defualt if storage, database, array not the same and use attribute to apply for cases where one _id will be used across 2 arrays
81
- if ( !el.hasAttribute("skip-attribute") ) {
82
- el.setAttribute(attribute.name, attribute.value);
83
- }
81
+ // TODO: form-attributes="false" naming convention, perhaps skip by defualt if storage, database, array not the same and use attribute to apply for cases where one _id will be used across 2 arrays
82
+ el.setAttribute(attribute.name, attribute.value);
84
83
  }
85
84
  }
86
85
  }
package/src/index.js CHANGED
@@ -551,6 +551,8 @@ async function filterData(element, data, type, key) {
551
551
  ) {
552
552
  await checkFilters(element, data, type);
553
553
  } else if (element.renderValue) {
554
+ if (key)
555
+ data = {[key]: data}
554
556
  await element.renderValue(data);
555
557
  } else if (key === "$length") {
556
558
  element.setValue(data[type].length);
@@ -1114,7 +1116,7 @@ async function save(element, action) {
1114
1116
  data[i].method = "object.update";
1115
1117
  if (upsert) data[i].upsert = true;
1116
1118
  }
1117
- }
1119
+ }
1118
1120
  }
1119
1121
 
1120
1122
  if (data[i].isUpsert) {