hyperclayjs 1.20.1 → 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/README.md CHANGED
@@ -103,7 +103,7 @@ import 'hyperclayjs/presets/standard.js';
103
103
 
104
104
  | Module | Size | Description |
105
105
  |--------|------|-------------|
106
- | all-js | 14.4KB | Full DOM manipulation library |
106
+ | all-js | 14.7KB | Full DOM manipulation library |
107
107
  | dom-ready | 0.4KB | DOM ready callback |
108
108
  | form-data | 2KB | Extract form data as an object |
109
109
  | style-injection | 4.2KB | Dynamic stylesheet injection |
@@ -142,7 +142,7 @@ Standard feature set for most use cases
142
142
 
143
143
  **Modules:** `save-core`, `snapshot`, `save-system`, `unsaved-warning`, `edit-mode-helpers`, `persist`, `option-visibility`, `event-attrs`, `dom-helpers`, `toast`, `save-toast`, `export-to-window`, `view-mode-excludes-edit-modules`
144
144
 
145
- ### Everything (~214.4KB)
145
+ ### Everything (~214.7KB)
146
146
  All available features
147
147
 
148
148
  Includes all available modules across all categories.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperclayjs",
3
- "version": "1.20.1",
3
+ "version": "1.20.2",
4
4
  "description": "Modular JavaScript library for building interactive malleable HTML files with Hyperclay",
5
5
  "type": "module",
6
6
  "main": "src/hyperclay.js",
@@ -207,9 +207,15 @@ const createMethodHandler = (elements, plugins, methods) => ({
207
207
  },
208
208
 
209
209
  set(target, prop, value) {
210
- elements.forEach(el => {
211
- el[prop] = value;
212
- });
210
+ if (typeof value === 'function') {
211
+ elements.forEach(el => {
212
+ el[prop] = value(el);
213
+ });
214
+ } else {
215
+ elements.forEach(el => {
216
+ el[prop] = value;
217
+ });
218
+ }
213
219
  return true;
214
220
  }
215
221
  });
@@ -253,9 +259,15 @@ const createIntermediateProxy = (elements, propName, plugins, methods) => {
253
259
  },
254
260
 
255
261
  set(target, prop, value) {
256
- elements.forEach(el => {
257
- el[propName][prop] = value;
258
- });
262
+ if (typeof value === 'function') {
263
+ elements.forEach(el => {
264
+ el[propName][prop] = value(el);
265
+ });
266
+ } else {
267
+ elements.forEach(el => {
268
+ el[propName][prop] = value;
269
+ });
270
+ }
259
271
  return true;
260
272
  }
261
273
  });
package/src/hyperclay.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * DO NOT EDIT THIS FILE DIRECTLY — it is generated from build/hyperclay.template.js
3
3
  *
4
- * HyperclayJS v1.20.1 - Minimal Browser-Native Loader
4
+ * HyperclayJS v1.20.2 - Minimal Browser-Native Loader
5
5
  *
6
6
  * Modules auto-init when imported (no separate init call needed).
7
7
  * Include `export-to-window` feature to export to window.hyperclay.