@cocreate/state 1.24.5 → 1.24.7

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,17 @@
1
+ ## [1.24.7](https://github.com/CoCreate-app/CoCreate-state/compare/v1.24.6...v1.24.7) (2026-02-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update worklow ([7efc914](https://github.com/CoCreate-app/CoCreate-state/commit/7efc914ab3fec6225d2259e9aecbaa4a051e524f))
7
+
8
+ ## [1.24.6](https://github.com/CoCreate-app/CoCreate-state/compare/v1.24.5...v1.24.6) (2025-11-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * correct method name for retrieving element value and enhance state attribute handling ([bda5c5a](https://github.com/CoCreate-app/CoCreate-state/commit/bda5c5a2ed26215b824b75052e4cf19f5f3c16b3))
14
+
1
15
  ## [1.24.5](https://github.com/CoCreate-app/CoCreate-state/compare/v1.24.4...v1.24.5) (2025-09-07)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/state",
3
- "version": "1.24.5",
3
+ "version": "1.24.7",
4
4
  "description": "Data attributes which can be used for components in CoCreate framework combined as a group of attributes that dynamically change attributes & fetch custom data.",
5
5
  "keywords": [
6
6
  "state",
package/src/index.js CHANGED
@@ -126,14 +126,21 @@ async function stateAttributes(element) {
126
126
  }
127
127
  let elements = [];
128
128
 
129
- let form = element.closest("form");
130
- if (form) {
131
- elements = form.querySelectorAll("[state_to]");
132
- } else {
133
- if (element.hasAttribute("state_to")) elements.push(element);
134
- let nestedElements = element.querySelectorAll("[state_to]");
135
- elements.push(...nestedElements);
129
+ // let form = element.closest("form");
130
+ // if (form) {
131
+ // elements = form.querySelectorAll("[state_to]");
132
+ // } else {
133
+ if (element.hasAttribute("state_to")) elements.push(element);
134
+ let nestedElements = element.querySelectorAll("[state_to]");
135
+ elements.push(...nestedElements);
136
+ let current = element;
137
+ while (current) {
138
+ if (current.hasAttribute("state_to") && !elements.includes(current)) {
139
+ elements.push(current);
140
+ }
141
+ current = current.parentElement;
136
142
  }
143
+ // }
137
144
 
138
145
  let changeState = false;
139
146
  for (let i = 0; i < elements.length; i++) {
@@ -187,7 +194,7 @@ async function _getAttributeValues(element) {
187
194
  });
188
195
  else if (attribute.name == "state-value" && !attribute.value)
189
196
  Object.assign(attributeValues, {
190
- value: await element.getvalue()
197
+ value: await element.getValue()
191
198
  });
192
199
  else
193
200
  Object.assign(attributeValues, {
@@ -200,7 +207,7 @@ async function _getAttributeValues(element) {
200
207
  !element.hasAttribute("state-value") &&
201
208
  element.getvalue
202
209
  )
203
- Object.assign(attributeValues, { value: await element.getvalue() });
210
+ Object.assign(attributeValues, { value: await element.getValue() });
204
211
 
205
212
  return attributeValues;
206
213
  }