@cocreate/state 1.24.3 → 1.24.5

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,17 @@
1
+ ## [1.24.5](https://github.com/CoCreate-app/CoCreate-state/compare/v1.24.4...v1.24.5) (2025-09-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * enhance attribute handling for elements with operator prefix ([9838a6e](https://github.com/CoCreate-app/CoCreate-state/commit/9838a6eb25dbe2c482d6c7e730039e175a2a1fc0))
7
+
8
+ ## [1.24.4](https://github.com/CoCreate-app/CoCreate-state/compare/v1.24.3...v1.24.4) (2025-05-01)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update [@cocreate](https://github.com/cocreate) dependencies ([3ae5d59](https://github.com/CoCreate-app/CoCreate-state/commit/3ae5d59ad59d51fdf10c767a0fcb358e7c9064b2))
14
+
1
15
  ## [1.24.3](https://github.com/CoCreate-app/CoCreate-state/compare/v1.24.2...v1.24.3) (2025-04-30)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,18 +1,10 @@
1
1
  {
2
2
  "name": "@cocreate/state",
3
- "version": "1.24.3",
3
+ "version": "1.24.5",
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",
7
- "cocreate",
8
- "low-code-framework",
9
- "no-code-framework",
10
- "cocreatejs",
11
- "cocreatejs-component",
12
- "cocreate-framework",
13
- "no-code",
14
7
  "low-code",
15
- "collaborative-framework",
16
8
  "realtime",
17
9
  "realtime-framework",
18
10
  "collaboration",
@@ -54,11 +46,11 @@
54
46
  "webpack-log": "^3.0.1"
55
47
  },
56
48
  "dependencies": {
57
- "@cocreate/actions": "^1.21.0",
58
- "@cocreate/crud-client": "^1.34.1",
59
- "@cocreate/element-prototype": "^1.29.0",
60
- "@cocreate/local-storage": "^1.16.1",
61
- "@cocreate/observer": "^1.18.0",
62
- "@cocreate/uuid": "^1.12.0"
49
+ "@cocreate/actions": "^1.21.1",
50
+ "@cocreate/crud-client": "^1.34.2",
51
+ "@cocreate/element-prototype": "^1.29.1",
52
+ "@cocreate/local-storage": "^1.16.2",
53
+ "@cocreate/observer": "^1.18.1",
54
+ "@cocreate/uuid": "^1.12.1"
63
55
  }
64
56
  }
package/src/index.js CHANGED
@@ -96,8 +96,19 @@ async function _setAttributeValue(element, attribute, value, isOverwrite) {
96
96
  (element.hasAttribute("value") && !(await element.getValue()))
97
97
  )
98
98
  element.setValue(value);
99
- } else if (element.hasAttribute(attribute) && (value || value === ""))
99
+ } else if (element.hasAttribute(attribute) && (value || value === "")) {
100
100
  element.setAttribute(attribute, value);
101
+ } else if (attribute.startsWith("$")) {
102
+ // Handle using operators.js
103
+ const prop = attribute.substring(1);
104
+ if (element[prop]) {
105
+ if (typeof element[prop] === "function") {
106
+ element[prop](value);
107
+ } else {
108
+ element[prop] = value;
109
+ }
110
+ }
111
+ }
101
112
  }
102
113
  }
103
114